‪TYPO3CMS  9.5
TYPO3\CMS\Core\Utility\GeneralUtility Class Reference
Inheritance diagram for TYPO3\CMS\Core\Utility\GeneralUtility:
TYPO3\CMS\Core\Tests\Unit\Configuration\TypoScript\ConditionMatching\Fixtures\GeneralUtilityFixture TYPO3\CMS\Core\Tests\Unit\Utility\Fixtures\GeneralUtilityFilesystemFixture TYPO3\CMS\Core\Tests\Unit\Utility\Fixtures\GeneralUtilityFixture TYPO3\CMS\Frontend\Tests\Unit\ContentObject\Fixtures\GeneralUtilityFixture

Public Attributes

const SYSLOG_SEVERITY_INFO = 0
 
const SYSLOG_SEVERITY_NOTICE = 1
 
const SYSLOG_SEVERITY_WARNING = 2
 
const SYSLOG_SEVERITY_ERROR = 3
 
const SYSLOG_SEVERITY_FATAL = 4
 
const ENV_TRUSTED_HOSTS_PATTERN_ALLOW_ALL = '.*'
 
const ENV_TRUSTED_HOSTS_PATTERN_SERVER_NAME = 'SERVER_NAME'
 
static if(empty($labels)) if(isset($defaultFormats[$labels])) else
 
if($base !==1000 && $base !==1024) $labelArr = explode('|', str_replace('"', '', $labels))
 
 $oldLocale = setlocale(LC_NUMERIC, 0)
 
 $newLocale = $GLOBALS['TSFE']->config['config']['locale_all'] ?? ''
 
if($newLocale) $localeInfo = localeconv()
 
if($newLocale) $sizeInBytes = max($sizeInBytes, 0)
 
 $multiplier = floor(($sizeInBytes ? log($sizeInBytes) : 0) / log($base))
 
 $sizeInUnits = $sizeInBytes / pow($base, $multiplier)
 
if($sizeInUnits >($base *.9)) $multiplier = min($multiplier, count($labelArr) - 1)
 

Static Protected Attributes

static bool $allowHostHeaderValue = false
 

Detailed Description

The legendary "t3lib_div" class - Miscellaneous functions for general purpose. Most of the functions do not relate specifically to TYPO3 However a section of functions requires certain TYPO3 features available See comments in the source. You are encouraged to use this library in your own scripts!

USE: The class is intended to be used without creating an instance of it. So: Don't instantiate - call functions with "\TYPO3\CMS\Core\Utility\GeneralUtility::" prefixed the function name. So use \TYPO3\CMS\Core\Utility\GeneralUtility::[method-name] to refer to the functions, eg. '\TYPO3\CMS\Core\Utility\GeneralUtility::milliseconds()'

Definition at line 44 of file GeneralUtility.php.

Member Data Documentation

◆ $allowHostHeaderValue

bool TYPO3\CMS\Core\Utility\GeneralUtility::$allowHostHeaderValue = false
staticprotected

State of host header value security check in order to avoid unnecessary multiple checks during one request

Definition at line 62 of file GeneralUtility.php.

Referenced by TYPO3\CMS\Core\Tests\Unit\Utility\Fixtures\GeneralUtilityFixture\setAllowHostHeaderValue().

◆ $labelArr

if ( $base !==1000 &&$base !==1024) TYPO3\CMS\Core\Utility\GeneralUtility::$labelArr = explode('|', str_replace('"', '', $labels))

Definition at line 838 of file GeneralUtility.php.

◆ $localeInfo

if ( $newLocale) TYPO3\CMS\Core\Utility\GeneralUtility::$localeInfo = localeconv()

Definition at line 846 of file GeneralUtility.php.

◆ $multiplier [1/2]

TYPO3\CMS\Core\Utility\GeneralUtility::$multiplier = floor(($sizeInBytes ? log($sizeInBytes) : 0) / log($base))

Definition at line 851 of file GeneralUtility.php.

◆ $multiplier [2/2]

if ( $sizeInUnits >( $base *.9)) TYPO3\CMS\Core\Utility\GeneralUtility::$multiplier = min($multiplier, count($labelArr) - 1)

Definition at line 856 of file GeneralUtility.php.

◆ $newLocale

TYPO3\CMS\Core\Utility\GeneralUtility::$newLocale = $GLOBALS['TSFE']->config['config']['locale_all'] ?? ''

Definition at line 842 of file GeneralUtility.php.

◆ $oldLocale

TYPO3\CMS\Core\Utility\GeneralUtility::$oldLocale = setlocale(LC_NUMERIC, 0)

Definition at line 841 of file GeneralUtility.php.

◆ $sizeInBytes

if ( $newLocale) TYPO3\CMS\Core\Utility\GeneralUtility::$sizeInBytes = max($sizeInBytes, 0)

Definition at line 850 of file GeneralUtility.php.

◆ $sizeInUnits

TYPO3\CMS\Core\Utility\GeneralUtility::$sizeInUnits = $sizeInBytes / pow($base, $multiplier)

Definition at line 852 of file GeneralUtility.php.

◆ else

if (empty( $labels)) if (isset( $defaultFormats[ $labels])) TYPO3\CMS\Core\Utility\GeneralUtility::else
Initial value:
{
$base = (int)$base

Definition at line 833 of file GeneralUtility.php.

◆ ENV_TRUSTED_HOSTS_PATTERN_ALLOW_ALL

◆ ENV_TRUSTED_HOSTS_PATTERN_SERVER_NAME

const TYPO3\CMS\Core\Utility\GeneralUtility::ENV_TRUSTED_HOSTS_PATTERN_SERVER_NAME = 'SERVER_NAME'

◆ SYSLOG_SEVERITY_ERROR

const TYPO3\CMS\Core\Utility\GeneralUtility::SYSLOG_SEVERITY_ERROR = 3

Definition at line 51 of file GeneralUtility.php.

◆ SYSLOG_SEVERITY_FATAL

const TYPO3\CMS\Core\Utility\GeneralUtility::SYSLOG_SEVERITY_FATAL = 4

Definition at line 52 of file GeneralUtility.php.

◆ SYSLOG_SEVERITY_INFO

const TYPO3\CMS\Core\Utility\GeneralUtility::SYSLOG_SEVERITY_INFO = 0

Definition at line 48 of file GeneralUtility.php.

◆ SYSLOG_SEVERITY_NOTICE

const TYPO3\CMS\Core\Utility\GeneralUtility::SYSLOG_SEVERITY_NOTICE = 1

Definition at line 49 of file GeneralUtility.php.

◆ SYSLOG_SEVERITY_WARNING

const TYPO3\CMS\Core\Utility\GeneralUtility::SYSLOG_SEVERITY_WARNING = 2

Definition at line 50 of file GeneralUtility.php.