![]() |
TYPO3
7.6
|
Static Public Member Functions | |
static | _GP ($var) |
static | _GPmerged ($parameter) |
static | _GET ($var=null) |
static | _POST ($var=null) |
static | _GETset ($inputGet, $key= '') |
static | removeXSS ($string) |
static | gif_compress ($theFile, $type) |
static | png_to_gif_by_imagemagick ($theFile) |
static | read_png_gif ($theFile, $output_png=false) |
static | fixed_lgd_cs ($string, $chars, $appendString= '...') |
static | cmpIP ($baseIP, $list) |
static | cmpIPv4 ($baseIP, $list) |
static | cmpIPv6 ($baseIP, $list) |
static | IPv6Hex2Bin ($hex) |
static | IPv6Bin2Hex ($bin) |
static | normalizeIPv6 ($address) |
static | compressIPv6 ($address) |
static | validIP ($ip) |
static | validIPv4 ($ip) |
static | validIPv6 ($ip) |
static | cmpFQDN ($baseHost, $list) |
static | isOnCurrentHost ($url) |
static | inList ($list, $item) |
static | rmFromList ($element, $list) |
static | expandList ($list) |
static | compat_version ($verNumberStr) |
static | md5int ($str) |
static | shortMD5 ($input, $len=10) |
static | hmac ($input, $additionalSecret= '') |
static | uniqueList ($in_list, $secondParameter=null) |
static | split_fileref ($fileNameWithPath) |
static | dirname ($path) |
static | modifyHTMLColor ($color, $R, $G, $B) |
static | modifyHTMLColorAll ($color, $all) |
static | isFirstPartOfStr ($str, $partStr) |
static | formatSize ($sizeInBytes, $labels= '', $base=0) |
static | convertMicrotime ($microtime) |
static | splitCalc ($string, $operators) |
static | deHSCentities ($str) |
static | slashJS ($string, $extended=false, $char= '\'') |
static | rawUrlEncodeJS ($str) |
static | rawUrlEncodeFP ($str) |
static | validEmail ($email) |
static | isBrokenEmailEnvironment () |
static | normalizeMailAddress ($address) |
static | formatForTextarea ($content) |
static | strtoupper ($str) |
static | strtolower ($str) |
static | generateRandomBytes ($bytesToReturn) |
static | idnaEncode ($value) |
static | getRandomHexString ($count) |
static | underscoredToUpperCamelCase ($string) |
static | underscoredToLowerCamelCase ($string) |
static | camelCaseToLowerCaseUnderscored ($string) |
static | lcfirst ($string) |
static | isValidUrl ($url) |
static | inArray (array $in_array, $item) |
static | intExplode ($delimiter, $string, $removeEmptyValues=false, $limit=0) |
static | revExplode ($delimiter, $string, $count=0) |
static | trimExplode ($delim, $string, $removeEmptyValues=false, $limit=0) |
static | removeArrayEntryByValue (array $array, $cmpValue) |
static | keepItemsInArray (array $array, $keepItems, $getValueFunc=null) |
static | implodeArrayForUrl ($name, array $theArray, $str= '', $skipBlank=false, $rawurlencodeParamName=false) |
static | explodeUrl2Array ($string, $multidim=false) |
static | compileSelectedGetVarsFromArray ($varList, array $getArray, $GPvarAlt=true) |
static | addSlashesOnArray (array &$theArray) |
static | stripSlashesOnArray (array &$theArray) |
static | slashArray (array $arr, $cmd) |
static | remapArrayKeys (&$array, $mappingTable) |
static | array_merge (array $arr1, array $arr2) |
static | arrayDiffAssocRecursive (array $array1, array $array2) |
static | csvValues (array $row, $delim= ',', $quote= '"') |
static | removeDotsFromTS (array $ts) |
static | naturalKeySortRecursive (&$array) |
static | get_tag_attributes ($tag) |
static | split_tag_attributes ($tag) |
static | implodeAttributes (array $arr, $xhtmlSafe=false, $dontOmitBlankAttribs=false) |
static | wrapJS ($string, $linebreak=true) |
static | xml2tree ($string, $depth=999, $parserOptions=array()) |
static | array2xml_cs (array $array, $docTag= 'phparray', array $options=array(), $charset= '') |
static | array2xml (array $array, $NSprefix= '', $level=0, $docTag= 'phparray', $spaceInd=0, array $options=array(), array $stackData=array()) |
static | xml2array ($string, $NSprefix= '', $reportDocTag=false) |
static | xmlRecompileFromStructValArray (array $vals) |
static | xmlGetHeaderAttribs ($xmlData) |
static | minifyJavaScript ($script, &$error= '') |
static | getUrl ($url, $includeHeader=0, $requestHeaders=false, &$report=null) |
static | writeFile ($file, $content, $changePermissions=false) |
static | fixPermissions ($path, $recursive=false) |
static | writeFileToTypo3tempDir ($filepath, $content) |
static | mkdir ($newFolder) |
static | mkdir_deep ($directory, $deepDirectory= '') |
static | rmdir ($path, $removeNonEmpty=false) |
static | flushDirectory ($directory, $keepOriginalDirectory=false, $flushOpcodeCache=false) |
static | get_dirs ($path) |
static | getFilesInDir ($path, $extensionList= '', $prependPath=false, $order= '', $excludePattern= '') |
static | getAllFilesAndFoldersInPath (array $fileArr, $path, $extList= '', $regDirs=false, $recursivityLevels=99, $excludePattern= '') |
static | removePrefixPathFromList (array $fileArr, $prefixToRemove) |
static | fixWindowsFilePath ($theFile) |
static | resolveBackPath ($pathStr) |
static | locationHeaderUrl ($path) |
static | getMaxUploadFileSize () |
static | getBytesFromSizeMeasurement ($measurement) |
static | getMaximumPathLength () |
static | createVersionNumberedFilename ($file) |
static | getThisUrl () |
static | linkThisScript (array $getParams=array()) |
static | linkThisUrl ($url, array $getParams=array()) |
static | getIndpEnv ($getEnvName) |
static | isAllowedHostHeaderValue ($hostHeaderValue) |
static | hostHeaderValueMatchesTrustedHostsPattern ($hostHeaderValue) |
static | milliseconds () |
static | clientInfo ($useragent= '') |
static | getHostname ($requestHost=true) |
static | getFileAbsFileName ($filename, $onlyRelative=true, $relToTYPO3_mainDir=false) |
static | validPathStr ($theFile) |
static | isAbsPath ($path) |
static | isAllowedAbsPath ($path) |
static | verifyFilenameAgainstDenyPattern ($filename) |
static | copyDirectory ($source, $destination) |
static | sanitizeLocalUrl ($url= '') |
static | upload_copy_move ($source, $destination) |
static | upload_to_tempfile ($uploadedFileName) |
static | unlink_tempfile ($uploadedTempFileName) |
static | tempnam ($filePrefix, $fileSuffix= '') |
static | stdAuthCode ($uid_or_record, $fields= '', $codeLength=8) |
static | hideIfNotTranslated ($l18n_cfg_fieldValue) |
static | hideIfDefaultLanguage ($localizationConfiguration) |
static | llXmlAutoFileName ($fileRef, $language, $sameLocation=false) |
static | resolveSheetDefInDS ($dataStructArray, $sheet= 'sDEF') |
static | resolveAllSheetsInDS (array $dataStructArray) |
static | callUserFunction ($funcName, &$params, &$ref, $checkPrefix= '', $errorMode=0) |
static | getUserObj ($classRef) |
static | makeInstance ($className) |
static | setSingletonInstance ($className, SingletonInterface $instance) |
static | removeSingletonInstance ($className, SingletonInterface $instance) |
static | resetSingletonInstances (array $newSingletonInstances) |
static | getSingletonInstances () |
static | addInstance ($className, $instance) |
static | purgeInstances () |
static | flushInternalRuntimeCaches () |
static | makeInstanceService ($serviceType, $serviceSubType= '', $excludeServiceKeys=array()) |
static | requireOnce ($requireFile) |
static | requireFile ($requireFile) |
static | quoted_printable ($string, $maxlen=76) |
static | encodeHeader ($line, $enc= 'quoted-printable', $charset= 'utf-8') |
static | substUrlsInPlainText ($message, $urlmode= '76', $index_script_url= '') |
static | makeRedirectUrl ($inUrl, $l=0, $index_script_url= '') |
static | freetypeDpiComp ($fontSize) |
static | initSysLog () |
static | devLog ($msg, $extKey, $severity=0, $dataVar=false) |
static | deprecationLog ($msg) |
static | getDeprecationLogFileName () |
static | logDeprecatedFunction () |
static | arrayToLogString (array $arr, $valueList=array(), $valueLength=20) |
static | imageMagickCommand ($command, $parameters, $path= '') |
static | unQuoteFilenames ($parameters, $unQuote=false) |
static | quoteJSvalue ($value) |
static | cleanOutputBuffers () |
static | flushOutputBuffers () |
static | presetApplicationContext (ApplicationContext $applicationContext) |
static | getApplicationContext () |
static | isRunningOnCgiServerApi () |
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 Protected Member Functions | |
static | generateRandomBytesOpenSsl ($bytesToGenerate) |
static | generateRandomBytesMcrypt ($bytesToGenerate) |
static | generateRandomBytesUrandom ($bytesToGenerate) |
static | generateRandomBytesFallback ($bytesToReturn) |
static | xml2arrayProcess ($string, $NSprefix= '', $reportDocTag=false) |
static | getRedirectUrlFromHttpHeaders ($content) |
static | stripHttpHeaders ($content) |
static | createDirectoryPath ($fullDirectoryPath) |
static | isInternalRequestType () |
static | instantiateClass ($className, $arguments) |
static | getClassName ($className) |
static | getImplementationForClass ($className) |
static | classHasImplementation ($className) |
static | checkInstanceClassName ($className, $instance) |
Static Protected Attributes | |
static | $allowHostHeaderValue = false |
static | $singletonInstances = array() |
static | $nonSingletonInstances = array() |
static | $finalClassNameCache = array() |
static | $applicationContext = null |
static | $idnaStringCache = array() |
static | $idnaConverter = null |
static | $supportedCgiServerApis |
static | $indpEnvCache = [] |
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 ::[method-name] to refer to the functions, eg. '::milliseconds()'
Definition at line 36 of file GeneralUtility.php.
|
static |
Returns the global $_GET array (or value from) normalized to contain un-escaped values. ALWAYS use this API function to acquire the GET variables! This function was previously used to normalize between magic quotes logic, which was removed from PHP 5.5
string | $var | Optional pointer to value in GET array (basically name of GET var) |
Definition at line 176 of file GeneralUtility.php.
Referenced by DocumentTemplate\__construct(), UriBuilder\buildBackendUri(), TypoScriptFrontendController\calculateLinkVars(), Application\defineAdditionalEntryPointRelatedConstants(), AdminPanelView\display(), UninstallExtension\executeAction(), ExtensionCompatibilityTester\executeAction(), SecurityStatusReport\executeAdminCommand(), ConfigurationStatus\executeAdminCommand(), ServerRequestFactory\fromGlobals(), TypoScriptFrontendController\getConfigArray(), ClickMenuController\getContextMenuAction(), ContentObjectRenderer\getData(), ExtDirectApi\getExtDirectApi(), FrontendLoginController\getPreserveGetVars(), PreviewHook\getPreviewConfiguration(), ContentObjectRenderer\getQueryArguments(), ContentObjectRenderer\getUrlToCurrentLocation(), BackendController\handlePageEditing(), ElementInformationController\init(), ReportController\initializeAction(), AdministrationController\initializeAction(), ClickMenuController\main(), TemplateAnalyzerModuleFunctionController\main(), TypoScriptTemplateObjectBrowserModuleFunctionController\main(), TypoScriptFrontendController\makeCacheHash(), ModuleTemplate\makeShortcutIcon(), DocumentTemplate\makeShortcutIcon(), ModuleTemplate\makeShortcutUrl(), DocumentTemplate\makeShortcutUrl(), TypoScriptFrontendController\mergingWithGetVars(), TypoScriptTemplateObjectBrowserModuleFunctionController\modMenu(), EditDocumentController\preInit(), TypoScriptTemplateInfoHook\preStartPageHook(), FileEditHook\preStartPageHook(), AdministrationController\processRequest(), ElementInformationController\renderBackButton(), BackendController\setStartupModule(), AbstractLinkHandler\setTemporaryDbMounts(), DatabaseBrowser\setTemporaryDbMounts(), PageLinkHandler\setTemporaryDbMounts(), and AbstractUserAuthentication\start().
|
static |
Writes input value to $_GET.
mixed | $inputGet | |
string | $key |
Definition at line 211 of file GeneralUtility.php.
References $GLOBALS, elseif, and ArrayUtility\mergeRecursiveWithOverrule().
Referenced by TypoScriptFrontendController\getConfigArray(), PreviewHook\getPreviewConfiguration(), and TypoScriptFrontendController\mergingWithGetVars().
|
static |
Returns the 'GLOBAL' value of incoming data from POST or GET, with priority to POST (that is equalent to 'GP' order) To enhance security in your scripts, please consider using GeneralUtility::_GET or GeneralUtility::_POST if you already know by which method your data is arriving to the scripts!
string | $var | GET/POST var to return |
Definition at line 139 of file GeneralUtility.php.
Referenced by RecyclerAjaxController\__construct(), ListController\__construct(), ClickMenuController\__construct(), LoginController\__construct(), UriBuilder\buildBackendUri(), AbstractUserAuthentication\checkAuthentication(), AbstractFunctionModule\checkExtObj(), BaseScriptClass\checkExtObj(), PreviewHook\checkForPreview(), LoginController\checkRedirect(), ImportExportController\checkUpload(), DataHandler\checkValueForFlex(), LoginController\detectLoginProvider(), TypoScriptFrontendController\determineId(), ConditionMatcher\determinePageId(), AbstractElementBrowser\determineScriptUrl(), AbstractRecordList\determineScriptUrl(), AbstractTreeView\determineScriptUrl(), FrontendEditPanel\editIcons(), FrontendEditPanel\editPanelLinkWrap(), FolderTreeView\evaluateExpandCollapseParameter(), ExtendedTemplateService\ext_getObjTree(), TypoScriptFrontendController\fetch_the_id(), ReviewController\fullIndexAction(), DatabaseIntegrityView\func_refindex(), PageTsBackendLayoutDataProvider\generatePageTsConfig(), AbstractController\getAction(), RecordHistory\getArgument(), FileBrowser\getBulkSelector(), ElementHistoryController\getButtons(), ImportExportController\getButtons(), AbstractAction\getContext(), AdminPanelView\getEditModule(), RecyclerModuleController\getJavaScriptConfiguration(), LinkAnalyzer\getLinkStatistics(), FrontendUserAuthentication\getLoginFormData(), AbstractUserAuthentication\getLoginFormData(), SchedulerModuleController\getModuleContent(), ActionTask\getOverview(), PreviewHook\getPreviewConfiguration(), ViewModuleController\getPreviewFrameWidths(), PreviewHook\getPreviewInputCode(), ViewModuleController\getPreviewLanguages(), ActionTask\getTask(), AbstractConditionMatcher\getVariableCommon(), AbstractFunctionModule\handleExternalFunctionValue(), BackendUserController\indexAction(), UserElementsController\init(), EditController\init(), ParseHtmlController\init(), ElementBrowserController\init(), RenameFileController\init(), FileUploadController\init(), RteController\init(), ReplaceFileController\init(), MoveElementController\init(), CreateFolderController\init(), EditFileController\init(), AddController\init(), FileController\init(), FileSystemNavigationFrameController\init(), PageTreeNavigationController\init(), ImportExportController\init(), TableController\init(), SimpleDataHandlerController\init(), TypoScriptTemplateModuleController\init(), ColorpickerController\init(), NewContentElementController\init(), NewRecordController\init(), ClickMenu\init(), BaseScriptClass\init(), RecordList\init(), PageLayoutController\init(), EditDocumentController\init(), FrontendEditingController\initConfigOptions(), TypoScriptFrontendController\initFEuser(), AdminPanelView\initialize(), AbstractController\initializeAction(), RecyclerModuleController\initializeAction(), PermissionController\initializeAction(), RequestHandler\initializeController(), AbstractTreeView\initializePositionSaving(), FolderBrowser\initVariables(), DatabaseBrowser\initVariables(), FileBrowser\initVariables(), AbstractElementBrowser\initVariables(), SelectImage\initVariables(), BrowseLinksController\initVariables(), LoginController\isLoginInProgress(), ActionList\listURL(), EditDocumentController\localizationRedirect(), SortPagesWizardModuleFunction\main(), Clickmenu\main(), CreatePagesWizardModuleFunctionController\main(), ImportExportTask\main(), ElementBrowserFramesetController\main(), InfoPageTyposcriptConfigController\main(), ModuleController\main(), TypoScriptTemplateConstantEditorModuleFunctionController\main(), FrontendLoginController\main(), ImportExportController\main(), LinkValidatorReport\main(), VersionModuleController\main(), ColorpickerController\main(), TypoScriptTemplateObjectBrowserModuleFunctionController\main(), ParseHtmlController\main_parse_html(), UserElementsController\main_user(), ConfigurationView\menuConfig(), DatabaseIntegrityView\menuConfig(), VersionModuleController\menuConfig(), BaseScriptClass\menuConfig(), RecordList\menuConfig(), FileListController\menuConfig(), PageLayoutController\menuConfig(), PageLayoutView\newLanguageButton(), Compatibility6ExtractionUpdate\performUpdate(), EditDocumentController\preInit(), ModuleController\printLogMgm(), ClickMenu\printNewDBLevel(), ModuleController\printSqlCheck(), PageTreeView\printTree(), ModuleSettings\processStoreControl(), QueryView\procesStoreControl(), AbstractController\redirect(), DocumentTemplate\redirectUrls(), ModuleTemplate\redirectUrls(), UsernamePasswordLoginProvider\render(), PagePathViewHelper\renderStatic(), AdminPanelView\saveConfigOptions(), DatabaseRowInitializeNew\setDefaultsFromDevVals(), FrontendLoginController\showLogin(), SetupModuleController\simulateUser(), ReviewController\singleIndexAction(), AbstractDatabaseRecordList\start(), ArrayBrowser\tree(), LinkValidatorReport\updateBrokenLinks(), ActionTask\viewNewBackendUser(), ActionTask\viewRecordList(), and ArrayBrowser\wrapArrayKey().
|
static |
Returns the global arrays $_GET and $_POST merged with $_POST taking precedence.
string | $parameter | Key (variable name) from GET or POST vars |
Definition at line 158 of file GeneralUtility.php.
References ArrayUtility\mergeRecursiveWithOverrule().
Referenced by SchedulerModuleController\getModuleContent(), and AbstractConditionMatcher\getVariableCommon().
|
static |
Returns the global $_POST array (or value from) normalized to contain un-escaped values. ALWAYS use this API function to acquire the $_POST variables!
string | $var | Optional pointer to value in POST array (basically name of POST var) |
Definition at line 194 of file GeneralUtility.php.
Referenced by PermissionAjaxController\__construct(), ShortcutToolbarItem\addShortcut(), UriBuilder\buildBackendUri(), FrontendLoginController\changePassword(), SchedulerModuleController\executeTasks(), ServerRequestFactory\fromGlobals(), TypoScriptTemplateModuleController\getButtons(), ContentObjectRenderer\getData(), FrontendUserAuthentication\getLoginFormData(), AbstractUserAuthentication\getLoginFormData(), AbstractController\getPostValues(), PreviewHook\getPreviewConfiguration(), ContentObjectRenderer\getQueryArguments(), TypoScriptTemplateConstantEditorModuleFunctionController\main(), TypoScriptTemplateInformationModuleFunctionController\main(), TypoScriptTemplateObjectBrowserModuleFunctionController\main(), QueryGenerator\procesData(), SpellCheckingController\processRequest(), ModuleMenuView\saveMenuState(), SpellCheckingController\setPersonalDictionaryPath(), FrontendLoginController\showForgot(), ShortcutToolbarItem\tryAddingTheShortcut(), VersionModuleController\versioningMgm(), and ActionTask\viewNewBackendUser().
|
static |
Sets the instance of a non-singleton class to be returned by makeInstance.
If this function is called multiple times for the same $className, makeInstance will return the instances in the order in which they have been added (FIFO).
Warning: This is a helper method for unit tests. Do not call this directly in production code!
\InvalidArgumentException | if class extends |
string | $className | |
object | $instance |
Definition at line 4682 of file GeneralUtility.php.
Referenced by TcaInputPlaceholdersTest\addDataReturnsValueFromRelationsRecursively(), TcaSelectItemsTest\processSelectFieldValueAddsInvalidValuesToItemsForSingleSelects(), TcaSelectItemsTest\processSelectFieldValueDoesNotCallRelationManagerForStaticOnlyItems(), TypolinkViewHelperTest\renderReturnsResultOfContentObjectRenderer(), CropViewHelperTest\respectHtmlCanBeDisabled(), CropViewHelperTest\respectWordBoundariesCanBeDisabled(), StandaloneViewTest\setUp(), CropViewHelperTest\viewHelperCallsCropHtmlByDefault(), and CropViewHelperTest\viewHelperCallsCropHtmlByDefault2().
|
static |
AddSlash array This function traverses a multidimensional array and adds slashes to the values. NOTE that the input array is and argument by reference.!! Twin-function to stripSlashesOnArray
array | $theArray | Multidimensional input array, (REFERENCE!) |
Definition at line 1687 of file GeneralUtility.php.
|
static |
Deprecated to call directly (unless you are aware of using XML prologues)! Use "array2xml_cs" instead (which adds an XML-prologue)
Converts a PHP array into an XML string. The XML output is optimized for readability since associative keys are used as tag names. This also means that only alphanumeric characters are allowed in the tag names AND only keys NOT starting with numbers (so watch your usage of keys!). However there are options you can set to avoid this problem. Numeric keys are stored with the default tag name "numIndex" but can be overridden to other formats) The function handles input values from the PHP array in a binary-safe way; All characters below 32 (except 9,10,13) will trigger the content to be converted to a base64-string The PHP variable type of the data IS preserved as long as the types are strings, arrays, integers and booleans. Strings are the default type unless the "type" attribute is set. The output XML has been tested with the PHP XML-parser and parses OK under all tested circumstances with 4.x versions. However, with PHP5 there seems to be the need to add an XML prologue a la <?xml version="1.0" encoding="[charset]" standalone="yes" ?> - otherwise UTF-8 is assumed! Unfortunately, many times the output from this function is used without adding that prologue meaning that non-ASCII characters will break the parsing!! This suchs of course! Effectively it means that the prologue should always be prepended setting the right characterset, alternatively the system should always run as utf-8! However using MSIE to read the XML output didn't always go well: One reason could be that the character encoding is not observed in the PHP data. The other reason may be if the tag-names are invalid in the eyes of MSIE. Also using the namespace feature will make MSIE break parsing. There might be more reasons...
array | $array | The input PHP array with any kind of data; text, binary, integers. Not objects though. |
string | $NSprefix | tag-prefix, eg. a namespace prefix like "T3:" |
int | $level | Current recursion level. Don't change, stay at zero! |
string | $docTag | Alternative document tag. Default is "phparray". |
int | $spaceInd | If greater than zero, then the number of spaces corresponding to this number is used for indenting, if less than zero - no indentation, if zero - a single TAB is used |
array | $options | Options for the compilation. Key "useNindex" => 0/1 (boolean: whether to use "n0, n1, n2" for num. indexes); Key "useIndexTagForNum" => "[tag for numerical indexes]"; Key "useIndexTagForAssoc" => "[tag for associative indexes"; Key "parentTagMap" => array('parentTag' => 'thisLevelTag') |
array | $stackData | Stack data. Don't touch. |
Definition at line 2081 of file GeneralUtility.php.
References MathUtility\canBeInterpretedAsInteger(), and elseif.
Referenced by ImportExport\createXML(), and FlexFormTools\flexArray2Xml().
|
static |
Turns PHP array into XML. See array2xml()
array | $array | The input PHP array with any kind of data; text, binary, integers. Not objects though. |
string | $docTag | Alternative document tag. Default is "phparray". |
array | $options | Options for the compilation. See array2xml() for description. |
string | $charset | Forced charset to prologue |
Definition at line 2051 of file GeneralUtility.php.
|
static |
An array_merge function where the keys are NOT renumbered as they happen to be with the real php-array_merge function. It is "binary safe" in the sense that integer keys are overridden as well.
array | $arr1 | First array |
array | $arr2 | Second array |
Definition at line 1765 of file GeneralUtility.php.
Referenced by GeneralUtility\getAllFilesAndFoldersInPath(), and GeneralUtility\makeInstanceService().
|
static |
Filters keys off from first array that also exist in second array. Comparison is done by keys. This method is a recursive version of php array_diff_assoc()
array | $array1 | Source array |
array | $array2 | Reduce source array by this array |
Definition at line 1780 of file GeneralUtility.php.
References ArrayUtility\arrayDiffAssocRecursive().
|
static |
Converts a one dimensional array to a one line string which can be used for logging or debugging output Example: "loginType: FE; refInfo: Array; HTTP_HOST: www.example.org; REMOTE_ADDR: 192.168.1.5; REMOTE_HOST:; security_level:; showHiddenRecords: 0;"
array | $arr | Data array which should be outputted |
mixed | $valueList | List of keys which should be listed in the output string. Pass a comma list or an array. An empty list outputs the whole array. |
int | $valueLength | Long string values are shortened to this length. Default: 20 |
Definition at line 5245 of file GeneralUtility.php.
Referenced by AbstractUserAuthentication\checkAuthentication(), FrontendUserAuthentication\fetchGroupData(), AuthenticationService\getUser(), SyslogCommand\main(), AbstractUserAuthentication\processLoginData(), and ModuleSettings\processStoreControl().
|
static |
Calls a user-defined function/method in class Such a function/method should look like this: "function proc(&$params, &$ref) {...}"
string | $funcName | Function/Method reference or Closure, '[file-reference":"]["&"]class/function["->"method-name]'. You can prefix this reference with "[file-reference]:" and ::getFileAbsFileName() will then be used to resolve the filename and subsequently include it by "require_once()" which means you don't have to worry about including the class file either! Example: "EXT:realurl/class.tx_realurl.php:&tx_realurl->encodeSpURL". Finally; you can prefix the class name with "&" if you want to reuse a former instance of the same object call ("singleton"). |
mixed | $params | Parameters to be pass along (typically an array) (REFERENCE!) |
mixed | $ref | Reference to be passed along (typically "$this" - being a reference to the calling object) (REFERENCE!) |
string | $checkPrefix | Not used anymore since 6.0 |
int | $errorMode | Error mode (when class/function could not be found): 0 - call debug(), 1 - do nothing, 2 - raise an exception (allows to call a user function that may return FALSE) |
Definition at line 4278 of file GeneralUtility.php.
References $GLOBALS, debug(), and elseif.
Referenced by TypoScriptFrontendController\__construct(), TcaRecordTitle\addData(), DatabaseUserPermissionCheck\addData(), DataHandler\applyFiltersToValues(), ValidatorTask\buildMail(), BackendUserAuthentication\calcPerms(), WizardView\callRenderHook(), FrontendLoginController\changePassword(), TypoScriptFrontendController\checkAlternativeIdMethods(), AbstractUserAuthentication\checkAuthentication(), TypoScriptFrontendController\checkEnableFields(), DataHandler\clear_cacheCmd(), TypoScriptFrontendController\connectToDB(), TypoScriptFrontendController\contentStrReplace(), TypoScriptFrontendController\createHashBase(), TypoScriptFrontendController\determineId(), PageRenderer\doCompressCss(), PageRenderer\doCompressJavaScript(), PageRenderer\doConcatenateCss(), PageRenderer\doConcatenateJavaScript(), FrontendEditingController\editAction(), PageRepository\enableFields(), BackendController\executeHook(), PageRenderer\executePostRenderHook(), PageRenderer\executePreRenderHook(), PageRenderer\executeRenderPostTransformHook(), TypoScriptParser\executeValueModifier(), TypoScriptFrontendController\fetch_the_id(), BackendUserAuthentication\fetchGroups(), AbstractFrontend\flushByTag(), NoneElement\formatValue(), FrontendLoginController\generateAndSendHash(), TypoScriptFrontendController\generatePage_postProcessing(), ClientUtility\getBrowserInfo(), ButtonBar\getButtons(), TypoScriptFrontendController\getConfigArray(), DocumentTemplate\getDocHeaderButtons(), TypoScriptFrontendController\getFromCache(), SetupModuleController\getJavaScript(), BackendUserAuthentication\getPagePermsClause(), QueryView\getQueryResultCode(), AbstractDatabaseRecordList\getSearchFields(), EidRequestHandler\handleRequest(), TypoScriptFrontendController\headerNoCache(), TypoScriptFrontendController\hook_eofe(), TemplateService\includeStaticTypoScriptSources(), TypoScriptFrontendController\initFEuser(), TypoScriptFrontendController\isOutputting(), ElementBrowserRecordList\isRowListingConditionFulfilled(), TemplateService\linkData(), AbstractUserAuthentication\logoff(), PageInformationController\main(), FrontendLoginController\main(), MoveElementController\main(), EditFileController\main(), TypoScriptTemplateInformationModuleFunctionController\main(), NewContentElementController\main(), PageLayoutController\main(), IconFactory\mapRecordTypeToIconIdentifier(), IconUtility\mapRecordTypeToSpriteIconName(), EvaluateDisplayConditions\matchUserCondition(), DocumentTemplate\moduleBody(), TypoScriptFrontendController\pageErrorHandler(), TypoScriptFrontendController\previewInfo(), PagePositionMap\printRecordMap(), TypoScriptFrontendController\processOutput(), FrontendLoginController\processRedirect(), BackendUserAuthentication\recordEditAccessInternals(), UserElement\render(), SuggestWizardDefaultReceiver\renderRecord(), SetupModuleController\renderUserSetup(), ExtDirectEidController\routeAction(), VariableFrontend\set(), TypoScriptFrontendController\settingLanguage(), FrontendLoginController\showLogin(), AbstractUserAuthentication\start(), DocumentTemplate\startPage(), PageLayoutView\tt_content_drawHeader(), WorkspaceService\viewSingleRecord(), and PageTreeView\wrapTitle().
|
static |
Returns a given CamelCasedString as an lowercase string with underscores. Example: Converts BlogExample to blog_example, and minimalValue to minimal_value
string | $string | String to be converted to lowercase underscore |
Definition at line 1360 of file GeneralUtility.php.
Referenced by ExtensionManagementUtility\addExtJSModule(), and ResourceViewHelper\renderStatic().
|
staticprotected |
Checks that $className is non-empty and that $instance is an instance of $className.
\InvalidArgumentException | if $className is empty or if $instance is no instance of $className |
string | $className | a class name |
object | $instance | an object |
Definition at line 4703 of file GeneralUtility.php.
|
staticprotected |
Checks if a class has a configured implementation
string | $className |
Definition at line 4564 of file GeneralUtility.php.
References $GLOBALS.
|
static |
Ends and cleans all output buffers
Definition at line 5340 of file GeneralUtility.php.
|
static |
Client Browser Information
string | $useragent | Alternative User Agent string (if empty, ::getIndpEnv('HTTP_USER_AGENT') is used) |
Definition at line 3722 of file GeneralUtility.php.
References elseif.
Referenced by TypoScriptFrontendController\__construct(), SelectImage\getAllowedItems(), FormResultCompiler\JSbottom(), and AbstractUserAuthentication\start().
|
static |
Match fully qualified domain name with list of strings with wildcard
string | $baseHost | A hostname or an IPv4/IPv6-address (will by reverse-resolved; typically REMOTE_ADDR) |
string | $list | A comma-list of domain names to match with. *-wildcard allowed but cannot be part of a string, so it must match the full host name (eg. myhost.*.com => correct, myhost.*domain.com => wrong) |
Definition at line 609 of file GeneralUtility.php.
Referenced by AbstractConditionMatcher\evaluateConditionCommon().
|
static |
Match IP number with list of numbers with wildcard Dispatcher method for switching into specialised IPv4 and IPv6 methods.
string | $baseIP | Is the current remote IP address for instance, typ. REMOTE_ADDR |
string | $list | Is a comma-list of IP-addresses to match with. *-wildcard allowed instead of number, plus leaving out parts in the IP number is accepted as wildcard (eg. 192.168.*.* equals 192.168). If list is "*" no check is done and the function returns TRUE immediately. An empty list always returns FALSE. |
Definition at line 347 of file GeneralUtility.php.
Referenced by TypoScriptFrontendController\beLoginLinkIPList(), FrontendBackendUserAuthentication\checkBackendAccessSettingsFromInitPhp(), Bootstrap\checkBackendIpOrDie(), BackendUserAuthentication\checkLockToIP(), TypoScriptFrontendController\checkPageUnavailableHandler(), AbstractConditionMatcher\evaluateConditionCommon(), DatabaseConnection\explain(), AuthenticationService\getGroups(), and Bootstrap\initializeErrorHandling().
|
static |
Match IPv4 number with list of numbers with wildcard
string | $baseIP | Is the current remote IP address for instance, typ. REMOTE_ADDR |
string | $list | Is a comma-list of IP-addresses to match with. *-wildcard allowed instead of number, plus leaving out parts in the IP number is accepted as wildcard (eg. 192.168.*.* equals 192.168), could also contain IPv6 addresses |
Definition at line 369 of file GeneralUtility.php.
References $list.
|
static |
Match IPv6 address with a list of IPv6 prefixes
string | $baseIP | Is the current remote IP address for instance |
string | $list | Is a comma-list of IPv6 prefixes, could also contain IPv4 addresses |
Definition at line 416 of file GeneralUtility.php.
|
static |
Returns TRUE if the current TYPO3 version (or compatibility version) is compatible to the input version Notice that this function compares branches, not versions (4.0.1 would be > 4.0.0 although they use the same compat_version)
string | $verNumberStr | Minimum branch number required (format x.y / e.g. "4.0" NOT "4.0.0"!) |
Definition at line 754 of file GeneralUtility.php.
References VersionNumberUtility\convertVersionNumberToInteger().
Referenced by AbstractConditionMatcher\evaluateConditionCommon().
|
static |
Returns an array with selected keys from incoming data. (Better read source code if you want to find out...)
string | $varList | List of variable/key names |
array | $getArray | Array from where to get values based on the keys in $varList |
bool | $GPvarAlt | If set, then ::_GP() is used to fetch the value if not found (isset) in the $getArray |
Definition at line 1663 of file GeneralUtility.php.
References elseif.
Referenced by EditDocumentController\compileStoreDat(), ModuleTemplate\makeShortcutUrl(), and DocumentTemplate\makeShortcutUrl().
|
static |
Compress an IPv6 address to the shortest notation
string | $address | Given IPv6 address |
Definition at line 558 of file GeneralUtility.php.
|
static |
Returns microtime input to milliseconds
string | $microtime | Microtime |
Definition at line 987 of file GeneralUtility.php.
|
static |
Low level utility function to copy directories and content recursive
string | $source | Path to source directory, relative to document root or absolute |
string | $destination | Path to destination directory, relative to document root or absolute |
Definition at line 3934 of file GeneralUtility.php.
Referenced by ExtensionManagementService\copyDependencies(), UploadExtensionFileController\copyExtensionFolderToTempFolder(), InstallUtility\importInitialFiles(), ImportExport\loadFile(), and UploadExtensionFileController\removeExtensionAndRestoreFromBackup().
|
staticprotected |
Creates directories for the specified paths if they do not exist. This functions sets proper permission mask but does not set proper user and group.
string | $fullDirectoryPath |
\RuntimeException | If directory could not be created |
Definition at line 2865 of file GeneralUtility.php.
References $GLOBALS, and GeneralUtility\mkdir().
|
static |
Function for static version numbers on files, based on the filemtime
This will make the filename automatically change when a file is changed, and by that re-cached by the browser. If the file does not exist physically the original file passed to the function is returned without the timestamp.
Behaviour is influenced by the setting TYPO3_CONF_VARS[TYPO3_MODE][versionNumberInFilename] = TRUE (BE) / "embed" (FE) : modify filename = FALSE (BE) / "querystring" (FE) : add timestamp as parameter
string | $file | Relative path to file including all potential query parameters (not htmlspecialchared yet) |
Definition at line 3221 of file GeneralUtility.php.
References $GLOBALS, and GeneralUtility\strtolower().
Referenced by RichTextElement\getRteInitJsCode(), PageRenderer\processJsFile(), PageRenderer\renderAdditionalJavaScriptLibraries(), PageRenderer\renderCssFiles(), PageRenderer\renderCssLibraries(), and PageRenderer\renderJavaScriptFiles().
|
static |
Takes a row and returns a CSV string of the values with $delim (default is ,) and $quote (default is ") as separator chars.
array | $row | Input array of values |
string | $delim | Delimited, default is comma |
string | $quote | Quote-character to wrap around the values. |
Definition at line 1794 of file GeneralUtility.php.
|
static |
Re-converts HTML entities if they have been converted by htmlspecialchars() Note: Use htmlspecialchars($str, ENT_COMPAT, 'UTF-8', FALSE) to avoid double encoding. This makes the call to this method obsolete.
string | $str | String which contains eg. "&amp;" which should stay "&". Or "&#1234;" to "Ӓ". Or "&#x1b;" to " |
Definition at line 1025 of file GeneralUtility.php.
|
static |
Writes a message to the deprecation log.
string | $msg | Message (in English). |
Definition at line 5165 of file GeneralUtility.php.
References $GLOBALS, and DebugUtility\debug().
Referenced by DuplicationBehavior\__construct(), PageTreeNavigationController\__construct(), ModuleSettings\__construct(), DocumentTemplate\__construct(), SpriteManager\addIconSprite(), ExtensionManagementUtility\addModule(), SpriteManager\addSingleIcons(), ExtensionManagementUtility\addTCAcolumns(), SpriteManager\addTcaTypeIcon(), ExtensionManagementUtility\buildBaseTcaFromSingleFiles(), ModuleLoader\checkMod(), DebugUtility\debugRows(), DatabaseTreeDataProvider\emitDeprecatedPostProcessTreeDataSignal(), AbstractConditionMatcher\evaluateConditionCommon(), Bootstrap\executeExtTablesAdditionalFile(), ClickMenu\FILE_launch(), DataHandler\fillInFieldArray(), PageRepository\getExtURL(), CompatibilityLayerUtility\getGlobalLayoutByElementType(), IconRegistry\getIconConfigurationByIdentifier(), CompatibilityLayerUtility\getNewAttributeName(), BackendUtility\getSpecConfParts(), IconUtility\getSpriteIconForFile(), IconUtility\getSpriteIconForRecord(), IconUtility\getSpriteIconForResource(), Bootstrap\initializeErrorHandling(), AbstractLinkBrowserController\initVariables(), PageGenerator\JSeventFunctions(), ValidatorTask\loadModTsConfig(), TypoScriptFrontendController\logDeprecatedTyposcript(), FrontendLoginController\main(), NewContentElementController\main(), EvaluateDisplayConditions\matchHideL10nSiblingsCondition(), TcaFlexPrepare\migrateFlexformTcaRecursive(), DataHandler\newlog2(), TypoScriptFrontendController\processOutput(), FlashMessagesViewHelper\render(), FormBuilder\reviveElement(), CompatibilityLayerUtility\setElementLayouts(), CompatibilityLayerUtility\setGlobalLayoutConfiguration(), TypoScriptFrontendController\settingLanguage(), DocumentTemplate\startPage(), and ArrayBrowser\tree().
|
static |
Logs message to the development log. This should be implemented around the source code, both frontend and backend, logging everything from the flow through an application, messages, results from comparisons to fatal errors. The result is meant to make sense to developers during development or debugging of a site. The idea is that this function is only a wrapper for external extensions which can set a hook which will be allowed to handle the logging of the information to any format they might wish and with any kind of filter they would like. If you want to implement the devLog in your applications, simply add lines like: if (TYPO3_DLOG) ::devLog('[write message in english here]', 'extension key');
string | $msg | Message (in english). |
string | $extKey | Extension key (from which extension you are calling the log) |
int | $severity | Severity: 0 is info, 1 is notice, 2 is warning, 3 is fatal error, -1 is "OK" message |
mixed | $dataVar | Additional data you want to pass to the logger. |
Definition at line 5148 of file GeneralUtility.php.
References $GLOBALS.
Referenced by ModuleSettings\addToStoreList(), ModuleSettings\addToStoreListFromPrefix(), AuthenticationService\authUser(), AbstractUserAuthentication\checkAuthentication(), AbstractUserAuthentication\createUserSession(), ValidatorResolver\createValidator(), DatabaseConnection\debug_check_recordset(), DocumentTemplate\endPage(), FrontendUserAuthentication\fetchGroupData(), AbstractUserAuthentication\fetchUserSession(), AuthenticationService\getGroups(), CssStyledContentController\getImgColumnRelations(), AuthenticationService\getUser(), TypoScriptFrontendController\initUserGroups(), AbstractUserAuthentication\logoff(), DatabaseConnection\prepare_SELECTquery(), RsaAuthService\processLoginData(), AbstractUserAuthentication\processLoginData(), ModuleSettings\processStoreControl(), AbstractUserAuthentication\setAndSaveSessionData(), AbstractUserAuthentication\setSessionCookie(), AbstractUserAuthentication\start(), AbstractExceptionHandler\writeLogEntries(), and AbstractUserAuthentication\writeUC().
|
static |
Returns the directory part of a path without trailing slash If there is no dir-part, then an empty string is returned. Behaviour:
'/dir1/dir2/script.php' => '/dir1/dir2' '/dir1/' => '/dir1' 'dir1/script.php' => 'dir1' 'd/script.php' => 'd' '/script.php' => '' '' => ''
string | $path | Directory name / path |
Definition at line 878 of file GeneralUtility.php.
Referenced by PreviewController\generateJavascript(), BackendController\generateJavascript(), and GeneralUtility\getIndpEnv().
|
static |
Encode header lines Email headers must be ASCII, therefore they will be encoded to quoted_printable (default) or base64.
string | $line | Content to encode |
string | $enc | Encoding type: "base64" or "quoted-printable". Default value is "quoted-printable". |
string | $charset | Charset used for encoding |
Definition at line 4897 of file GeneralUtility.php.
|
static |
Expand a comma-separated list of integers with ranges (eg 1,3-5,7 becomes 1,3,4,5,7). Ranges are limited to 1000 values per range.
string | $list | Comma-separated list of integers with ranges (string) |
Definition at line 724 of file GeneralUtility.php.
References $list.
Referenced by ContentObjectRenderer\stdWrap_expandList().
|
static |
Explodes a string with GETvars (eg. "&id=1&type=2&ext[mykey]=3") into an array
string | $string | GETvars string |
bool | $multidim | If set, the string will be parsed into a multidimensional array if square brackets are used in variable names (using PHP function parse_str()) |
Definition at line 1637 of file GeneralUtility.php.
Referenced by UriBuilder\buildBackendUri(), ShortcutToolbarItem\createShortcutAction(), FrontendLoginController\getPreserveGetVars(), ContentObjectRenderer\getQueryArguments(), ContentObjectRenderer\getUrlToCurrentLocation(), RenameFileController\init(), ReplaceFileController\init(), ShortcutToolbarItem\initShortcuts(), TemplateService\linkData(), NewContentElementController\removeInvalidElements(), and EditRecordViewHelper\renderStatic().
|
static |
Truncates a string with appended/prepended "..." and takes current character set into consideration.
string | $string | String to truncate |
int | $chars | Must be an integer with an absolute value of at least 4. if negative the string is cropped from the right end. |
string | $appendString | Appendix to the truncated string |
Definition at line 325 of file GeneralUtility.php.
References $GLOBALS, and elseif.
Referenced by PageLayoutView\dataFields(), FrontendEditPanel\editPanel(), FileLinkHandler\expandFolder(), ImportExport\export_addRecord(), ExtendedTemplateService\ext_fixed_lgd(), TimeTracker\fixCLen(), PageLinkHandler\formatCurrentUrl(), FileList\getButtonsAndOtherMarkers(), DocumentTemplate\getHeader(), DocumentTemplate\getPagePath(), MetaInformation\getPath(), PageRepository\getPathFromRootline(), RecyclerUtility\getRecordPath(), BackendUtility\getRecordPath(), LiveSearch\getRecordTitlePrep(), DocumentTemplate\getResourceHeader(), AbstractTreeView\getTitleStr(), ShortcutToolbarItem\initShortcuts(), AbstractDatabaseRecordList\linkWrapItems(), SortPagesWizardModuleFunction\main(), CreatePagesWizardModuleFunctionController\main(), PageTreeNavigationController\main(), PageLayoutController\makeQuickEditMenu(), Clipboard\printContentFromTab(), ClickMenu\printDBClickMenu(), ClickMenu\printFileClickMenu(), TimeTracker\printTSlog(), RelationHandler\readyForInterface(), FileBrowser\renderFilesInFolder(), FolderBrowser\renderFolders(), PermissionAjaxController\renderGroupname(), TranslationStatusController\renderL10nTable(), InfoPageTyposcriptConfigController\renderList(), TypoScriptTemplateModuleController\renderList(), PermissionAjaxController\renderOwnername(), PagePathViewHelper\renderStatic(), and PageLayoutView\renderText().
|
static |
Sets the file system mode and group ownership of a file or a folder.
string | $path | Path of file or folder, must not be escaped. Path can be absolute or relative |
bool | $recursive | If set, also fixes permissions of files and folders in the folder (if $path is a folder) |
Definition at line 2694 of file GeneralUtility.php.
References $GLOBALS, and elseif.
Referenced by FileLockStrategy\acquire(), SimpleLockStrategy\acquire(), Locker\acquire(), Locker\acquireExclusiveLock(), LocalDriver\addFile(), GraphicalFunctions\combineExec(), LocalDriver\copyFileWithinStorage(), LocalDriver\createFile(), YouTubeHelper\getPreviewImage(), VimeoHelper\getPreviewImage(), GraphicalFunctions\gifCompress(), GraphicalFunctions\imageMagickExec(), IconUtility\imagemake(), GraphicalFunctions\ImageWrite(), ThumbnailView\main(), GraphicalFunctions\readPngGif(), LocalDriver\replaceFile(), and MboxTransport\send().
|
static |
Fixes a path for windows-backslashes and reduces double-slashes to single slashes
string | $theFile | File path to process |
Definition at line 3099 of file GeneralUtility.php.
Referenced by TemplateView\expandPatterns(), StandaloneViewTest\getLayoutSourceReturnsContentOfDefaultLayoutFileIfNoLayoutExistsForTheSpecifiedFormat(), StandaloneViewTest\getLayoutSourceReturnsContentOfLayoutFileForTheDefaultFormat(), StandaloneViewTest\getLayoutSourceReturnsContentOfLayoutFileForTheSpecifiedFormat(), PathUtility\getRelativePath(), CommandUtility\imageMagickCommand(), FileHandlingUtility\removeDirectory(), LocalDriver\renameFile(), ServicesListReport\renderExecutablesSearchPathList(), StandaloneViewTest\renderLoadsSpecifiedTemplateFileAndPassesSourceToTemplateParser(), StandaloneView\resolveFileNamePath(), TemplateView\resolveFileNamePath(), and HandleIncomingFormValues\saveUploadedFile().
|
static |
Flushes a directory by first moving to a temporary resource, and then triggering the remove process. This way directories can be flushed faster to prevent race conditions on concurrent processes accessing the same directory.
string | $directory | The directory to be renamed and flushed |
bool | $keepOriginalDirectory | Whether to only empty the directory and not remove it |
bool | $flushOpcodeCache | Also flush the opcode cache right after renaming the directory. |
Definition at line 2936 of file GeneralUtility.php.
References StringUtility\getUniqueId(), and GeneralUtility\makeInstance().
Referenced by ClearCacheService\clearAll().
|
static |
Flush internal runtime caches
Used in unit tests only.
Definition at line 4738 of file GeneralUtility.php.
Referenced by TypoScriptFrontendControllerTest\setUp(), ConditionMatcherTest\setUp(), and FrontendLoginControllerTest\setUpFakeSitePathAndHost().
|
static |
Ends and flushes all output buffers
Definition at line 5353 of file GeneralUtility.php.
References GeneralUtility\strtolower().
Referenced by CliRequestHandler\boot().
|
static |
Formats a string for output between <textarea>-tags All content outputted in a textarea form should be passed through this function Not only is the content htmlspecialchar'ed on output but there is also a single newline added in the top. The newline is necessary because browsers will ignore the first newline after <textarea> if that is the first character. Therefore better set it!
string | $content | Input string to be formatted. |
Definition at line 1152 of file GeneralUtility.php.
|
static |
Formats the input integer $sizeInBytes as bytes/kilobytes/megabytes (-/K/M)
int | $sizeInBytes | Number of bytes to format. |
string | $labels | Binary unit name "iec", decimal unit name "si" or labels for bytes, kilo, mega, giga, and so on separated by vertical bar (|) and possibly encapsulated in "". Eg: " | K| M| G". Defaults to "iec". |
int | $base | The unit base if not using a unit name. Defaults to 1024. |
Definition at line 940 of file GeneralUtility.php.
References $GLOBALS.
Referenced by SearchController\compileSingleResultRow(), ImportExport\displayContentOverview(), ImportExport\export_addFile(), ImportExport\export_addRecord(), ImportExport\export_addSysFile(), NoneElement\formatValue(), ConfigurationStatus\getDeprecationLogStatus(), FileFacade\getSize(), UserElementsController\main_user(), AbstractContainer\previewFieldValue(), Clipboard\printContentFromTab(), ClickMenu\printFileClickMenu(), FileInfoHook\renderFileInformationContent(), FileBrowser\renderFilesInFolder(), FileLinkHandler\renderItem(), SizeViewHelper\renderStatic(), ContentObjectRenderer\stdWrap_bytes(), FileMaximumSizeValidator\substituteMarkers(), and FileMinimumSizeValidator\substituteMarkers().
|
static |
Function to compensate for DPI resolution.
float | $fontSize | font size for freetype function call |
Definition at line 5018 of file GeneralUtility.php.
Referenced by ThumbnailView\fontGif(), GraphicalFunctions\ImageTTFBBoxWrapper(), and GraphicalFunctions\ImageTTFTextWrapper().
|
static |
Returns a string of highly randomized bytes (over the full 8-bit range).
Note: Returned values are not guaranteed to be crypto-safe, most likely they are not, depending on the used retrieval method.
int | $bytesToReturn | Number of characters (bytes) to return |
Definition at line 1197 of file GeneralUtility.php.
Referenced by FrontendLoginController\generateAndSendHash(), and AbstractFormProtection\generateSessionToken().
|
staticprotected |
Generate pseudo random bytes as last resort
$bytesToReturn |
Definition at line 1284 of file GeneralUtility.php.
References $GLOBALS, and StringUtility\getUniqueId().
|
staticprotected |
Generate random bytes using mcrypt if available
$bytesToGenerate |
Definition at line 1250 of file GeneralUtility.php.
|
staticprotected |
Generate random bytes using openssl if available
string | $bytesToGenerate |
Definition at line 1235 of file GeneralUtility.php.
|
staticprotected |
Read random bytes from /dev/urandom if it is accessible
$bytesToGenerate |
Definition at line 1264 of file GeneralUtility.php.
|
static |
Returns an array with the names of folders in a specific path Will return 'error' (string) if there were an error with reading directory content.
string | $path | Path to list directories from |
Definition at line 2964 of file GeneralUtility.php.
Referenced by CrawlerHook\crawler_execute_type2(), and SpriteGenerator\getFolder().
|
static |
Returns an array with all attributes of the input HTML tag as key/value pairs. Attributes are only lowercase a-z $tag is either a whole tag (eg '<TAG option="" attrib="VALUE">') or the parameter list (ex ' OPTION ATTRIB=VALUE>') If an attribute is empty, then the value for the key is empty. You can check if it existed with isset()
string | $tag | HTML-tag string (or attributes only) |
Definition at line 1851 of file GeneralUtility.php.
References GeneralUtility\strtolower().
Referenced by ContentObjectRenderer\_parseFunc(), ContentObjectRenderer\addParams(), ContentObjectRenderer\encaps_lineSplit(), BrowseLinksController\initVariables(), AbstractPlugin\pi_openAtagHrefInJSwindow(), and Indexer\splitHTMLContent().
|
static |
Recursively gather all files and folders of a path.
array | $fileArr | Empty input array (will have files added to it) |
string | $path | The path to read recursively from (absolute) (include trailing slash!) |
string | $extList | Comma list of file extensions: Only files with extensions in this list (if applicable) will be selected. |
bool | $regDirs | If set, directories are also included in output. |
int | $recursivityLevels | The number of levels to dig down... |
string | $excludePattern | regex pattern of files/directories to exclude |
Definition at line 3056 of file GeneralUtility.php.
References GeneralUtility\array_merge().
Referenced by AbstractItemProvider\addItemsFromFolder(), CrawlerHook\crawler_execute_type2(), FileHandlingUtility\createZipFileFromExtension(), and TypoScriptParser\includeDirectory().
|
static |
Get the ApplicationContext
Definition at line 5399 of file GeneralUtility.php.
Referenced by ClearCacheToolbarItem\__construct(), AbstractViewHelper\callRenderMethod(), ContentObjectRenderer\determineExceptionHandlerClassName(), AbstractConditionMatcher\evaluateConditionCommon(), ContentObjectRendererTest\exceptionHandlerIsEnabledByDefaultInProductionContext(), SystemInformationToolbarItem\getApplicationContext(), and PageRenderer\loadRequireJs().
|
static |
Gets the bytes value from a measurement string like "100k".
string | $measurement | The measurement (e.g. "100k") |
Definition at line 3182 of file GeneralUtility.php.
References elseif.
|
staticprotected |
Returns the class name for a new instance, taking into account registered implementations for this class
string | $className | Base class name to evaluate |
Definition at line 4537 of file GeneralUtility.php.
References ClassLoadingInformation\getClassNameForAlias().
|
static |
Gets the absolute path to the deprecation log file.
Definition at line 5203 of file GeneralUtility.php.
References $GLOBALS.
Referenced by ConfigurationStatus\getDeprecationLogFileLink(), and ConfigurationStatus\getDeprecationLogStatus().
|
static |
Returns the absolute filename of a relative reference, resolves the "EXT:" prefix (way of referring to files inside extensions) and checks that the file is inside the PATH_site of the TYPO3 installation and implies a check with ::validPathStr().
string | $filename | The input filename/filepath to evaluate |
bool | $onlyRelative | If $onlyRelative is set (which it is by default), then only return values relative to the current PATH_site is accepted. |
bool | $relToTYPO3_mainDir | If $relToTYPO3_mainDir is set, then relative paths are relative to PATH_typo3 constant - otherwise (default) they are relative to PATH_site |
Definition at line 3836 of file GeneralUtility.php.
References $filename, elseif, ExtensionManagementUtility\extPath(), and ExtensionManagementUtility\isLoaded().
Referenced by AbstractItemProvider\addItemsFromFolder(), AdditionalResourceService\addLocalizationResource(), FluidTemplateContentObject\applyStandardWrapToFluidPaths(), MicroDataSchema\buildJavascriptConfiguration(), ImportExport\checkOrCreateDir(), CrawlerHook\crawler_execute_type2(), UpdateScriptUtility\determineUpdateClassName(), ValidatorTask\execute(), ImportExport\export_addFile(), ImportExport\export_addFilesFromRelations(), ExtendedTemplateService\ext_getTSCE_config_image(), TypoScriptParser\extractIncludes(), Indexer\extractLinks(), SoftReferenceIndex\fileadminReferences(), SoftReferenceIndex\findRef_images(), SoftReferenceIndex\findRef_TStemplate(), SvgIconProvider\generateInlineMarkup(), BitmapIconProvider\generateMarkup(), SvgIconProvider\generateMarkup(), FileHandlingUtility\getAbsolutePath(), ModuleTemplate\getDynamicTabMenu(), DocumentTemplate\getDynamicTabMenu(), TemplateService\getFileName(), BackendUtility\getFlexFormDS(), ImageManipulationWizard\getFluidTemplateObject(), BackendController\getFluidTemplateObject(), PageLayoutController\getHeaderFlashMessagesForCurrentPid(), T3editorElement\getHTMLCodeForEditor(), DocumentTemplate\getHtmlTemplate(), FormEngineUtility\getIconHtml(), ImageViewHelper\getImageUri(), CliRequestHandler\getIncludeScriptByCommandLineKey(), DocumentationService\getLocalExtensions(), DocumentationService\getOfficialDocuments(), LocallangXmlParser\getParsedData(), AbstractXmlParser\getParsedData(), T3editor\getPreparedTemplate(), AbstractItemProvider\getRegisteredFlexForms(), BackendUtility\getRegisteredFlexForms(), PageRenderer\getTemplateForPart(), LoginController\getUriForFileName(), TypoScriptParser\includeDirectory(), TypoScriptParser\includeFile(), BackendController\includeLegacyBackendItems(), TaskModuleController\indexAction(), Indexer\indexRegularDocument(), ColorpickerController\init(), CharsetConverter\initCaseFolding(), CharsetConverter\initCharset(), AbstractAction\initializeHandle(), CharsetConverter\initToASCII(), CharsetConverter\initUnicodeData(), LocallangArrayParser\isWithinWebRoot(), PageRenderer\loadRequireJs(), LocalizationFactory\localizationOverride(), PageFunctionsController\main(), DatabaseIntegrityView\main(), TypoScriptTemplateObjectBrowserModuleFunctionController\main(), PageLayoutController\main(), RteImagesCommand\main_autoFix(), UploadedFile\moveTo(), TypoScriptFrontendController\pageErrorHandler(), AbstractContainer\previewFieldValue(), ImportExport\processSoftReferences_saveFile(), ImportExport\processSoftReferences_saveFile_createRelFile(), UsernamePasswordLoginProvider\render(), CssStyledContentController\render_uploads(), TaskModuleController\renderListMenu(), ResourceViewHelper\renderStatic(), AbstractContainer\renderTabMenu(), StandaloneView\resolveFileNamePath(), TemplateView\resolveFileNamePath(), AdditionalResourceService\resolvePath(), TcaFlexFetch\resolvePossibleExternalFileInDataStructure(), ResourceFactory\retrieveFileOrFolderObject(), LanguageStore\setConfiguration(), FluidTemplateContentObject\setLayoutRootPath(), FileWriter\setLogFile(), FluidTemplateContentObject\setPartialRootPath(), SoftReferenceIndex\setTypoLinkPartsElement(), DocumentTemplate\startPage(), DocumentationService\unzipDocumentPackage(), TerService\unzipTranslationFile(), TerService\updateTranslation(), AbstractWidgetControllerTest\viewConfigurationCanBeOverriddenThroughFrameworkConfiguration(), and ImportExport\writeFileVerify().
|
static |
Finds all files in a given path and returns them as an array. Each array key is a md5 hash of the full path to the file. This is done because 'some' extensions like the import/export extension depend on this.
string | $path | The path to retrieve the files from. |
string | $extensionList | A comma-separated list of file extensions. Only files of the specified types will be retrieved. When left blank, files of any type will be retrieved. |
bool | $prependPath | If TRUE, the full path to the file is returned. If FALSE only the file name is returned. |
string | $order | The sorting order. The default sorting order is alphabetical. Setting $order to 'mtime' will sort the files by modification time. |
string | $excludePattern | A regular expression pattern of file names to exclude. For example: 'clear.gif' or '(clear.gif|.htaccess)'. The pattern will be wrapped with: '/^' and '$/'. |
Definition at line 2994 of file GeneralUtility.php.
Referenced by DocumentTemplate\addStyleSheetDirectory(), SpriteGenerator\getFolder(), CleanUp\getTypo3TempStatistics(), AbstractSpriteHandler\loadRegisteredSprites(), and BackendController\loadResourcesForRegisteredNavigationComponents().
|
static |
Get the fully-qualified domain name of the host.
bool | $requestHost | Use request host (when not in CLI mode). |
Definition at line 3787 of file GeneralUtility.php.
|
staticprotected |
Returns the configured implementation of the class
string | $className |
Definition at line 4553 of file GeneralUtility.php.
References $GLOBALS.
|
static |
Abstraction method which returns System Environment Variables regardless of server OS, CGI/MODULE version etc. Basically this is SERVER variables for most of them. This should be used instead of getEnv() and $_SERVER/ENV_VARS to get reliable values for all situations.
string | $getEnvName | Name of the "environment variable"/"server variable" you wish to use. Valid values are SCRIPT_NAME, SCRIPT_FILENAME, REQUEST_URI, PATH_INFO, REMOTE_ADDR, REMOTE_HOST, HTTP_REFERER, HTTP_HOST, HTTP_USER_AGENT, HTTP_ACCEPT_LANGUAGE, QUERY_STRING, TYPO3_DOCUMENT_ROOT, TYPO3_HOST_ONLY, TYPO3_HOST_ONLY, TYPO3_REQUEST_HOST, TYPO3_REQUEST_URL, TYPO3_REQUEST_SCRIPT, TYPO3_REQUEST_DIR, TYPO3_SITE_URL, _ARRAY |
\UnexpectedValueException |
Definition at line 3342 of file GeneralUtility.php.
References $GLOBALS, $url, GeneralUtility\dirname(), elseif, if, PathUtility\stripPathSitePrefix(), and GeneralUtility\strtolower().
Referenced by StandaloneView\__construct(), SessionService\__construct(), LoginController\__construct(), TypoScriptFrontendController\__construct(), DocumentTemplate\addStyleSheetDirectory(), VersionModuleController\adminLinks(), BackendUserAuthentication\backendCheckLogin(), TypoScriptFrontendController\beLoginLinkIPList(), UriBuilder\buildBackendUri(), Typo3Link\buildJSClassesAnchorArray(), UriBuilder\buildUri(), TypoScriptFrontendController\checkAlternativeIdMethods(), AbstractUserAuthentication\checkAuthentication(), FrontendBackendUserAuthentication\checkBackendAccessSettingsFromInitPhp(), Bootstrap\checkBackendIpOrDie(), BackendUserAuthentication\checkLockToIP(), TypoScriptFrontendController\checkPageUnavailableHandler(), Bootstrap\checkSslBackendAndRedirectIfNeeded(), ImportExportController\checkUpload(), StandaloneViewTest\constructorSetsBaseUri(), StandaloneViewTest\constructorSetsRequestUri(), Indexer\createLocalPathUsingDomainURL(), ResourceCompressor\createMergedFile(), Application\defineAdditionalEntryPointRelatedConstants(), AbstractElementBrowser\determineScriptUrl(), AbstractRecordList\determineScriptUrl(), AbstractLinkBrowserController\determineScriptUrl(), AbstractTreeView\determineScriptUrl(), AdminPanelView\display(), RecordHistory\displaySettings(), TypoScriptFrontendController\domainNameMatchesCurrentRequest(), DebugExceptionHandler\echoExceptionWeb(), FrontendEditPanel\editPanel(), RsaEncryptionEncoder\enableRsaEncryption(), AbstractConditionMatcher\evaluateConditionCommon(), DatabaseConnection\explain(), TypoScriptFrontendController\fetch_the_id(), BackendUserAuthentication\fetchGroups(), TypoScriptFrontendController\findDomainRecord(), ServerRequestFactory\fromGlobals(), PreviewController\generateJavascript(), BackendController\generateJavascript(), ConditionMatcherTest\genericGetVariablesSucceedsWithNamespaceIENV(), PathUtility\getAbsoluteWebPath(), ActionTask\getActions(), AbstractUserAuthentication\getAuthInfoArray(), FileLinktype\getBrokenUrl(), InternalLinktype\getBrokenUrl(), PageTreeNavigationController\getButtons(), VersionModuleController\getButtons(), TaskModuleController\getButtons(), AbstractUserAuthentication\getCookieDomain(), AbstractStandaloneMessage\getDefaultMarkers(), ConfigurationStatus\getDeprecationLogStatus(), ExtDirectApi\getExtDirectApi(), PageRepository\getExtURL(), ImageService\getImageUri(), SecurityStatusReport\getInstallToolProtectionStatus(), RecyclerModuleController\getJavaScriptConfiguration(), PreviewHook\getPreviewConfiguration(), ElementInformationController\getRecordActions(), LoginController\getUriForFileName(), AbstractConditionMatcher\getVariableCommon(), RequestHandler\handleRequest(), AbstractUserAuthentication\hashLockClause_getHashInt(), UserElementsController\init(), FileUploadController\init(), TableController\init(), BasicFileUtility\init(), Bootstrap\initializeErrorHandling(), BrowseLinksController\initVariables(), AbstractUserAuthentication\ipLockClause_remoteIPNumber(), FrontendLoginController\isInCurrentDomain(), FrontendLoginController\isRelativeUrl(), PageLayoutView\languageSelector(), SearchController\linkPage(), InfoPageTyposcriptConfigController\main(), ListController\main(), FileController\main(), VersionModuleController\main(), TypoScriptTemplateInformationModuleFunctionController\main(), SimpleDataHandlerController\main(), PageLayoutController\makeButtons(), ElementInformationController\makeRef(), ElementInformationController\makeRefFrom(), ModuleTemplate\makeShortcutIcon(), DocumentTemplate\makeShortcutIcon(), IconUtility\mapFileExtensionToSpriteIconName(), PageLayoutView\newContentElementOnClick(), TaskModuleController\openInNewWindow(), TypoScriptFrontendController\pageErrorHandler(), DocumentTemplate\parseTime(), AbstractPlugin\pi_getEditIcon(), AbstractPlugin\pi_list_searchBox(), TypoScriptFrontendController\prefixLocalAnchorsWithScript(), EditDocumentController\preInit(), SearchFormController\printResultSectionLinks(), NewRecordController\regularNew(), AbstractUserAuthentication\removeCookie(), UsernamePasswordLoginProvider\render(), InlineRecordContainer\render(), YouTubeRenderer\render(), FileBrowser\renderFilesInFolder(), TranslationStatusController\renderL10nTable(), DatabaseRecordList\renderListHeader(), EditLinkViewHelper\renderStatic(), DeleteLinkViewHelper\renderStatic(), EditSysFileMetadataRecordViewHelper\renderStatic(), ResourceCompressor\returnFileReference(), EditDocumentController\setDocument(), TypoScriptFrontendController\setIDfromArgV(), AbstractUserAuthentication\setSessionCookie(), MailPostProcessor\setSubject(), FrontendLoginController\showLogin(), ReviewController\singleIndexAction(), RteHtmlParser\siteUrl(), AbstractUserAuthentication\start(), TypoScriptTemplateInformationModuleFunctionController\tableRow(), TypoScriptFrontendController\tempPageCacheContent(), RteHtmlParser\TS_images_rte(), PageLayoutView\tt_content_drawHeader(), FrontendLoginControllerTest\typo3SitePathEqualsStubSitePath(), FrontendLoginControllerTest\typo3SitePathEqualsStubSitePathAfterChangingInTest(), FrontendLoginControllerTest\typo3SiteUrlEqualsStubSiteUrl(), FrontendLoginControllerTest\typo3SiteUrlEqualsStubSiteUrlAfterChangingInTest(), VersionModuleController\versioningMgm(), DocumentTemplate\viewPageIcon(), ActionTask\viewRecordList(), ActionTask\viewSqlQuery(), AbstractExceptionHandler\writeLog(), ErrorHandler\writeLog(), BackendUserAuthentication\writelog(), AbstractExceptionHandler\writeLogEntries(), SearchController\writeSearchStat(), and SearchFormController\writeSearchStat().
|
static |
Retrieves the maximum path length that is valid in the current environment.
Definition at line 3200 of file GeneralUtility.php.
Referenced by SimpleFileBackend\setCache().
|
static |
Returns the maximum upload size for a file that is allowed. Measured in KB. This might be handy to find out the real upload limit that is possible for this TYPO3 installation.
Definition at line 3164 of file GeneralUtility.php.
Referenced by ResourceStorage\assureFileUploadPermissions(), and InlineControlContainer\renderPossibleRecordsSelectorTypeGroupDB().
|
static |
Returns a hex representation of a random byte string.
int | $count | Number of hex characters to return |
Definition at line 1321 of file GeneralUtility.php.
Referenced by AbstractUserAuthentication\createSessionId(), SilentConfigurationUpgradeService\generateEncryptionKeyIfNeeded(), and ProductionExceptionHandler\handle().
|
staticprotected |
Parses HTTP headers and returns the content of the "Location" header or the empty string if no such header found.
string | $content |
Definition at line 2625 of file GeneralUtility.php.
|
static |
Get all currently registered singletons
Warning: This is NOT a public API method and must not be used in own extensions! This method is usually only used in tests in setUp() to fetch the list of currently registered singletons, if this list is manipulated with setSingletonInstance() in tests.
Definition at line 4662 of file GeneralUtility.php.
Referenced by TcaCheckboxItemsTest\setUp(), TcaRadioItemsTest\setUp(), TcaSelectItemsTest\setUp(), DatabaseSystemLanguageRowsTest\setUp(), TcaSelectTreeItemsTest\setUp(), and StandaloneViewTest\setUp().
|
static |
Returns the HOST+DIR-PATH of the current script (The URL, but without 'http://' and without script-filename)
Definition at line 3278 of file GeneralUtility.php.
References $url.
|
static |
Reads the file or url $url and returns the content If you are having trouble with proxys when reading URLs you can configure your way out of that with settings like $GLOBALS['TYPO3_CONF_VARS']['SYS']['curlUse'] etc.
string | $url | File/URL to read |
int | $includeHeader | Whether the HTTP header should be fetched or not. 0=disable, 1=fetch header+content, 2=fetch header only |
array | $requestHeaders | HTTP headers to be used in the request |
array | $report | Error code/message and, if $includeHeader is 1, response meta data (HTTP status and content type) |
Definition at line 2430 of file GeneralUtility.php.
References $GLOBALS, $url, and elseif.
Referenced by TemplateService\addExtensionStatics(), ImportExport\addThumbnail(), MicroDataSchema\buildJavascriptConfiguration(), Bootstrap\checkLockedBackendAndRedirectOrDie(), CleanerCommand\cli_main(), ResourceCompressor\compressCssFile(), ResourceCompressor\compressJsFile(), ExtensionManagementUtility\createExtLocalconfCacheEntry(), ExtensionManagementUtility\createExtTablesCacheEntry(), ResourceCompressor\createMergedFile(), UpdateScriptUtility\determineUpdateClassName(), ImportExport\export_addFile(), AbstractDownloadExtensionUpdate\fetchUrl(), CoreVersionService\fetchVersionMatrixFromRemote(), TemplateService\fileContent(), DocumentationService\getAvailablePackages(), UploadExtensionFileController\getExtensionFromT3xFile(), ExtensionCompatibilityTester\getExtensionsToExclude(), BackendUtility\getFlexFormDS(), T3editorElement\getHTMLCodeForEditor(), DocumentTemplate\getHtmlTemplate(), AbstractOEmbedHelper\getOEmbedData(), DocumentationService\getOfficialDocuments(), BackendUtility\getPagesTSconfig(), T3editor\getPreparedTemplate(), PreviewHook\getPreviewConfiguration(), YouTubeHelper\getPreviewImage(), VimeoHelper\getPreviewImage(), AbstractItemProvider\getRegisteredFlexForms(), BackendUtility\getRegisteredFlexForms(), InstallUtility\getSqlDataDumpForFile(), SqlExpectedSchemaService\getTablesDefinitionString(), PageRenderer\getTemplateForPart(), TemplateService\getTypoScriptSourceFileContent(), RteHtmlParser\getUrl(), Indexer\getUrlHeaders(), InstallUtility\importStaticSqlFile(), TypoScriptParser\includeFile(), TemplateService\includeStaticTypoScriptSources(), Indexer\indexExternalUrl(), CharsetConverter\initCaseFolding(), CharsetConverter\initCharset(), CharsetConverter\initToASCII(), CharsetConverter\initUnicodeData(), ImportExport\loadFile(), BackendController\loadResourcesForRegisteredNavigationComponents(), ExtensionCompatibilityTester\logError(), TypoScriptFrontendController\pageErrorHandler(), InstallUtility\processDatabaseUpdates(), FileContentParser\readFileContent(), ExtensionCompatibilityTester\removeCurrentExtensionFromFile(), AbstractStandaloneMessage\render(), TcaFlexFetch\resolvePossibleExternalFileInDataStructure(), ResourceCompressor\retrieveExternalFile(), ExtensionCompatibilityTester\writeCurrentExtensionToFile(), and ImportExport\writeFileVerify().
|
static |
Creates and returns reference to a user defined object. This function can return an object reference if you like. Just prefix the function call with "&": "$objRef = &\TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj('EXT:myext/class.tx_myext_myclass.php:&tx_myext_myclass');". This will work ONLY if you prefix the class name with "&" as well. See description of function arguments. Please note that the reference functionality is deprecated as of TYPO3 CMS 7, and will be removed with TYPO3 CMS 8, let the class use the SingletonInterface of TYPO3 instead.
string | $classRef | Class reference, '[file-reference":"]["&"]class-name'. You can prefix the class name with "[file-reference]:" and ::getFileAbsFileName() will then be used to resolve the filename and subsequently include it by "require_once()" which means you don't have to worry about including the class file either! Example: "EXT:realurl/class.tx_realurl.php:&tx_realurl". Finally; for the class name you can prefix it with "&" and you will reuse the previous instance of the object identified by the full reference string (meaning; if you ask for the same $classRef later in another place in the code you will get a reference to the first created one!). |
Definition at line 4385 of file GeneralUtility.php.
References $GLOBALS.
Referenced by ClearCacheToolbarItem\__construct(), ActionTask\__construct(), LinkAnalyzer\__construct(), ExtensionManagerConfigurationUtility\buildHashMethodSelector(), DataHandler\checkValueForFlex(), CleanerCommand\cli_main(), DatabaseConnection\connectDB(), CrawlerHook\crawler_execute(), CrawlerHook\crawler_init(), MediaItemHooks\customMediaParams(), MediaItemHooks\customMediaRenderTypes(), DataHandler\deleteAction(), AdminPanelView\display(), FrontendEditingController\displayEditIcons(), FrontendEditingController\displayEditPanel(), FileDumpController\dumpAction(), BackendUserAuthentication\fetchGroups(), AbstractMenuContentObject\filterMenuPages(), ExtDirectApi\generateAPI(), TypoScriptFrontendController\generatePage_postProcessing(), DataHandler\getCheckModifyAccessListHookObjects(), ContentObjectRenderer\getData(), BackendUtility\getFlexFormDS(), ContentObjectRenderer\getGetImgResourceHookObjects(), ContentObjectRenderer\getImageSourceCollection(), PageRepository\getPage(), PageRepository\getPagesOverlay(), PageRepository\getRecordOverlay(), TypoScriptFrontendController\handleDataSubmission(), IndexSearchRepository\hookRequest(), CssStyledContentController\hookRequest(), SearchController\hookRequest(), SearchFormController\hookRequest(), ModulesController\indexAction(), Indexer\init(), InlineRecordContainer\initHookObjects(), SearchFormController\initialize(), LinkValidatorReport\initialize(), Indexer\initializeExternalParsers(), SearchController\initializeExternalParsers(), FrontendBackendUserAuthentication\initializeFrontendEdit(), ElementBrowserController\main(), NewContentElementController\main(), ElementInformationController\main(), ParseHtmlController\main_parse_html(), AbstractDatabaseRecordList\makeQueryArray(), DataHandler\moveRecord(), DataHandler\moveRecord_raw(), ExtendedFileUtility\processData(), ExtDirectRouter\processRpc(), SearchController\procSearchWordsByLexer(), TypoScriptFrontendController\realPageCacheContent(), ContentObjectRenderer\resolveMixedLinkParameter(), RteHtmlParser\RTE_transform(), ContentObjectRenderer\start(), RteHtmlParser\TS_links_db(), RteHtmlParser\TS_links_rte(), and PageLayoutView\tt_content_drawFooter().
|
static |
Compressing a GIF file if not already LZW compressed. This function is a workaround for the fact that ImageMagick and/or GD does not compress GIF-files to their minimun size (that is RLE or no compression used)
The function takes a file-reference, $theFile, and saves it again through GD or ImageMagick in order to compress the file GIF: If $type is not set, the compression is done with ImageMagick (provided that $GLOBALS['TYPO3_CONF_VARS']['GFX']['im_path_lzw'] is pointing to the path of a lzw-enabled version of 'convert') else with GD (should be RLE-enabled!) If $type is set to either 'IM' or 'GD' the compression is done with ImageMagick and GD respectively PNG: No changes.
$theFile is expected to be a valid GIF-file! The function returns a code for the operation.
string | $theFile | Filepath |
string | $type | See description of function |
Definition at line 274 of file GeneralUtility.php.
References GraphicalFunctions\gifCompress().
|
static |
Returns true if the "l18n_cfg" field value is not set to hide pages in the default language
int | $localizationConfiguration |
Definition at line 4131 of file GeneralUtility.php.
Referenced by AbstractMenuContentObject\isSubMenu().
|
static |
Responds on input localization setting value whether the page it comes from should be hidden if no translation exists or not.
int | $l18n_cfg_fieldValue | Value from "l18n_cfg" field of a page record |
Definition at line 4119 of file GeneralUtility.php.
References $GLOBALS.
Referenced by AbstractMenuContentObject\filterMenuPages(), AbstractMenuContentObject\isSubMenu(), AbstractMenuContentObject\prepareMenuItemsForLanguageMenu(), TranslationStatusController\renderL10nTable(), and TypoScriptFrontendController\settingLanguage().
|
static |
Returns a proper HMAC on a given input string and secret TYPO3 encryption key.
string | $input | Input string to create HMAC from |
string | $additionalSecret | additionalSecret to prevent hmac beeing used in a different context |
Definition at line 789 of file GeneralUtility.php.
References $GLOBALS.
Referenced by LinkBrowserController\areFieldChangeFunctionsValid(), ColorpickerController\areFieldChangeFunctionsValid(), FileDumpController\dumpAction(), AbstractFormProtection\generateToken(), LinkBrowserController\getBodyTagAttributes(), FileWriter\getDefaultLogFileName(), ResourceStorage\getPublicUrl(), SessionService\getSessionSavePath(), ContentObjectRenderer\imageLinkWrap(), FileSystemNavigationFrameController\init(), ShowImageController\initialize(), InlineStackProcessor\injectAjaxConfiguration(), ImageManipulationWizard\isValidToken(), PageRenderer\loadRequireJs(), FolderTreeView\PMiconATagWrap(), ImageManipulationElement\render(), and AbstractFormProtection\validateToken().
|
static |
Checks if the provided host header value matches the trusted hosts pattern without any preprocessing.
string | $hostHeaderValue |
Definition at line 3670 of file GeneralUtility.php.
References $GLOBALS, and GeneralUtility\strtolower().
Referenced by Check\checkTrustedHostPattern().
|
static |
Returns an ASCII string (punicode) representation of $value
string | $value |
Definition at line 1302 of file GeneralUtility.php.
Referenced by DataHandler\checkValue_input_Eval().
|
static |
Compile the command for running ImageMagick/GraphicsMagick.
string | $command | Command to be run: identify, convert or combine/composite |
string | $parameters | The parameters string |
string | $path | Override the default path (e.g. used by the install tool) |
Definition at line 5268 of file GeneralUtility.php.
References CommandUtility\imageMagickCommand().
Referenced by GraphicalFunctions\combineExec(), GraphicalFunctions\gifCompress(), GraphicalFunctions\imageMagickExec(), GraphicalFunctions\imageMagickIdentify(), ThumbnailView\main(), GraphicalFunctions\readPngGif(), and PreviewProcessing\resizeImage().
|
static |
Implodes a multidim-array into GET-parameters (eg. ¶m[key][key2]=value2¶m[key][key3]=value3)
string | $name | Name prefix for entries. Set to blank if you wish none. |
array | $theArray | The (multidimensional) array to implode |
string | $str | (keep blank) |
bool | $skipBlank | If set, parameters which were blank strings would be removed. |
bool | $rawurlencodeParamName | If set, the param name itself (for example "param[key][key2]") would be rawurlencoded as well. |
Definition at line 1614 of file GeneralUtility.php.
Referenced by Indexer\backend_initIndexer(), UriBuilder\buildTypolinkConfiguration(), UriBuilder\buildUri(), TypoScriptFrontendController\calculateLinkVars(), EditDocumentController\compileStoreDat(), FolderUtilityRenderer\createFolder(), EditDocumentController\generatePreviewCode(), WorkspaceService\generateWorkspacePreviewLink(), LinkBrowserController\getBodyTagAttributes(), AbstractLinkBrowserController\getBodyTagAttributes(), FileBrowser\getBulkSelector(), FileBrowser\getFileSearchField(), FrontendLoginController\getPreserveGetVars(), ContentObjectRenderer\getQueryArguments(), DocumentTemplate\getTabMenu(), ContentObjectRenderer\getTypoLink(), EditDocumentController\init(), TemplateService\linkData(), SearchController\linkPage(), TypoScriptFrontendController\makeCacheHash(), ModuleTemplate\makeShortcutUrl(), DocumentTemplate\makeShortcutUrl(), AbstractPlugin\pi_linkTP(), ElementBrowserFolderTreeView\PM_ATagWrap(), ElementBrowserPageTreeView\PM_ATagWrap(), ElementBrowserPageTreeView\printTree(), NewContentElementController\removeInvalidElements(), FolderUtilityRenderer\uploadForm(), ElementBrowserPageTreeView\wrapTitle(), and ElementBrowserFolderTreeView\wrapTitle().
|
static |
Implodes attributes in the array $arr for an attribute list in eg. and HTML tag (with quotes)
array | $arr | Array with attribute key/value pairs, eg. "bgcolor"=>"red", "border"=>0 |
bool | $xhtmlSafe | If set the resulting attribute list will have a) all attributes in lowercase (and duplicates weeded out, first entry taking precedence) and b) all values htmlspecialchar()'ed. It is recommended to use this switch! |
bool | $dontOmitBlankAttribs | If TRUE, don't check if values are blank. Default is to omit attributes with blank values. |
Definition at line 1923 of file GeneralUtility.php.
References $list, and GeneralUtility\strtolower().
Referenced by ContentObjectRenderer\addParams(), ContentObjectRenderer\encaps_lineSplit(), CssStyledContentController\render_table(), CssStyledContentController\render_uploads(), ImageRenderingController\renderImageAttributes(), AbstractMenuContentObject\setATagParts(), RteHtmlParser\transformStyledATags(), RteHtmlParser\TS_AtagToAbs(), RteHtmlParser\TS_images_rte(), RteHtmlParser\TS_links_db(), RteHtmlParser\TS_reglinks(), PageTreeView\wrapTitle(), and FolderTreeView\wrapTitle().
|
static |
Check if an string item exists in an array. Please note that the order of function parameters is reverse compared to the PHP function in_array()!!!
Comparison to PHP in_array(): -> $array = array(0, 1, 2, 3); -> variant_a := ::inArray($array, $needle) -> variant_b := in_array($needle, $array) -> variant_c := in_array($needle, $array, TRUE) +------—+--------—+--------—+--------—+ | $needle | variant_a | variant_b | variant_c | +------—+--------—+--------—+--------—+ | '1a' | FALSE | TRUE | FALSE | | '' | FALSE | TRUE | FALSE | | '0' | TRUE | TRUE | FALSE | | 0 | TRUE | TRUE | TRUE | +------—+--------—+--------—+--------—+
array | $in_array | One-dimensional array of items |
string | $item | Item to check for |
Definition at line 1453 of file GeneralUtility.php.
References ArrayUtility\inArray().
|
static |
Initialize the system log.
Definition at line 5031 of file GeneralUtility.php.
References $GLOBALS, MathUtility\forceIntegerInRange(), and GeneralUtility\strtoupper().
|
static |
Check for item in list Check if an item exists in a comma-separated list of items.
string | $list | Comma-separated list of items (string) |
string | $item | Item to check for |
Definition at line 691 of file GeneralUtility.php.
References $list.
Referenced by ContentObjectRenderer\_parseFunc(), DatabaseConnection\_quoteWhereClause(), DatabaseRowDateTimeFields\addData(), DatabaseRowDefaultValues\addData(), AbstractTreeView\addField(), AbstractItemProvider\addItemsFromFolder(), ExtensionManagementUtility\addModule(), CategoryRegistry\addTcaColumn(), ExtensionManagementUtility\addToAllTCAtypes(), UserSettingsController\addToList(), CommandMap\applyWorkspacesSetStageBehaviour(), BackendUtility\blindUserNames(), SelectFont\buildJSFontItemsConfig(), WorkspaceService\canCreatePreviewLink(), BackendUserAuthentication\check(), BackendUserAuthentication\checkAuthMode(), ExtensionManagerConfigurationUtility\checkConfigurationFrontend(), ResourceStorage\checkFileExtensionPermission(), ContentObjectRenderer\checkIf(), ModuleLoader\checkModWorkspace(), DataHandler\checkValue(), DataHandler\checkValue_SW(), BackendUserAuthentication\checkWorkspace(), DataHandler\compareFieldArrayWithCurrentAndUnset(), Mysql\compileWhereClause(), Adodb\compileWhereClause(), GraphicalFunctions\copyImageOntoImage(), ElementEntityProcessor\createNewDependentElementChildReferenceCallback(), ElementEntityProcessor\createNewDependentElementParentReferenceCallback(), ContentObjectRenderer\DBgetInsert(), ContentObjectRenderer\DBgetUpdate(), ContentObjectRenderer\DBmayFEUserEdit(), ContentObjectRenderer\detectLinkTypeFromLinkParameter(), ClickMenu\enableDisableItems(), ConditionMatcher\evaluateCondition(), AbstractConditionMatcher\evaluateConditionCommon(), DatabaseConnection\explain(), ImportExport\export_addFile(), ExtendedTemplateService\ext_getObjTree(), ExtendedTemplateService\ext_getTypeData(), ExtendedTemplateService\ext_procesInput(), BackendUserAuthentication\fetchGroups(), StagesService\fetchGroupsRecursive(), SelectImage\fileIsSelectableInFileList(), ContentObjectRenderer\filelist(), AbstractMenuContentObject\filterMenuPages(), FileController\flattenResultDataValue(), ExtendedFileUtility\func_edit(), JavaScriptMenuContentObject\generate_level(), SelectTreeElement\generateJavascript(), AbstractDatabaseRecordList\generateList(), PageLayoutView\generateTtContentDataArray(), ContentObjectRenderer\getBorderAttr(), SetupModuleController\getCSH(), SqlSchemaMigrationService\getDatabaseExtra(), GraphicalFunctions\getImageDimensions(), FileFacade\getIsEditable(), FileFacade\getIsImage(), XmlParserFactory\getParserInstance(), TcaRecordTitle\getRecordTitleForInputType(), BackendUtility\getRecordWSOL(), TemplateService\getRootlineLevel(), PageLayoutView\getTableMenu(), SoftReferenceIndex\getTypoLinkParts(), ActionTask\getUsergroups(), SqlParser\getValue(), AbstractUserAuthentication\hashLockClause_getHashInt(), ContentObjectRenderer\imageLinkWrap(), GraphicalFunctions\imageMagickConvert(), SearchFormController\initialize(), BasicFileUtility\is_allowed(), CacheHashCalculator\isCoreParameter(), BackendUserAuthentication\isMemberOfGroup(), AbstractMenuContentObject\isSubMenu(), NewRecordController\isTableAllowedForThisPage(), SaltedPasswordsUtility\isUsageEnabled(), ParseHtmlController\keepSpanTagsWithId(), ActionList\listURL(), SortPagesWizardModuleFunction\main(), ImportExportController\main(), EditFileController\main(), ThumbnailView\main(), PageLayoutController\makeActionMenu(), AbstractMenuContentObject\makeMenu(), QueryGenerator\makeOptionList(), LiveSearch\makeQuerySearchByTable(), AbstractDatabaseRecordList\makeSearchString(), GraphicalFunctions\maskImageOntoImage(), EvaluateDisplayConditions\matchFieldCondition(), BaseScriptClass\mergeExternalItems(), BackendUserAuthentication\modAccess(), SqlParser\parseALTERTABLE(), SqlParser\parseWhereClause(), EvaluatorTest\passwordIsTurnedIntoSaltedString(), AbstractPlugin\pi_exec_query(), Clipboard\printContentFromTab(), ClickMenu\printFileClickMenu(), ContentObjectRenderer\processParams(), SpellCheckingController\processRequest(), TemplateService\processTemplate(), UserSettingsController\removeFromList(), AbstractItemProvider\removeItemsByDoktypeUserRestriction(), FlexFormElementContainer\render(), ImageManipulationElement\render(), FileBrowser\renderFilesInFolder(), StagesService\resolveBackendUserIds(), CommandMap\resolveWorkspacesSetStageDependencies(), CommandMap\resolveWorkspacesSwapDependencies(), SetupModuleController\setAvatarFileUid(), FrontendLoginController\showLogin(), GraphicalFunctions\splitString(), DatabaseConnection\sql_query(), ContentObjectRenderer\stdWrap(), RteHtmlParser\TS_links_rte(), RteHtmlParser\TS_transform_rte(), Lexer\utf8_is_letter(), VersionModuleController\versioningMgm(), and BackendUserAuthentication\workspaceCheckStageForCurrent().
|
staticprotected |
Speed optimized alternative to ReflectionClass::newInstanceArgs()
string | $className | Name of the class to instantiate |
array | $arguments | Arguments passed to self::makeInstance() thus the first one with index 0 holds the requested class name |
Definition at line 4489 of file GeneralUtility.php.
|
static |
Explodes a $string delimited by $delim and casts each item in the array to (int). Corresponds to ::trimExplode(), but with conversion to integers for all values.
string | $delimiter | Delimiter string to explode with |
string | $string | The string to explode |
bool | $removeEmptyValues | If set, all empty values (='') will NOT be set in output |
int | $limit | If positive, the result will contain a maximum of limit elements, |
Definition at line 1469 of file GeneralUtility.php.
References elseif.
Referenced by GraphicalFunctions\adjust(), Abbreviation\buildJSAbbreviationArray(), GraphicalFunctions\calcTextCordsForMap(), QueryGenerator\cleanInputVal(), DatabaseConnection\cleanIntList(), CategoryMenuUtility\collectPages(), RecordsContentObject\collectRecordsFromCategories(), VersionNumberUtility\convertVersionStringToArray(), GraphicalFunctions\copyGifOntoGif(), QueryFactory\create(), GraphicalFunctions\crop(), ContentObjectRenderer\DBmayFEUserEditSelect(), SearchFormController\doSearch(), DatabaseConnection\exec_SELECTquery(), IndexSearchRepository\execFinalQuery(), SearchFormController\execFinalQuery(), AdodbPreparedStatement\execute(), ExtendedTemplateService\ext_getTypeData(), BackendUserAuthentication\fetchGroups(), StagesService\fetchGroupsRecursive(), FilesContentObject\findAndSortFiles(), GraphicalMenuContentObject\findLargestDims(), BackendController\generateJavascript(), SearchController\getAllAvailableIndexConfigurationsOptions(), AbstractMenuContentObject\getBannedUids(), NewRecordController\getButtons(), EditDocumentController\getButtons(), DataMapper\getConstraint(), BackendUserAuthentication\getFileMountRecords(), PageRepository\getMultipleGroupsWhereClause(), VersionNumberUtility\getNumericTypo3Version(), TypoScriptFrontendController\getPageShortcut(), DatabaseConnection\getQueryComponents(), IndexSearchRepository\getSearchRootPageIdList(), ContentObjectRenderer\getSlidePids(), DataProvider\getWhereClause(), ContentObjectRenderer\imageLinkWrap(), GraphicalFunctions\IMparams(), TemplateService\includeStaticTypoScriptSources(), EditDocumentController\init(), SearchController\initialize(), SearchFormController\initialize(), BackendUserAuthentication\initializeDbMountpointsInWorkspace(), PageLayoutController\main(), GraphicalFunctions\makeBox(), GraphicalFunctions\makeEllipse(), GraphicalFunctions\makeEmboss(), GraphicalMenuContentObject\makeGifs(), QueryGenerator\makeSelectorTable(), GraphicalFunctions\makeShadow(), GraphicalFunctions\objPosition(), RootlineUtility\parseMountPointParameter(), AbstractMenuContentObject\prepareMenuItemsForBrowseMenu(), AbstractMenuContentObject\prepareMenuItemsForDirectoryMenu(), AbstractMenuContentObject\prepareMenuItemsForKeywordsMenu(), AbstractMenuContentObject\prepareMenuItemsForLanguageMenu(), AbstractMenuContentObject\prepareMenuItemsForUpdatedMenu(), SplitProcessor\process(), TemplateService\processTemplate(), VersionNumberUtility\raiseVersionNumber(), SearchController\searchAction(), IndexSearchRepository\sectionTableWhere(), SearchFormController\sectionTableWhere(), DatabaseConnection\SELECTquery(), AbstractLinkHandler\setTemporaryDbMounts(), DatabaseBrowser\setTemporaryDbMounts(), PageLinkHandler\setTemporaryDbMounts(), TypoScriptFrontendController\settingLanguage(), BackendUserAuthentication\setWebmounts(), GraphicalFunctions\setWorkArea(), GraphicalFunctions\splitString(), AbstractMenuContentObject\start(), ContentObjectRenderer\substring(), and GraphicalFunctions\txtPosition().
|
static |
Transform an IPv6 address from binary to hex-representation
string | $bin | IPv6 address in hex-presentation |
Definition at line 482 of file GeneralUtility.php.
|
static |
Transform a regular IPv6 address from hex-representation into binary
string | $hex | IPv6 address in hex-presentation |
Definition at line 470 of file GeneralUtility.php.
|
static |
Checks if the $path is absolute or relative (detecting either '/' or 'x:/' as first part of string) and returns TRUE if so.
string | $path | File path to evaluate |
Definition at line 3891 of file GeneralUtility.php.
Referenced by ContentObjectRenderer\clean_directory(), CrawlerHook\crawler_execute_type2(), BackendWarnings\displayWarningMessages_postProcess(), DocumentTemplate\getHtmlTemplate(), ModuleMenuView\getModuleIconAbsolute(), BackendModuleRepository\getModuleIconAbsolute(), ModuleMenuView\getModuleIconRelative(), BackendModuleRepository\getModuleIconRelative(), ShortcutToolbarItem\getShortcutIcon(), Indexer\indexRegularDocument(), ExtensionManagementUtility\loadNewTcaColumnsConfigFiles(), and GraphicalFunctions\prependAbsolutePath().
|
static |
Returns TRUE if the path is absolute, without backpath '..' and within the PATH_site OR within the lockRootPath
string | $path | File path to evaluate |
Definition at line 3902 of file GeneralUtility.php.
References $GLOBALS.
Referenced by Locker\__destruct(), MailPostProcessor\addAttachmentsFromSession(), AbstractService\checkInputFile(), CrawlerHook\crawler_execute_type2(), Indexer\extractLinks(), DocumentTemplate\getHtmlTemplate(), PathUtility\getRelativePath(), InstallUtility\importInitialFiles(), Indexer\indexRegularDocument(), ImportExport\loadFile(), SimpleLockStrategy\release(), Locker\release(), Download\setDirectory(), and AbstractService\writeFile().
|
static |
Checks if the provided host header value matches the trusted hosts pattern. If the pattern is not defined (which only can happen early in the bootstrap), deny any value. The result is saved, so the check needs to be executed only once.
string | $hostHeaderValue | HTTP_HOST header value as sent during the request (may include port) |
Definition at line 3639 of file GeneralUtility.php.
References $GLOBALS.
|
static |
Checks if current e-mail sending method does not accept recipient/sender name in a call to PHP mail() function. Windows version of mail() and mini_sendmail program are known not to process such input correctly and they cause SMTP errors. This function will return TRUE if current mail sending method has problem with recipient name in recipient/sender argument for mail().
Definition at line 1120 of file GeneralUtility.php.
|
static |
Returns TRUE if the first part of $str matches the string $partStr
string | $str | Full string to check |
string | $partStr | Reference string which must be found as the "first part" of the full string |
Definition at line 927 of file GeneralUtility.php.
Referenced by Locker\__destruct(), ActionTask\action_getUserMainDir(), LocalDriver\addFile(), ConfigurationItemRepository\buildConfigurationArray(), ResourceCompressor\checkBaseDirectory(), CrawlerHook\checkDeniedSuburls(), BasicFileUtility\checkPathAgainstMounts(), CrawlerHook\checkUrl(), DataHandler\clear_cacheCmd(), Adodb\compileWhereClause(), ReferenceIndex\createEntryData_fileRels(), ResourceCompressor\createMergedFile(), GraphicalFunctions\createTempSubDir(), LocalDriver\determineBaseUrl(), ImportExport\export_addFile(), DocumentationService\fetchNearestDocument(), ContentObjectRenderer\filelist(), BasicFileUtility\findFirstWebFolder(), ExtDirectApi\findNamespace(), SoftReferenceIndex\findRef_images(), SoftReferenceIndex\findRef_TStemplate(), ImportExport\fixFileIDsInRelations(), TemplateService\getFileName(), ResourceFactory\getFolderObjectFromCombinedIdentifier(), DocumentTemplate\getHtmlTemplate(), ListUtility\getInstallTypeForPackage(), DocumentRepository\getMetadata(), MailUtility\getSystemFromAddress(), BasicFileUtility\is_webpath(), FrontendLoginController\isInLocalDomain(), FrontendLoginController\isRelativeUrl(), FileHandlingUtility\isValidExtensionPath(), ConfigurationManager\isValidLocalConfigurationPath(), LocalDriver\isWithin(), DoubleFilesCommand\main(), LostFilesCommand\main(), RteImagesCommand\main(), RteImagesCommand\main_autoFix(), EvaluatorTest\md5HashIsUpdatedToTemporarySaltedString(), TypoScriptFrontendController\pageErrorHandler(), ImportExport\processSoftReferences_saveFile(), ImportExport\processSoftReferences_saveFile_createRelFile(), SimpleLockStrategy\release(), Locker\release(), AccessibilityLinkController\removeAccessibilityIcon(), CustomAttributeController\render_clickenlarge(), CssStyledContentController\render_uploads(), ResourceFactory\retrieveFileOrFolderObject(), SimpleFileBackend\setCacheDirectory(), SoftReferenceIndex\setTypoLinkPartsElement(), LocalizationUtility\translate(), ImportExport\unlinkTempFiles(), and ImportExport\verifyFolderAccess().
|
staticprotected |
Allows internal requests to the install tool and from the command line. We accept this risk to have the install tool always available. Also CLI needs to be allowed as unfortunately AbstractUserAuthentication::getAuthInfoArray() accesses HTTP_HOST without reason on CLI Additionally, allows requests when no REQUESTTYPE is set, which can happen quite early in the Bootstrap. See Application.php in EXT:backend/Classes/Http/.
Definition at line 3701 of file GeneralUtility.php.
|
static |
Checks if a given URL matches the host that currently handles this HTTP request. Scheme, hostname and (optional) port of the given URL are compared.
string | $url | URL to compare with the TYPO3 request host |
Definition at line 678 of file GeneralUtility.php.
References $url.
Referenced by ResourceCompressor\createMergedFile().
|
static |
Check if the current request is running on a CGI server API
Definition at line 5408 of file GeneralUtility.php.
|
static |
Checks if a given string is a Uniform Resource Locator (URL).
On seriously malformed URLs, parse_url may return FALSE and emit an E_WARNING.
filter_var() requires a scheme to be present.
http://www.faqs.org/rfcs/rfc2396.html Scheme names consist of a sequence of characters beginning with a lower case letter and followed by any combination of lower case letters, digits, plus ("+"), period ("."), or hyphen ("-"). For resiliency, programs interpreting URI should treat upper case letters as equivalent to lower case in scheme names (e.g., allow "HTTP" as well as "http"). scheme = alpha *( alpha | digit | "+" | "-" | "." )
Convert the domain part to punicode if it does not look like a regular domain name. Only the domain part because RFC3986 specifies the the rest of the url may not contain special characters: http://tools.ietf.org/html/rfc3986#appendix-A
string | $url | The URL to be validated |
Definition at line 1401 of file GeneralUtility.php.
References $url, and HttpUtility\buildUrl().
Referenced by ResourceCompressor\createMergedFile(), LocalDriver\determineBaseUrl(), ResourceStorage\getPublicUrl(), Image\getUrl(), and FrontendLoginController\isInLocalDomain().
|
static |
Filters an array to reduce its elements to match the condition. The values in $keepItems can be optionally evaluated by a custom callback function.
Example (arguments used to call this function): $array = array( array('aa' => array('first', 'second'), array('bb' => array('third', 'fourth'), array('cc' => array('fifth', 'sixth'), ); $keepItems = array('third'); $getValueFunc = function($value) { return $value[0]; }
Returns: array( array('bb' => array('third', 'fourth'), )
array | $array | The initial array to be filtered/reduced |
mixed | $keepItems | The items which are allowed/kept in the array - accepts array or csv string |
string | $getValueFunc | (optional) Callback function used to get the value to keep |
Definition at line 1597 of file GeneralUtility.php.
References ArrayUtility\keepItemsInArray().
|
static |
Converts the first char of a string to lowercase if it is a latin character (A-Z). Example: Converts "Hello World" to "hello World"
string | $string | The string to be used to lowercase the first character |
Definition at line 1372 of file GeneralUtility.php.
|
static |
Returns the link-url to the current script. In $getParams you can set associative keys corresponding to the GET-vars you wish to add to the URL. If you set them empty, they will remove existing GET-vars from the current URL. REMEMBER to always use htmlspecialchars() for content in href-properties to get ampersands converted to entities (XHTML requirement and XSS precaution)
array | $getParams | Array of GET parameters to include |
Definition at line 3297 of file GeneralUtility.php.
Referenced by ReturnUrl\addData(), RecordHistory\displaySettings(), ConfigurationForm\ext_getForm(), NewRecordController\getButtons(), DatabaseBrowser\getTemporaryTreeMountCancelNotice(), PageLinkHandler\getTemporaryTreeMountCancelNotice(), RteController\init(), PageLayoutController\local_linkThisScript(), MoveElementController\main(), PageTreeNavigationController\main(), EditDocumentController\openInNewWindowLink(), Clipboard\printClipboard(), ClickMenu\printDBClickMenu(), ModuleController\printLogMgm(), DocumentTemplate\redirectUrls(), ModuleTemplate\redirectUrls(), NewRecordController\regularNew(), InfoPageTyposcriptConfigController\renderList(), TypoScriptTemplateModuleController\renderList(), SwitchUserViewHelper\renderStatic(), PagePositionMap\wrapRecordTitle(), and AbstractTreeView\wrapStop().
|
static |
Takes a full URL, $url, possibly with a querystring and overlays the $getParams arrays values onto the quirystring, packs it all together and returns the URL again. So basically it adds the parameters in $getParams to an existing URL, $url
string | $url | URL string |
array | $getParams | Array of key/value pairs for get parameters to add/overrule with. Can be multidimensional. |
Definition at line 3320 of file GeneralUtility.php.
References $url, and ArrayUtility\mergeRecursiveWithOverrule().
Referenced by DatabaseRecordList\getButtons(), DatabaseRecordList\getDocHeaderButtons(), FileUploadController\main(), RenameFileController\main(), ReplaceFileController\main(), and CreateFolderController\main().
|
static |
Returns auto-filename for locallang localizations
string | $fileRef | Absolute file reference to locallang file |
string | $language | Language key |
bool | $sameLocation | If TRUE, then locallang localization file name will be returned with same directory as $fileRef |
Definition at line 4162 of file GeneralUtility.php.
References elseif.
Referenced by LocallangXmlParser\getParsedData(), and AbstractXmlParser\getParsedData().
|
static |
Prefixes a URL used with 'header-location' with 'http://...' depending on whether it has it already.
string | $path | URL / path to prepend full URL addressing to. |
Definition at line 3144 of file GeneralUtility.php.
References elseif.
Referenced by AdminPanelView\display(), FrontendLoginController\generateAndSendHash(), AdminPanelView\getAdminPanelHeaderData(), ImageService\getImageUri(), ExtDirectApi\getRoutingUrl(), OnlineMediaController\mainAction(), FileController\mainAction(), SimpleDataHandlerController\mainAction(), HttpUtility\redirect(), and PageRenderer\renderMainJavaScriptLibraries().
|
static |
Logs a call to a deprecated function. The log message will be taken from the annotation.
Definition at line 5214 of file GeneralUtility.php.
References $GLOBALS, DebugUtility\debugTrail(), and PathUtility\stripPathSitePrefix().
Referenced by ModuleController\__construct(), ModuleMenuView\__construct(), LocallangArrayParser\__construct(), Locker\__construct(), AbstractDomainObject\__wakeup(), TypoScriptFrontendController\acquirePageGenerationLock(), ExtensionManagementUtility\addModulePath(), BackendController\addToolbarItem(), CssStyledContentController\beautifyFileLink(), IconUtility\buildSpriteHtmlIconTag(), ContentObjectRenderer\CASEFUNC(), BackendUserAuthentication\checkCLIuser(), SchedulerModuleController\checkDate(), SearchFormController\checkExistance(), TypoScriptFrontendController\checkFileInclude(), DataHandler\checkValue_check(), DataHandler\checkValue_flex(), DataHandler\checkValue_group_select(), DataHandler\checkValue_input(), DataHandler\checkValue_radio(), DataHandler\checkValue_text(), ContentObjectRenderer\CLEARGIF(), EditController\closeWindow(), ContentObjectRenderer\COBJ_ARRAY(), ContentObjectRenderer\COLUMNS(), ResourceCompressor\compressCssPregCallback(), ContentObjectRenderer\CONTENT(), RelationHandler\convertPosNeg(), ContentObjectRenderer\CTABLE(), DocumentTemplate\dfw(), TypoScriptFrontendController\doLocalAnchorFix(), TypoScriptFrontendController\doXHTML_cleaning(), EditDocumentController\editRegularContentFromId(), DocumentTemplate\endPageJS(), RteHtmlParser\evalWriteFile(), ClickMenu\excludeIcon(), ConfigurationForm\ext_getKeyImage(), ExtendedTemplateService\ext_getKeyImage(), ContentObjectRenderer\FILE(), ContentObjectRenderer\FILES(), SimpleDataHandlerController\finish(), ContentObjectRenderer\FLOWPLAYER(), ContentObjectRenderer\FLUIDTEMPLATE(), ContentObjectRenderer\FORM(), QueryGenerator\formatQ(), DocumentTemplate\formatTime(), FlexFormTools\getAvailableLanguages(), FileList\getButtonsAndOtherMarkers(), ContextMenuAction\getClass(), DocumentTemplate\getDynamicTabMenu(), DocumentTemplate\getDynTabMenu(), DocumentTemplate\getDynTabMenuId(), BackendUtility\getExcludeFields(), BackendUtility\getExplicitAuthFieldValues(), IconUtility\getIcon(), SuggestWizardDefaultReceiver\getIcon(), StandaloneView\getLayoutRootPath(), BackendController\getPageRenderer(), DocumentTemplate\getPageRenderer(), TypoScriptFrontendController\getPageRenderer(), StandaloneView\getPartialRootPath(), BackendUtility\getRegisteredFlexForms(), IconUtility\getSpriteIcon(), IconUtility\getSpriteIconClasses(), IconUtility\getSpriteIconForFile(), IconUtility\getSpriteIconForRecord(), IconUtility\getSpriteIconForResource(), TypoScriptFrontendController\getStorageSiterootPids(), HtmlParser\getSubpart(), LocalImageProcessor\getTemporaryImageWithText(), AbstractFormFieldViewHelper\getValue(), NewContentElementController\getWizardItems(), ContentObjectRenderer\HMENU(), ContentObjectRenderer\HRULER(), ContentObjectRenderer\IMAGE(), ContentObjectRenderer\IMG_RESOURCE(), ContentObjectRenderer\IMGTEXT(), BackendUtility\implodeTSParams(), ClickMenuController\init(), T3editor\isEnabled(), StringUtility\isLastPartOfString(), DocumentTemplate\issueCommand(), QueryGenerator\JSbottom(), TypoScriptFrontendController\jumpUrl(), ContentObjectRenderer\LOAD_REGISTER(), ExtensionManagementUtility\loadNewTcaColumnsConfigFiles(), LanguageService\localizedFileRef(), ListFrameLoaderController\main(), ClickMenuController\main(), ParseHtmlController\main(), UserElementsController\main(), ExtendedTemplateService\makeHtmlspecialchars(), IconUtility\mapRecordTypeToSpriteIconClass(), EvaluateDisplayConditions\matchExtensionCondition(), ContentObjectRenderer\MEDIA(), DocumentTemplate\menuTable(), DatabaseConnection\MetaType(), ContentObjectRenderer\MULTIMEDIA(), DatabaseConnection\MySQLActualType(), DatabaseConnection\MySQLMetaType(), ContentObjectRenderer\OTABLE(), DocumentTemplate\parseTime(), AbstractPlugin\pi_list_searchBox(), GraphicalFunctions\pngToGifByImagemagick(), TypoScriptFrontendController\prefixLocalAnchorsWithScript(), DummyController\printContent(), LoginFramesetController\printContent(), ElementBrowserFramesetController\printContent(), ParseHtmlController\printContent(), ClickMenuController\printContent(), InfoModuleController\printContent(), UserElementsController\printContent(), TableController\printContent(), PageFunctionsController\printContent(), ImportExportController\printContent(), FileSystemNavigationFrameController\printContent(), VersionModuleController\printContent(), RteController\printContent(), DatabaseIntegrityView\printContent(), MoveElementController\printContent(), ConfigurationView\printContent(), ColorpickerController\printContent(), TypoScriptTemplateModuleController\printContent(), SetupModuleController\printContent(), ElementInformationController\printContent(), RecordList\printContent(), NewRecordController\printContent(), EditDocumentController\printContent(), ContentObjectRenderer\QTOBJECT(), ContentObjectRenderer\RECORDS(), TypoScriptFrontendController\releasePageGenerationLock(), FlashMessage\render(), SchedulerModuleController\render(), CssStyledContentController\render_bullets(), CssStyledContentController\render_uploads(), PermissionAjaxController\renderGroupname(), PermissionAjaxController\renderOwnername(), IconViewHelper\renderStatic(), DocumentTemplate\rfw(), ContentObjectRenderer\SEARCHRESULT(), ContextMenuAction\setClass(), TypoScriptFrontendController\setExternalJumpUrl(), StandaloneView\setLayoutRootPath(), StandaloneView\setPartialRootPath(), IconUtility\skinImg(), DocumentTemplate\spacer(), DatabaseConnection\splitGroupOrderLimit(), HtmlParser\substituteMarker(), HtmlParser\substituteMarkerAndSubpartArrayRecursive(), HtmlParser\substituteMarkerArray(), HtmlParser\substituteSubpart(), HtmlParser\substituteSubpartArray(), ContentObjectRenderer\SVG(), ContentObjectRenderer\SWFOBJECT(), DocumentTemplate\table(), ContentObjectRenderer\TEMPLATE(), ContentObjectRenderer\TEXT(), ContentObjectRenderer\USER(), TypoScriptTemplateObjectBrowserModuleFunctionController\verify_TSobjects(), TemplateService\wrap(), DocumentTemplate\wrapClickMenuOnIcon(), and ClickMenu\wrapColorTableCM().
|
static |
Creates an instance of a class taking into account the class-extensions API of TYPO3. USE THIS method instead of the PHP "new" keyword. Eg. "$obj = new myclass;" should be "$obj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance("myclass")" instead!
You can also pass arguments for a constructor: ::makeInstance(::class, $arg1, $arg2, ..., $argN)
You may want to use ::get() if you want TYPO3 to take care about injecting dependencies of the class to be created. Therefore create an instance of ObjectManager via GeneralUtility::makeInstance() first and call its get() method to get the instance of a specific class.
string | $className | name of the class to instantiate, must not be empty and not start with a backslash |
\InvalidArgumentException | if $className is empty or starts with a backslash |
Definition at line 4445 of file GeneralUtility.php.
Referenced by StandaloneView\__construct(), Clickmenu\__construct(), VersionClickMenu\__construct(), ActionHandler\__construct(), InfoPageTyposcriptConfigController\__construct(), BackendModuleRepository\__construct(), TranslationStatusController\__construct(), ModuleController\__construct(), UserToolbarItem\__construct(), LocalizationController\__construct(), DeletedRecordsController\__construct(), FluidTemplateContentObject\__construct(), AbstractModule\__construct(), ActionToolbarItem\__construct(), ExtdirectTreeDataProvider\__construct(), SchedulerCliController\__construct(), TypoScriptRepository\__construct(), OpendocsToolbarItem\__construct(), FileFacade\__construct(), PermissionAjaxController\__construct(), FailsafeView\__construct(), ClearCacheToolbarItem\__construct(), ModuleMenuView\__construct(), TypoScriptTemplateInformationModuleFunctionController\__construct(), DocHeaderComponent\__construct(), ElementBrowserController\__construct(), ActionTask\__construct(), ConfigurationView\__construct(), DatabaseQueryProcessor\__construct(), ProcessedFileRepository\__construct(), TaskModuleController\__construct(), ClickMenuController\__construct(), QueryView\__construct(), PageFunctionsController\__construct(), WizardView\__construct(), InlineControlContainer\__construct(), FrontendEditPanel\__construct(), InfoModuleController\__construct(), DatabaseIntegrityView\__construct(), ResourceFactory\__construct(), RteController\__construct(), IconFactory\__construct(), AbstractFormElement\__construct(), InlineRecordContainer\__construct(), LiveSearch\__construct(), ReplaceFileController\__construct(), ShortcutToolbarItem\__construct(), LanguageRepository\__construct(), AbstractElementBrowser\__construct(), EditFileController\__construct(), SqlParser\__construct(), Clipboard\__construct(), SystemInformationToolbarItem\__construct(), FolderTreeView\__construct(), PageTreeNavigationController\__construct(), SchedulerModuleController\__construct(), MailPostProcessor\__construct(), SuggestWizardDefaultReceiver\__construct(), RecordHistory\__construct(), TypoScriptTemplateModuleController\__construct(), BackendController\__construct(), ImportExportController\__construct(), ElementInformationController\__construct(), PagePositionMap\__construct(), RootlineUtility\__construct(), VersionModuleController\__construct(), TemplateView\__construct(), ReferenceIndex\__construct(), ClickMenu\__construct(), AbstractRecordList\__construct(), FileList\__construct(), DatabaseRecordList\__construct(), DatabaseConnection\__construct(), PageLayoutView\__construct(), ModuleTemplate\__construct(), DocumentTemplate\__construct(), PageRenderer\__construct(), ImportExport\__construct(), CharsetConverter\__construct(), ContentObjectRenderer\__construct(), TypoScriptFrontendController\__construct(), TypoScriptFrontendController\acquireLock(), TypoScriptFrontendController\acquirePageGenerationLock(), ResourceStorage\addFile(), ModuleTemplate\addFlashMessage(), AbstractItemProvider\addItemsFromSpecial(), DatabaseConnection\analyzeCachingTables(), Indexer\backend_initIndexer(), UriBuilder\buildBackendUri(), ExtensionManagementUtility\buildBaseTcaFromSingleFiles(), Abbreviation\buildJSAbbreviationArray(), UriBuilder\buildUri(), ContentObjectRenderer\callUserFunction(), SetupModuleController\checkAccess(), AbstractFunctionModule\checkExtObj(), BaseScriptClass\checkExtObj(), PreviewHook\checkForPreview(), StatusReportConflictsCheckHook\checkIfNoConflictingExtensionIsInstalled(), PageLayoutView\checkIfTranslationsExistInLanguage(), FileLinktype\checkLink(), Check\checkSomePhpOpcodeCacheIsLoaded(), GifBuilder\checkTextObj(), UpdateScriptUtility\checkUpdateScriptExists(), ImportExportController\checkUpload(), DataHandler\checkValue_input_Eval(), DataHandler\checkValue_text_Eval(), DataHandler\checkValueForRadio(), BasicFileUtility\cleanFileName(), FlexFormTools\cleanFlexFormXML(), RecordList\clearCache(), PageLayoutController\clearCache(), ImportantActions\clearOpcodeCache(), CrawlerHook\crawler_execute_type2(), LocallangArrayParser\createCsConvObject(), BackendLayoutView\createDataProviderContext(), ProcessedFileRepository\createDomainObject(), FormBuilder\createElementObject(), ContentObjectRenderer\createExceptionHandler(), ExtractorRegistry\createExtractorInstance(), ResourceFactory\createFolderObject(), IconFactory\createIcon(), ProcessedFileRepository\createNewProcessedFileObject(), DataHandlerHook\createRelationHandlerInstance(), DataHandler\createRelationHandlerInstance(), RendererRegistry\createRendererInstance(), ResourceFactory\createStorageObject(), TextExtractorRegistry\createTextExtractorInstance(), TypolinkViewHelper\createTypolinkParameterArrayFromArguments(), TreeNode\dataFromArray(), DataHandler\deleteRecord(), ReportController\detailAction(), TypoScriptFrontendController\determineId(), TypoScriptFrontendController\determineIdIsHiddenPage(), AbstractElementBrowser\determineScriptUrl(), AbstractRecordList\determineScriptUrl(), AbstractLinkBrowserController\determineScriptUrl(), AbstractTreeView\determineScriptUrl(), RecyclerAjaxController\dispatch(), FileDumpController\dumpAction(), RsaEncryptionEncoder\enableRsaEncryption(), LinkBrowserController\encodeTypoLink(), ValidatorTask\execute(), UpdateScriptUtility\executeUpdateIfNeeded(), ImportExport\export_addFile(), ImportExport\export_addRecord(), ConfigurationForm\ext_mergeIncomingWithExisting(), ExtendedTemplateService\ext_outputTS(), ExportPageTreeView\ext_tree(), AdministrationRepository\extGetTreeList(), BaseScriptClass\extObjContent(), Indexer\extractBaseHref(), Indexer\extractHyperLinks(), Indexer\extractLinks(), Indexer\extractRequiredMetaData(), TypoScriptFrontendController\fetch_the_id(), BackendUserAuthentication\fetchGroupData(), MetaDataRepository\findByFile(), FileBackend\findIdentifiersByTag(), GraphicalMenuContentObject\findLargestDims(), SoftReferenceIndex\findRef_images(), SoftReferenceIndex\findRef_TStemplate(), SoftReferenceIndex\findRef_typolink_tag(), FileController\flattenResultDataValue(), GeneralUtility\flushDirectory(), ReviewController\fullIndexAction(), DatabaseIntegrityView\func_refindex(), DatabaseIntegrityView\func_relations(), DatabaseIntegrityView\func_search(), SpriteBuildingHandler\generate(), AbstractDatabaseRecordList\generateList(), WorkspaceService\generateWorkspacePreviewLink(), LiveSearch\getAvailablePageIds(), PageLayoutView\getBackendLayoutView(), AbstractMenuContentObject\getCache(), ExtensionManagementUtility\getCacheManager(), DeletedRecordsController\getCacheManager(), DataHandler\getCacheManager(), Dispatcher\getCallableFromTarget(), LocalDriver\getCharsetConversion(), FormProtectionFactory\getClassNameAndConstructorArgumentsByState(), AbstractFormElement\getClipboardElements(), DataHandlerHook\getCommandMap(), Typo3Status\getCompatibility6Status(), PageRenderer\getCompressor(), LocalizationUtility\getConfigurationManager(), ContentObjectRenderer\getContentObject(), ClickMenuController\getContextMenuAction(), ConfigurationStatus\getCreatedDirectoriesWorldWritableStatus(), ConfigurationStatus\getCreatedFilesWorldWritableStatus(), TemplateService\getCurrentPageData(), ElementEntityProcessor\getDataHandler(), CollectionService\getDependencyCallback(), CommandMap\getDependencyCallback(), GridDataService\getDependencyCollectionService(), CollectionService\getDependencyResolver(), ConfigurationStatus\getDeprecationLogStatus(), ModuleTemplate\getDynamicTabMenu(), DocumentTemplate\getDynamicTabMenu(), SelectImageController\getElementBrowserInstance(), ElementBrowserController\getElementBrowserInstance(), CollectionService\getElementEntityProcessor(), CommandMap\getElementEntityProcessor(), SecurityStatus\getEncryptionKeyStatus(), DatabaseConnection\getFieldInfoCache(), FileCollector\getFileCollectionRepository(), FilesContentObject\getFileCollector(), SecurityStatus\getFileDenyPatternStatus(), ResourceStorage\getFileFactory(), FileDeletionAspect\getFileIndexRepository(), File\getFileIndexRepository(), ResourceStorage\getFileProcessingService(), FileCollector\getFileRepository(), InstallStatusReport\getFileSystemStatus(), ImageManipulationWizard\getFluidTemplateObject(), BackendController\getFluidTemplateObject(), ResourceStorage\getFolder(), ImageInfo\getGraphicalFunctions(), LocalImageProcessor\getGraphicalFunctionsObject(), PreviewProcessing\getGraphicalFunctionsObject(), ExtDirectServer\getGridDataService(), PageLayoutController\getHeaderFlashMessagesForCurrentPid(), LocalImageProcessor\getHelperByTaskName(), SecurityStatus\getHtaccessUploadStatus(), AbstractTreeView\getIcon(), FormEngineUtility\getIconHtml(), DefaultAvatarProvider\getImage(), ResourceFactory\getIndexer(), ExtendedFileUtility\getIndexer(), ResourceStorage\getIndexer(), UserFileInlineLabelService\getInlineLabel(), SecurityStatusReport\getInstallToolPasswordStatus(), SecurityStatusReport\getInstallToolProtectionStatus(), BackendUtilityHook\getInstance(), OnlineMediaHelperRegistry\getInstance(), ResourceFactory\getInstance(), ExtractorRegistry\getInstance(), RendererRegistry\getInstance(), TextExtractorRegistry\getInstance(), CategoryRegistry\getInstance(), FileIndexRepository\getInstance(), GridDataService\getIntegrityService(), DataHandler\getLocalTCE(), ProductionExceptionHandler\getLogger(), ProcessedFileRepository\getLogger(), AbstractViewHelper\getLogger(), FileCollector\getLogger(), UserSetupHook\getLoginScripts(), ConfigurationStatus\getMemcachedConnectionStatus(), MenuContentObjectFactory\getMenuObjectByType(), FileDeletionAspect\getMetaDataRepository(), File\getMetaDataRepository(), BackendModuleRepository\getModuleIcon(), ImportExport\getNewTCE(), AdditionalResourceService\getObjectManager(), Mailer\getObjectManager(), FormUtility\getObjectManager(), ExtDirectServer\getObjectManager(), LinkAnalyzer\getObjectManager(), DatabaseTreeDataProvider\getObjectManager(), GridDataService\getObjectManager(), WorkspaceService\getObjectManager(), ResourceStorage\getObjectManager(), Typo3Status\getOldXclassUsageStatus(), OnlineMediaHelperRegistry\getOnlineMediaHelper(), UsernamePasswordProviderSlot\getPageRenderer(), BackendControllerHook\getPageRenderer(), AbstractContentObject\getPageRenderer(), LoginFramesetController\getPageRenderer(), LiveSearchToolbarItem\getPageRenderer(), FileEditHook\getPageRenderer(), ElementBrowserFramesetController\getPageRenderer(), AbstractController\getPageRenderer(), WorkspaceSelectorToolbarItem\getPageRenderer(), ClearCacheToolbarItem\getPageRenderer(), OpendocsToolbarItem\getPageRenderer(), AbstractFunctionModule\getPageRenderer(), FormResultCompiler\getPageRenderer(), BaseScriptClass\getPageRenderer(), T3editor\getPageRenderer(), SystemInformationToolbarItem\getPageRenderer(), ColorpickerController\getPageRenderer(), RecordList\getPageRenderer(), ShortcutToolbarItem\getPageRenderer(), PageGenerator\getPageRenderer(), PageLayoutController\getPageRenderer(), BackendUtility\getPagesTSconfig(), TypoScriptFrontendController\getPagesTSconfig(), LanguageStore\getParserInstance(), FileDeletionAspect\getProcessedFileRepository(), ResourceFactory\getProcessedFileRepository(), ResourceStorage\getProcessingFolder(), PreviewProcessing\getProcessor(), BackendModuleRepository\getRawModuleMenuData(), LiveSearch\getRecordArray(), PagePositionMap\getRecordHeader(), MetaInformation\getRecordInformation(), StagesService\getRecordService(), PermissionController\getRecursiveSelectOptions(), ConfigurationStatus\getReferenceIndexStatus(), Typo3Status\getRegisteredXclassStatus(), ReferenceIndex\getRelations(), ReferenceIndex\getRelations_procDB(), ReferenceIndex\getRelations_procFiles(), InstallStatusReport\getRemainingUpdatesStatus(), WizardController\getRepository(), FileCollector\getResourceFactory(), AbstractTreeView\getRootIcon(), PageRepository\getRootLine(), UserSetupHook\getRsaEncryptionDecoder(), RsaAuthService\getRsaEncryptionDecoder(), ImportExportUtility\getSignalSlotDispatcher(), ExtensionManagementUtility\getSignalSlotDispatcher(), FileProcessingService\getSignalSlotDispatcher(), EditDocumentController\getSignalSlotDispatcher(), SystemInformationToolbarItem\getSignalSlotDispatcher(), ExtensionManagementService\getSignalSlotDispatcher(), IconFactory\getSignalSlotDispatcher(), SoftReferenceIndex\getSignalSlotDispatcher(), IconUtility\getSpriteIconForFile(), IconUtility\getSpriteIconForRecord(), IconUtility\getSpriteIconForResource(), ActionHandler\getStageService(), AbstractRecord\getStagesService(), ExtDirectServer\getStagesService(), HtmlParser\getSubpart(), TypoScriptFrontendControllerTest\getSysDomainCacheReturnsCurrentDomainRecord(), TypoScriptFrontendControllerTest\getSysDomainCacheReturnsForcedDomainRecord(), ExtDirectServer\getSystemLanguages(), FileEditHook\getT3editor(), ActionTask\getTask(), DatabaseBrowser\getTemporaryTreeMountCancelNotice(), PageLinkHandler\getTemporaryTreeMountCancelNotice(), AbstractRecordList\getTranslateTools(), SecurityStatus\getTrustedHostsPatternStatus(), EidUtility\getTSFE(), SoftReferenceIndex\getTypoLinkParts(), ClickEnlargeViewHelper\getTypoScriptService(), CrawlerHook\getUidRootLineForClosestTemplate(), UpgradeWizard\getUpdateObjectInstance(), FrontendUserAuthentication\getUserTSconf(), DocumentTemplate\getVersionSelector(), BackendUtilityHook\getWorkspaceService(), PagetreeCollectionsProcessor\getWorkspaceService(), RequestHandler\handleRequest(), CliRequestHandler\handleRequest(), ContentObjectRenderer\HTMLparser_TSbridge(), ModulesController\indexAction(), TaskModuleController\indexAction(), CrawlerHook\indexExtUrl(), CrawlerHook\indexSingleRecord(), ModuleController\init(), ConfigurationView\init(), ParseHtmlController\init(), ElementHistoryController\init(), DatabaseIntegrityView\init(), EditFileController\init(), FileSystemNavigationFrameController\init(), FileController\init(), PageTreeNavigationController\init(), SchedulerModuleController\init(), ElementInformationController\init(), SimpleDataHandlerController\init(), BrowseLinksController\init(), ColorpickerController\init(), NewContentElementController\init(), PageRepository\init(), RecordList\init(), GraphicalFunctions\init(), SetupModuleController\init(), PageLayoutController\init(), Indexer\init(), EditDocumentController\init(), TypoScriptFrontendController\initCaches(), FileController\initClipboard(), SimpleDataHandlerController\initClipboard(), LinkBrowserController\initCurrentUrl(), LinkBrowserController\initDocumentTemplate(), BrowseLinksController\initDocumentTemplate(), AbstractLinkBrowserController\initDocumentTemplate(), TypoScriptFrontendController\initFEuser(), AbstractLinkBrowserController\initHookObjects(), LocalizationFactory\initialize(), AdminPanelView\initialize(), AbstractLinkHandler\initialize(), FileBrowser\initialize(), SearchController\initialize(), IndexSearchRepository\initialize(), DatabaseConnection\initialize(), LinkValidatorReport\initialize(), TypoScriptTemplateConstantEditorModuleFunctionController\initialize_editor(), TemplateAnalyzerModuleFunctionController\initialize_editor(), TypoScriptTemplateObjectBrowserModuleFunctionController\initialize_editor(), PreviewController\initializeAction(), AbstractController\initializeAction(), ViewModuleController\initializeAction(), AdministrationController\initializeAction(), FrontendBackendUserAuthentication\initializeAdminPanel(), Bootstrap\initializeBackendTemplate(), LocalizationFactory\initializeCache(), PageLayoutView\initializeClipboard(), RequestHandler\initializeController(), Bootstrap\initializeErrorHandling(), RootlineUtility\initializeObject(), RequestHandler\initializeOutputCompression(), PreviewHook\initializePreviewUser(), FluidTemplateContentObject\initializeStandaloneViewInstance(), FrontendEditingController\initializeTceMain(), BackendController\initializeToolbarItems(), DatabaseTreeDataProvider\initializeTreeData(), GridDataService\initializeWorkspacesCachingFramework(), EidUtility\initLanguage(), DocumentTemplate\initPageRenderer(), TypoScriptFrontendController\initPageRenderer(), TypoScriptFrontendController\initTemplate(), AbstractTemplateView\injectTemplateCompiler(), NodeFactory\instantiate(), ResourceStorage\isOnline(), LiveSearchController\liveSearchAction(), UriBuilder\loadBackendRoutes(), ValidatorTask\loadModTsConfig(), SortPagesWizardModuleFunction\main(), PageInformationController\main(), CreatePagesWizardModuleFunctionController\main(), TranslationStatusController\main(), InfoPageTyposcriptConfigController\main(), InfoModuleController\main(), ClickMenuController\main(), ElementHistoryController\main(), TemplateAnalyzerModuleFunctionController\main(), PageFunctionsController\main(), TypoScriptTemplateConstantEditorModuleFunctionController\main(), MoveElementController\main(), ImportExportController\main(), LinkValidatorReport\main(), VersionModuleController\main(), TypoScriptTemplateInformationModuleFunctionController\main(), PageTreeNavigationController\main(), NewContentElementController\main(), TypoScriptTemplateObjectBrowserModuleFunctionController\main(), SetupModuleController\main(), PageLayoutController\main(), VersionsCommand\main_autoFix(), ParseHtmlController\main_parse_html(), SelectImage\main_rte(), UserElementsController\main_user(), OnlineMediaController\mainAction(), FramesetRenderer\make(), ButtonBar\makeButton(), ButtonBar\makeFullyRenderedButton(), GraphicalMenuContentObject\makeGifs(), ButtonBar\makeHelpButton(), ButtonBar\makeInputButton(), ButtonBar\makeLinkButton(), MenuRegistry\makeMenu(), Menu\makeMenuItem(), ButtonBar\makeShortcutButton(), ButtonBar\makeSplitButton(), ResourceStorage\markAsTemporaryOffline(), SearchController\markupSWpartsOfString(), AbstractUpdate\markWizardAsDone(), ContentObjectRenderer\mergeTSRef(), TcaFlexPrepare\migrateFlexformTcaRecursive(), TypoScriptFrontendController\newCObj(), TypoScriptFrontendController\pageErrorHandler(), ContentObjectRenderer\parseFunc(), RecordHistory\performRollback(), ProcessedFileChecksumUpdate\performUpdate(), AbstractPlugin\pi_getEditPanel(), DatabaseConnection\prepare_SELECTquery(), AbstractContainer\previewFieldValue(), ContentDataProcessor\process(), DecryptionHook\processDatamap_preProcessFieldArray(), ClickMenu\processingByExtClassArray(), SpellCheckingController\processRequest(), QueryView\procesStoreControl(), ExtendedFileUtility\pushErrorMessagesToFlashMessageQueue(), QueryView\queryMaker(), InstallUtility\reloadOpcache(), TemplateContentObject\render(), RsaInputElement\render(), FlexFormContainerContainer\render(), UsernamePasswordLoginProvider\render(), RemoveExtensionViewHelper\render(), OuterWrapContainer\render(), ConfigureExtensionViewHelper\render(), TextElement\render(), Avatar\render(), UrlLinkHandler\render(), MailLinkHandler\render(), AbstractStandaloneMessage\render(), PageRenderer\render(), ActionTask\renderActionList(), AjaxRequestHandler\renderAsJavascript(), InlineRecordContainer\renderCombinationChild(), SingleFieldContainer\renderDefaultLanguageDiff(), RecordHistory\renderDiff(), TaskModuleController\renderModuleContent(), PageRenderer\renderPageWithUncachedObjects(), TranslateViewHelperTest\renderReturnsDefaultIfNoTranslationIsFound(), TranslateViewHelperTest\renderReturnsStringForGivenId(), TranslateViewHelperTest\renderReturnsStringForGivenKey(), ErrorIconViewHelper\renderStatic(), SwitchUserViewHelper\renderStatic(), TypolinkViewHelper\renderStatic(), ShortcutViewHelper\renderStatic(), IconViewHelper\renderStatic(), HtmlViewHelper\renderStatic(), CaseViewHelper\renderStatic(), AbstractContainer\renderTabMenu(), TranslateViewHelperTest\renderThrowsExceptionIfNoKeyOrIdParameterIsGiven(), SetupModuleController\renderUserSetup(), ValueSliderWizard\renderWizard(), ResourceStorage\replaceFile(), ContentObjectRenderer\resolveMixedLinkParameter(), TranslateViewHelperTest\resultIsNotHtmlEscapedIfSoRequested(), ExtDirectRouter\routeAction(), ExtDirectEidController\routeAction(), AdministrationRepository\saveKeywords(), ActionTask\saveNewBackendUser(), SuggestWizard\searchAction(), MboxTransport\send(), ActionHandler\sendPageToNextStage(), ActionHandler\sendPageToPreviousStage(), FileBackend\set(), SimpleFileBackend\set(), ImportExport\setFlexFormRelations(), Icon\setSize(), TimeTracker\setTSlogMessage(), SoftReferenceIndex\setTypoLinkPartsElement(), SqlParserTest\setUp(), ExtensionCompatibilityTesterTest\setUp(), ConditionMatcherTest\setUp(), AbstractExportTestCase\setUp(), HtmlViewHelper\simulateFrontendEnvironment(), CropViewHelper\simulateFrontendEnvironment(), SetupModuleController\simulateUser(), ReviewController\singleIndexAction(), PackageManager\sortAndSavePackageStates(), AbstractMenuContentObject\start(), ContentObjectRenderer\stdWrap_offsetWrap(), PageRepository\storeHash(), HtmlParser\substituteMarker(), HtmlParser\substituteMarkerAndSubpartArrayRecursive(), HtmlParser\substituteMarkerArray(), HtmlParser\substituteSubpart(), HtmlParser\substituteSubpartArray(), SwitchBackUserHook\switchBack(), DeletedRecordsController\transform(), DataHandler\transformRichtextContentToDatabase(), RteHtmlParser\TS_links_rte(), DeletedRecords\undeleteData(), LanguageRepository\updateSelectedLanguages(), ActionHandler\updateStageChangeButtons(), Avatar\validateSortAndInitiateAvatarProviders(), VersionModuleController\versioningMgm(), ActionTask\viewEditRecord(), ActionTask\viewNewBackendUser(), ActionTask\viewRecordList(), ActionTask\viewSqlQuery(), NewContentElementController\wizard_appendWizards(), ElementBrowserPageTreeView\wrapTitle(), and ConfigurationManager\writeLocalConfiguration().
|
static |
Find the best service and check if it works. Returns object of the service class.
string | $serviceType | Type of service (service key). |
string | $serviceSubType | Sub type like file extensions or similar. Defined by the service. |
mixed | $excludeServiceKeys | List of service keys which should be excluded in the search for a service. Array or comma list. |
Definition at line 4753 of file GeneralUtility.php.
References $GLOBALS, GeneralUtility\array_merge(), ExtensionManagementUtility\deactivateService(), ExtensionManagementUtility\findService(), and DebugUtility\viewArray().
Referenced by AbstractUserAuthentication\checkAuthentication(), FrontendUserAuthentication\fetchGroupData(), and AbstractUserAuthentication\processLoginData().
|
static |
Create a shortened "redirect" URL with specified length from an incoming URL
string | $inUrl | Input URL |
int | $l | URL string length limit |
string | $index_script_url | URL of "index script" - the prefix of the "?RDCT=..." parameter. If not supplied it will default to ::getIndpEnv('TYPO3_REQUEST_DIR').'index.php' |
Definition at line 4992 of file GeneralUtility.php.
References $GLOBALS.
Referenced by GeneralUtility\substUrlsInPlainText().
|
static |
Makes a positive integer hash out of the first 7 chars from the md5 hash of the input
string | $str | String to md5-hash |
Definition at line 765 of file GeneralUtility.php.
Referenced by CrawlerHook\crawler_init(), FolderTreeView\generateExpandCollapseParameter(), TemplateService\getCurrentPageData(), FolderTreeView\getShortHashNumberForStorage(), and AbstractUserAuthentication\hashLockClause_getHashInt().
|
static |
Gets the unixtime as milliseconds.
Definition at line 3711 of file GeneralUtility.php.
Referenced by TestSetup\combineImages(), SearchFormController\doSearch(), DatabaseConnection\exec_DELETEquery(), DatabaseConnection\exec_INSERTquery(), DatabaseConnection\exec_SELECTquery(), DatabaseConnection\exec_TRUNCATEquery(), DatabaseConnection\exec_UPDATEquery(), CleanerCommand\genTree(), CleanerCommand\genTree_traverse(), Indexer\indexRegularDocument(), Indexer\indexTypo3PageContent(), SystemEnvironmentBuilder\initializeGlobalTimeTrackingVariables(), DocumentTemplate\parseTime(), DatabaseConnection\prepare_SELECTquery(), TestSetup\scaleImages(), and SearchController\searchAction().
|
static |
Minifies JavaScript
string | $script | Script to minify |
string | $error | Error message (if any) |
Definition at line 2393 of file GeneralUtility.php.
References $GLOBALS.
Referenced by AdminPanelView\display(), PageRenderer\doCompressJavaScript(), and RteHtmlAreaApi\writeTemporaryFile().
|
static |
Wrapper function for mkdir. Sets folder permissions according to $GLOBALS['TYPO3_CONF_VARS']['SYS']['folderCreateMask'] and group ownership according to $GLOBALS['TYPO3_CONF_VARS']['SYS']['createGroup']
string | $newFolder | Absolute path to folder, see PHP mkdir() function. Removes trailing slash internally. |
Definition at line 2817 of file GeneralUtility.php.
References $GLOBALS.
Referenced by FileLockStrategy\__construct(), SemaphoreLockStrategy\__construct(), SimpleLockStrategy\__construct(), ResourceCompressor\__construct(), ActionTask\action_createDir(), FileHandlingUtility\addDirectory(), ImportExport\checkOrCreateDir(), ExtensionManagementService\copyDependencies(), UploadExtensionFileController\copyExtensionFolderToTempFolder(), GeneralUtility\createDirectoryPath(), LocalDriver\createFolder(), Locker\createPathIfNeeded(), GraphicalFunctions\createTempSubDir(), FileHandlingUtility\createZipFileFromExtension(), InstallStatusReport\getFileSystemStatus(), AbstractOnlineMediaHelper\getTempFolderPath(), ImportExport\getTemporaryFolderName(), InstallUtility\importInitialFiles(), IconUtility\makeIcon(), ImportExport\processSoftReferences_saveFile_createRelFile(), GraphicalFunctions\readPngGif(), and UploadExtensionFileController\removeExtensionAndRestoreFromBackup().
|
static |
Creates a directory - including parent directories if necessary and sets permissions on newly created directories.
string | $directory | Target directory to create. Must a have trailing slash |
string | $deepDirectory | Directory to create. This second parameter |
\InvalidArgumentException | If $directory or $deepDirectory are not strings |
\RuntimeException | If directory could not be created |
Definition at line 2836 of file GeneralUtility.php.
Referenced by LocalDriver\createFolder(), FileWriter\createLogFile(), FileHandlingUtility\createNestedDirectory(), ClassLoadingInformation\ensureAutoloadInfoDirExists(), SessionService\ensureSessionSavePathExists(), CoreUpdateService\setDownloadTargetPath(), DocumentationService\unzipDocumentPackage(), FileHandlingUtility\unzipExtensionFromFile(), TerService\unzipTranslationFile(), and TerService\updateTranslation().
|
static |
Modifies a HTML Hex color by adding/subtracting $R,$G and $B integers
string | $color | A hexadecimal color code, #xxxxxx |
int | $R | Offset value 0-255 |
int | $G | Offset value 0-255 |
int | $B | Offset value 0-255 |
Definition at line 895 of file GeneralUtility.php.
References MathUtility\forceIntegerInRange().
|
static |
Modifies a HTML Hex color by adding/subtracting $all integer from all R/G/B channels
string | $color | A hexadecimal color code, #xxxxxx |
int | $all | Offset value 0-255 for all three channels. |
Definition at line 914 of file GeneralUtility.php.
|
static |
Sorts an array by key recursive - uses natural sort order (aAbB-zZ)
array | $array | array to be sorted recursively, passed by reference |
Definition at line 1832 of file GeneralUtility.php.
References ArrayUtility\naturalKeySortRecursive().
|
static |
Normalize an IPv6 address to full length
string | $address | Given IPv6 address |
Definition at line 494 of file GeneralUtility.php.
References GeneralUtility\strtolower().
|
static |
Changes from/to arguments for mail() function to work in any environment.
string | $address | Address to adjust |
Definition at line 1133 of file GeneralUtility.php.
|
static |
Converts a png file to gif. This converts a png file to gif IF the FLAG $GLOBALS['TYPO3_CONF_VARS']['FE']['png_to_gif'] is set TRUE.
string | $theFile | The filename with path |
Definition at line 289 of file GeneralUtility.php.
References GraphicalFunctions\pngToGifByImagemagick().
|
static |
Set the ApplicationContext
This function is used by the Bootstrap to hand over the application context. It must not be used anywhere else, because the context shall never be changed on runtime!
\TYPO3\CMS\Core\Core\ApplicationContext | $applicationContext |
\RuntimeException | if applicationContext is overriden |
Definition at line 5385 of file GeneralUtility.php.
References GeneralUtility\$applicationContext.
Referenced by Bootstrap\baseSetup().
|
static |
Purge all instances returned by makeInstance.
This function is most useful when called from tearDown in a test case to drop any instances that have been created by the tests.
Warning: This is a helper method for unit tests. Do not call this directly in production code!
Definition at line 4724 of file GeneralUtility.php.
Referenced by TcaCheckboxItemsTest\tearDown(), TcaRadioItemsTest\tearDown(), TcaSelectItemsTest\tearDown(), TcaSelectTreeItemsTest\tearDown(), DatabaseSystemLanguageRowsTest\tearDown(), TcaFlexFetchTest\tearDown(), and StandaloneViewTest\tearDown().
|
static |
Implementation of quoted-printable encode. See RFC 1521, section 5.1 Quoted-Printable Content-Transfer-Encoding
string | $string | Content to encode |
int | $maxlen | Length of the lines, default is 76 |
Definition at line 4836 of file GeneralUtility.php.
|
static |
Quotes a string for usage as JS parameter.
string | $value | the string to encode, may be empty |
Definition at line 5318 of file GeneralUtility.php.
Referenced by BackendController\__construct(), SetupModuleController\addAvatarButtonJs(), UserElements\buildJavascriptConfiguration(), Typo3HtmlParser\buildJavascriptConfiguration(), Typo3Link\buildJavascriptConfiguration(), Typo3Image\buildJavascriptConfiguration(), Typo3Link\buildJSClassesAnchorArray(), SelectImage\buildMenuArray(), SearchFormController\compileResult(), SearchController\compileResultRows(), ClickMenu\DB_changeFlag(), ClickMenu\DB_copycut(), ClickMenu\DB_db_list(), ClickMenu\DB_delete(), ClickMenu\DB_edit(), ClickMenu\DB_info(), ClickMenu\DB_new(), ClickMenu\DB_paste(), DebugUtility\debug(), DebugUtility\debugInPopUpWindow(), RecordHistory\displaySettings(), ClickMenu\dragDrop_copymovefolder(), ClickMenu\dragDrop_copymovepage(), FrontendEditPanel\editPanelLinkWrap(), RsaEncryptionEncoder\enableRsaEncryption(), ConfigurationForm\ext_getForm(), ClickMenu\FILE_copycut(), ClickMenu\FILE_delete(), ClickMenu\FILE_launch(), ClickMenu\FILE_paste(), JavaScriptMenuContentObject\generate_level(), SelectTreeElement\generateJavascript(), DatabaseRecordList\getButtons(), PageTreeNavigationController\getButtons(), EditFileController\getButtons(), RteController\getButtons(), TaskModuleController\getButtons(), EditDocumentController\getButtons(), SchedulerModuleController\getButtons(), DatabaseRecordList\getDocHeaderButtons(), AdminPanelView\getEditModule(), SelectImage\getJSCode(), InlineControlContainer\getLevelInteractionLink(), ContentObjectRenderer\getMailTo(), ModuleMenuView\getModuleData(), BrowseLinksController\getPageConfigLabel(), ModuleMenuView\getRawModuleData(), BackendModuleRepository\getRawModuleMenuData(), TableController\getTableHTML(), BackendController\handlePageEditing(), SelectImage\imageInsertJsStatement(), ContentObjectRenderer\imageLinkWrap(), UserElementsController\init(), CreateFolderController\init(), EditDocumentController\init(), SelectImage\initDocumentTemplate(), ShortcutToolbarItem\initShortcuts(), SelectImage\insertImages(), FormResultCompiler\JSbottom(), PageLayoutView\languageSelector(), AbstractMenuContentObject\link(), ElementBrowserFramesetController\main(), MoveElementController\main(), NewContentElementController\main(), PageLayoutController\main(), SelectImage\main_rte(), UserElementsController\main_user(), PageLayoutController\makeButtons(), PageBrowsingViewHelper\makecurrentPageSelector_link(), ModuleTemplate\makeShortcutIcon(), DocumentTemplate\makeShortcutIcon(), PageLayoutView\newContentElementOnClick(), PagePositionMap\onClickEvent(), ContentLayoutPagePositionMap\onClickInsertRecord(), PagePositionMap\onClickInsertRecord(), TaskModuleController\openInNewWindow(), EditDocumentController\openInNewWindowLink(), AbstractPlugin\pi_openAtagHrefInJSwindow(), ElementBrowserFolderTreeView\PM_ATagWrap(), ElementBrowserPageTreeView\PM_ATagWrap(), FolderTreeView\PMiconATagWrap(), PageTreeView\PMiconATagWrap(), Clipboard\printClipboard(), Clipboard\printContentFromTab(), ClickMenu\printDBClickMenu(), ElementBrowserPageTreeView\printTree(), DocumentTemplate\redirectUrls(), ModuleTemplate\redirectUrls(), RsaInputElement\render(), SelectCheckBoxElement\render(), T3editorElement\render(), TypoScriptConstantsViewHelper\renderColorPicker(), TranslationStatusController\renderL10nTable(), DatabaseRecordList\renderListHeader(), DatabaseRecordList\renderListRow(), OpendocsToolbarItem\renderMenuEntry(), InlineControlContainer\renderPossibleRecordsSelectorTypeGroupDB(), InlineControlContainer\renderPossibleRecordsSelectorTypeSelect(), SelectSingleBoxElement\renderResetButtonElement(), BackendController\setStartupModule(), SetupModuleController\simulateUser(), ContentObjectRenderer\stdWrap_encodeForJavaScriptValue(), PageLayoutView\tt_content_drawHeader(), ClickMenu\urlRefForCM(), BackendUtilityTest\viewOnClickReturnsOnClickCodeWithAlternativeUrl(), ActionTask\viewRecordList(), ContentLayoutPagePositionMap\wrapColumnHeader(), FolderTreeView\wrapIcon(), ContentLayoutPagePositionMap\wrapRecordTitle(), ElementBrowserPageTreeView\wrapTitle(), ElementBrowserFolderTreeView\wrapTitle(), PageTreeView\wrapTitle(), FolderTreeView\wrapTitle(), AbstractTreeView\wrapTitle(), JavaScriptMenuContentObject\writeMenu(), and GraphicalMenuContentObject\writeMenu().
|
static |
rawurlencode which preserves "/" chars Useful when file paths should keep the "/" chars, but have all other special chars encoded.
string | $str | Input string |
Definition at line 1065 of file GeneralUtility.php.
Referenced by ContentObjectRenderer\cImage().
|
static |
Version of rawurlencode() where all spaces (%20) are re-converted to space-characters. Useful when passing text to JavaScript where you simply url-encode it to get around problems with syntax-errors, linebreaks etc.
string | $str | String to raw-url-encode with spaces preserved |
Definition at line 1053 of file GeneralUtility.php.
|
static |
Returns filename of the png/gif version of the input file (which can be png or gif). If input file type does not match the wanted output type a conversion is made and temp-filename returned.
string | $theFile | Filepath of image file |
bool | $output_png | If set, then input file is converted to PNG, otherwise to GIF |
Definition at line 305 of file GeneralUtility.php.
References GraphicalFunctions\readPngGif().
|
static |
Rename Array keys with a given mapping table
array | $array | Array by reference which should be remapped |
array | $mappingTable | Array with remap information, array/$oldKey => $newKey) |
Definition at line 1751 of file GeneralUtility.php.
References ArrayUtility\remapArrayKeys().
|
static |
Removes the value $cmpValue from the $array if found there. Returns the modified array
array | $array | Array containing the values |
string | $cmpValue | Value to search for and if found remove array entry where found. |
Definition at line 1567 of file GeneralUtility.php.
References ArrayUtility\removeArrayEntryByValue().
|
static |
Removes dots "." from end of a key identifier of TypoScript styled array. array('key.' => array('property.' => 'value')) –> array('key' => array('property' => 'value'))
array | $ts | TypoScript configuration array |
Definition at line 1811 of file GeneralUtility.php.
Referenced by BackendUserAuthentication\backendSetUC(), ContextMenu\buildNestedJSArray(), TypoScriptFrontendController\getConfigArray(), and FormEngineUtility\overrideFieldConf().
|
static |
Removes the absolute part of all files/folders in fileArr
array | $fileArr | The file array to remove the prefix from |
string | $prefixToRemove | The prefix path to remove (if found as first part of string!) |
Definition at line 3080 of file GeneralUtility.php.
Referenced by AbstractItemProvider\addItemsFromFolder(), CrawlerHook\crawler_execute_type2(), and FileHandlingUtility\createZipFileFromExtension().
|
static |
Removes the instance of a singleton class to be returned by makeInstance.
Warning: This is NOT a public API method and must not be used in own extensions! This methods exists mostly for unit tests to inject a mock of a singleton class. If you use this, make sure to always combine this with getSingletonInstances() and resetSingletonInstances() in setUp() and tearDown() of the test class.
\InvalidArgumentException |
string | $className | |
\TYPO3\CMS\Core\SingletonInterface | $instance |
Definition at line 4616 of file GeneralUtility.php.
|
static |
Wrapper for the RemoveXSS function. Removes potential XSS code from an input string.
Using an external class by Travis Puderbaugh kalla har@ quick wire d.com
string | $string | Input string |
Definition at line 245 of file GeneralUtility.php.
Referenced by RemoveXssFilter\filter(), LiveSearch\setQueryString(), and FrontendLoginController\validateRedirectUrl().
|
static |
Requires a class for TYPO3 Useful to require classes from inside other classes (not global scope). A limited set of global variables are available (see function)
string | $requireFile,: | Path of the file to be included |
Definition at line 4820 of file GeneralUtility.php.
|
static |
Require a class for TYPO3 Useful to require classes from inside other classes (not global scope). A limited set of global variables are available (see function)
string | $requireFile,: | Path of the file to be included |
Definition at line 4805 of file GeneralUtility.php.
Referenced by Indexer\includeCrawlerClass().
|
static |
Set a group of singleton instances. Similar to setSingletonInstance(), but multiple instances can be set.
Warning: This is NOT a public API method and must not be used in own extensions! This method is usually only used in tests to restore the list of singletons in tearDown(), that was backed up with getSingletonInstances() in setUp() and manipulated in tests with setSingletonInstance()
Definition at line 4642 of file GeneralUtility.php.
Referenced by TcaCheckboxItemsTest\tearDown(), TcaRadioItemsTest\tearDown(), TcaSelectItemsTest\tearDown(), TcaSelectTreeItemsTest\tearDown(), DatabaseSystemLanguageRowsTest\tearDown(), TcaFlexFetchTest\tearDown(), FluidTemplateContentObjectTest\tearDown(), ContentObjectRendererTest\tearDown(), and StandaloneViewTest\tearDown().
|
static |
Resolves ALL sheet definitions in dataStructArray If no sheet is found, then the default "sDEF" will be created with the dataStructure inside.
array | $dataStructArray | Input data structure, possibly with a sheet-definition and references to external data source files. |
Definition at line 4249 of file GeneralUtility.php.
Referenced by AbstractItemProvider\getRegisteredFlexForms(), BackendUtility\getRegisteredFlexForms(), and SuggestWizard\overrideFieldNameAndConfigurationForFlexform().
|
static |
Resolves "../" sections in the input path string. For example "fileadmin/directory/../other_directory/" will be resolved to "fileadmin/other_directory/"
string | $pathStr | File path in which "/../" is resolved |
Definition at line 3111 of file GeneralUtility.php.
Referenced by BackendController\addJavascriptFile(), DocumentTemplate\addStyleSheetDirectory(), SimpleSpriteHandler\buildCssAndRegisterIcons(), Typo3Link\buildJSClassesAnchorArray(), ModuleLoader\checkMod(), AbstractSpriteHandler\collectTcaSpriteIcons(), ResourceCompressor\compressCssFile(), ResourceCompressor\compressJsFile(), ResourceCompressor\createMergedFile(), ImportExport\export_addFile(), SpriteBuildingHandler\generate(), FileHandlingUtility\getAbsolutePath(), PathUtility\getAbsoluteWebPath(), ConfigurationStatus\getDeprecationLogFileLink(), ResourceCompressor\getFilenameFromMainDir(), RteHtmlAreaApi\getFullFileName(), DocumentTemplate\getHtmlTemplate(), FormEngineUtility\getIconHtml(), ModuleMenuView\getRawModuleData(), BackendModuleRepository\getRawModuleMenuData(), ModuleLoader\getRelativePath(), CrawlerHook\indexExtUrl(), Indexer\isAllowedLocalFile(), NewContentElementController\main(), IconUtility\mapFileExtensionToSpriteIconName(), GraphicalFunctions\prependAbsolutePath(), ImportExport\processSoftReferences_saveFile_createRelFile(), IconRegistry\registerTCAIcons(), LogoView\render(), BackendController\render(), CssStyledContentController\render_uploads(), PageRenderer\renderAdditionalJavaScriptLibraries(), PageRenderer\renderCssFiles(), PageRenderer\renderCssLibraries(), PageRenderer\renderJavaScriptFiles(), SpriteGenerator\resolveSpritePath(), and RteHtmlAreaApi\writeTemporaryFile().
|
static |
Looks for a sheet-definition in the input data structure array. If found it will return the data structure for the sheet given as $sheet (if found). If the sheet definition is in an external file that file is parsed and the data structure inside of that is returned.
array | $dataStructArray | Input data structure, possibly with a sheet-definition and references to external data source files. |
string | $sheet | The sheet to return, preferably. |
Definition at line 4211 of file GeneralUtility.php.
Referenced by DataHandler\checkValue_flex_procInData(), and FlexFormTools\traverseFlexFormXMLData().
|
static |
Reverse explode which explodes the string counting from behind.
Note: The delimiter has to given in the reverse order as it is occurring within the string.
GeneralUtility::revExplode('[]', '[my][words][here]', 2) ==> array('[my][words', 'here]')
string | $delimiter | Delimiter string to explode with |
string | $string | The string to explode |
int | $count | Number of array entries |
Definition at line 1506 of file GeneralUtility.php.
References elseif.
Referenced by ContentObjectRenderer\encaps_lineSplit(), FolderTreeView\evaluateExpandCollapseParameter(), IndexSearchRepository\freeIndexUidWhere(), SearchFormController\freeIndexUidWhere(), DataHandlerHook\getEmailsForStageChangeNotification(), and SilentConfigurationUpgradeService\transferDeprecatedCurlSettings().
|
static |
Wrapper function for rmdir, allowing recursive deletion of folders and files
string | $path | Absolute path to folder, see PHP rmdir() function. Removes trailing slash internally. |
bool | $removeNonEmpty | Allow deletion of non-empty directories |
Definition at line 2892 of file GeneralUtility.php.
References elseif.
Referenced by LocalDriver\deleteFolder(), PackageManager\deletePackage(), UploadExtensionFileController\removeBackupFolder(), FileHandlingUtility\removeDirectory(), UploadExtensionFileController\removeExtensionAndRestoreFromBackup(), and TerService\updateTranslation().
|
static |
Removes an item from a comma-separated list of items.
If $element contains a comma, the behaviour of this method is undefined. Empty elements in the list are preserved.
string | $element | Element to remove |
string | $list | Comma-separated list of items (string) |
Definition at line 706 of file GeneralUtility.php.
References $list.
Referenced by ParseHtmlController\keepSpanTagsWithId(), and Language\main().
|
static |
Checks if a given string is a valid frame URL to be loaded in the backend.
string | $url | potential URL to check |
Definition at line 3965 of file GeneralUtility.php.
Referenced by LoginController\__construct(), RecordHistory\getArgument(), ElementHistoryController\getButtons(), RteController\getButtons(), PreviewHook\getPreviewConfiguration(), FileUploadController\init(), RenameFileController\init(), ReplaceFileController\init(), MoveElementController\init(), CreateFolderController\init(), EditFileController\init(), AddController\init(), FileController\init(), SimpleDataHandlerController\init(), NewContentElementController\init(), NewRecordController\init(), RecordList\init(), PageLayoutController\init(), EditDocumentController\localizationRedirect(), ListController\main(), OnlineMediaController\mainAction(), EditDocumentController\preInit(), DocumentTemplate\redirectUrls(), ModuleTemplate\redirectUrls(), ElementInformationController\renderBackButton(), and AbstractDatabaseRecordList\start().
|
static |
Sets the instance of a singleton class to be returned by makeInstance.
If this function is called multiple times for the same $className, makeInstance will return the last set instance.
Warning: This is NOT a public API method and must not be used in own extensions! This methods exists mostly for unit tests to inject a mock of a singleton class. If you use this, make sure to always combine this with getSingletonInstances() and resetSingletonInstances() in setUp() and tearDown() of the test class.
string | $className | |
\TYPO3\CMS\Core\SingletonInterface | $instance |
Definition at line 4594 of file GeneralUtility.php.
Referenced by ContentObjectRendererTest\createMockedLoggerAndLogManager(), Bootstrap\initializeCachingFramework(), and StandaloneViewTest\setUp().
|
static |
Returns the first 10 positions of the MD5-hash (changed from 6 to 10 recently)
string | $input | Input string to be md5-hashed |
int | $len | The string-length of the output |
Definition at line 777 of file GeneralUtility.php.
Referenced by Indexer\createLocalPathFromT3vars(), IndexerTest\extractHyperLinksReturnsCorrectFileUsingT3Vars(), LocallangArrayParser\generateCacheFileName(), PreviewController\generateJavascript(), BackendController\generateJavascript(), AbstractTask\getConfigurationChecksum(), ModuleTemplate\getDynamicTabMenu(), DocumentTemplate\getDynamicTabMenu(), DocumentTemplate\getDynTabMenuId(), GraphicalFunctions\imageMagickConvert(), IconUtility\makeIcon(), FlexFormTabsContainer\render(), TabsContainer\render(), JavaScriptMenuContentObject\writeMenu(), ImageMenuContentObject\writeMenu(), and RteHtmlAreaApi\writeTemporaryFile().
|
static |
Either slashes ($cmd=add) or strips ($cmd=strip) array $arr depending on $cmd
array | $arr | Multidimensional input array |
string | $cmd | "add" or "strip", depending on usage you wish. |
Definition at line 1732 of file GeneralUtility.php.
|
static |
This function is used to escape any ' -characters when transferring text to JavaScript!
string | $string | String to escape |
bool | $extended | If set, also backslashes are escaped. |
string | $char | The character to escape, default is ' (single-quote) |
Definition at line 1038 of file GeneralUtility.php.
|
static |
Splits a reference to a file in 5 parts
string | $fileNameWithPath | File name with path to be analysed (must exist if open_basedir is set) |
Definition at line 839 of file GeneralUtility.php.
References GeneralUtility\strtolower().
Referenced by ContentObjectRenderer\filelist(), ExtendedFileUtility\func_unzip(), BasicFileUtility\getUniqueName(), GraphicalFunctions\IMreduceColors(), T3editor\setModeByFile(), and ImportExport\writeFileVerify().
|
static |
Returns an array with the 'components' from an attribute list from an HTML tag. The result is normally analyzed by get_tag_attributes Removes tag-name if found
string | $tag | HTML-tag string (or attributes only) |
Definition at line 1887 of file GeneralUtility.php.
References elseif.
|
static |
This splits a string by the chars in $operators (typical /+-*) and returns an array with them in
string | $string | Input string, eg "123 + 456 / 789 - 4 @param string $operators Operators to split by, typically "/+-* |
Definition at line 1001 of file GeneralUtility.php.
Referenced by ContentObjectRenderer\calc(), and GifBuilder\calculateValue().
|
static |
Standard authentication code (used in Direct Mail, checkJumpUrl and setfixed links computations)
mixed | $uid_or_record | Uid (int) or record (array) |
string | $fields | List of fields from the record if that is given. |
int | $codeLength | Length of returned authentication code. |
Definition at line 4092 of file GeneralUtility.php.
References $GLOBALS.
|
staticprotected |
Strips HTTP headers from the content.
string | $content |
Definition at line 2650 of file GeneralUtility.php.
|
static |
StripSlash array This function traverses a multidimensional array and strips slashes to the values. NOTE that the input array is and argument by reference.!! Twin-function to addSlashesOnArray
array | $theArray | Multidimensional input array, (REFERENCE!) |
Definition at line 1711 of file GeneralUtility.php.
Referenced by DataHandler\fillInFieldArray().
|
static |
Converts string to lowercase The function converts all Latin characters (A-Z, but no accents, etc) to lowercase. It is safe for all supported character sets (incl. utf-8). Unlike strtolower() it does not honour the locale.
string | $str | Input string |
Definition at line 1181 of file GeneralUtility.php.
Referenced by FrontendEditingController\allowedToEdit(), ContextMenu\buildJavascriptConfiguration(), BlockElements\buildJavascriptConfiguration(), Adodb\compileWhereClause(), GeneralUtility\createVersionNumberedFilename(), TerService\fetchTranslation(), TerService\fetchTranslationStatus(), GeneralUtility\flushOutputBuffers(), GeneralUtility\get_tag_attributes(), FrontendEditingController\getAllowedEditActions(), GeneralUtility\getIndpEnv(), GeneralUtility\hostHeaderValueMatchesTrustedHostsPattern(), GeneralUtility\implodeAttributes(), GeneralUtility\normalizeIPv6(), and GeneralUtility\split_fileref().
|
static |
Converts string to uppercase The function converts all Latin characters (a-z, but no accents, etc) to uppercase. It is safe for all supported character sets (incl. utf-8). Unlike strtoupper() it does not honour the locale.
string | $str | Input string |
Definition at line 1167 of file GeneralUtility.php.
Referenced by FrontendLoginController\getUserFieldMarkers(), GeneralUtility\initSysLog(), SearchFormController\makeSearchForm(), and SearchFormController\printResultRow().
|
static |
Takes a clear-text message body for a plain text email, finds all 'http://' links and if they are longer than 76 chars they are converted to a shorter URL with a hash parameter. The real parameter is stored in the database and the hash-parameter/URL will be redirected to the real parameter when the link is clicked. This function is about preserving long links in messages.
string | $message | Message content |
string | $urlmode | URL mode; "76" or "all |
string | $index_script_url | URL of index script (see makeRedirectUrl()) |
Definition at line 4954 of file GeneralUtility.php.
References GeneralUtility\makeRedirectUrl().
|
static |
Create temporary filename (Create file with unique file name) This function should be used for getting temporary file names - will make your applications safe for open_basedir = on REMEMBER to delete the temporary files after use! This is done by ::unlink_tempfile()
string | $filePrefix | Prefix for temporary file |
string | $fileSuffix | Suffix for temporary file, for example a special file extension |
Definition at line 4069 of file GeneralUtility.php.
Referenced by DatabaseConnectionTest\createFakeExtension(), AbstractOnlineMediaHelper\createNewFile(), SpriteGenerator\generateGraphic(), SpriteGenerator\generateHighDensityGraphic(), LocalPreviewHelper\getTemporaryFilePath(), ImportExport\import_addFileNameToBeCopied(), Indexer\indexExternalUrl(), AbstractImportTestCase\isCaseSensitiveFilesystem(), SpellCheckingController\processRequest(), FileContentParser\readFileContent(), SpellCheckingController\spellCheckHandler(), and ImportExport\writeTemporaryFileFromData().
|
static |
Explodes a string and trims all values for whitespace in the end. If $onlyNonEmptyValues is set, then all blank ('') values are removed.
string | $delim | Delimiter string to explode with |
string | $string | The string to explode |
bool | $removeEmptyValues | If set, all empty values will be removed in output |
int | $limit | If limit is set and positive, the returned array will contain a maximum of limit elements with the last element containing the rest of string. If the limit parameter is negative, all components except the last -limit are returned. |
Definition at line 1537 of file GeneralUtility.php.
References elseif.
Referenced by TreelistCacheUpdateHooks\__construct(), SuggestWizardDefaultReceiver\__construct(), TcaColumnsProcessShowitem\addData(), TcaColumnsProcessPlaceholders\addData(), TcaColumnsProcessRecordTitle\addData(), TcaColumnsProcessCommon\addData(), TcaInputPlaceholders\addData(), TcaTypesShowitem\addFieldsBySubtypeAddList(), ExtensionManagementUtility\addFieldsToAllPalettesOfField(), ClickMenu\addMenuItems(), ExtensionManagementUtility\addModule(), ExtensionManagementUtility\addService(), Indexer\addSpacesToKeywordList(), ExtensionManagementUtility\addToAllTCAtypes(), ModuleSettings\addToStoreList(), BackendUserAuthentication\addTScomment(), FrontendEditingController\allowedToEdit(), DefinitionList\applyToolbarConstraints(), DefaultClean\applyToolbarConstraints(), Typo3HtmlParser\applyToolbarConstraints(), Typo3Link\applyToolbarConstraints(), TableOperations\applyToolbarConstraints(), CommandMap\applyWorkspacesSetStageBehaviour(), DataHandler\assemblePermissions(), ConfigurationItemRepository\buildConfigurationArray(), SpriteGenerator\buildFileInformationCache(), ContextMenu\buildJavascriptConfiguration(), Typo3Color\buildJavascriptConfiguration(), BlockElements\buildJavascriptConfiguration(), SelectFont\buildJavascriptConfiguration(), RteHtmlAreaApi\buildJavascriptConfiguration(), InlineElements\buildJavascriptConfiguration(), Abbreviation\buildJSAbbreviationArray(), SelectFont\buildJSFontItemsConfig(), GifBuilder\calcOffset(), TypoScriptFrontendController\calculateLinkVars(), GifBuilder\calculateMaximum(), DataHandler\canDeletePage(), SchedulerModuleController\checkDate(), CrawlerHook\checkDeniedSuburls(), FormInlineAjaxController\checkInlineFileTypeAccessForField(), DataHandler\checkValue_group_select_explodeSelectGroupValue(), DataHandler\checkValueForCheck(), DataHandler\checkValueForGroupSelect(), DataHandler\checkValueForInline(), DataHandler\checkValueForInput(), DataHandler\checkValueForText(), RteHtmlAreaApi\cleanList(), TypoScriptFrontendController\clearPageCacheContent_pidList(), AbstractConditionMatcher\compareNumber(), ExtensionUtility\configurePlugin(), VersionNumberUtility\convertVersionsStringToVersionNumbers(), DataHandler\copyPages(), CrawlerHook\crawler_execute_type2(), OnlineMediaController\createAction(), LocalDriver\createFolder(), PaletteAndSingleContainer\createPaletteContentArray(), ContentObjectRenderer\DBgetInsert(), ContentObjectRenderer\DBgetUpdate(), ContentObjectRenderer\DBmayFEUserEdit(), ContentObjectRenderer\DBmayFEUserEditSelect(), CleanerTask\deleteFilesForTable(), FrontendEditingController\displayEditIcons(), RteHtmlParser\divideIntoLines(), DataHandler\doesPageHaveUnallowedTables(), ClickMenu\enableDisableItems(), ContentObjectRenderer\encaps_lineSplit(), ConditionMatcher\evaluateCondition(), AbstractConditionMatcher\evaluateConditionCommon(), ValidatorTask\execute(), UninstallExtension\executeAction(), ExtensionManagementUtility\executePositionedStringInsertion(), TypoScriptParser\executeValueModifier(), ExtensionManagementUtility\explodeItemList(), CommandMap\explodeSetStage(), AbstractContainer\explodeSingleFieldShowItemConfiguration(), SpriteGenerator\explodeSizeTag(), InlineControlContainer\extractFlexFormParts(), ConfigurationItemRepository\extractInformationForConfigFieldsOfTypeOptions(), InfoPageTyposcriptConfigController\extractLinesFromTSConfig(), LiveSearch\extractSearchableFieldsFromTable(), ContentObjectRenderer\fillInMarkerArray(), FilesContentObject\findAndSortFiles(), FileIndexRepository\findOneByCombinedIdentifier(), ExtensionManagementUtility\findService(), DataHandler\fixCopyAfterDuplFields(), ActionTask\fixDbMount(), DataHandler\fixUniqueInPid(), EditDocumentController\fixWSversioningInEditConf(), IndexSearchRepository\freeIndexUidWhere(), SearchFormController\freeIndexUidWhere(), BackendController\generateJavascript(), AbstractDatabaseRecordList\generateList(), FileHandlingUtility\getAbsolutePathsToConfiguredDirectories(), SearchController\getAllAvailableMediaTypesOptions(), FrontendEditingController\getAllowedEditActions(), BrowseLinksController\getAllowedItems(), AbstractLinkBrowserController\getAllowedItems(), SelectImage\getAllowedItems(), BrowseLinksController\getAllowedLinkAttributes(), AbstractLinkBrowserController\getAllowedLinkAttributes(), TcaInputPlaceholders\getAllowedTableForGroupField(), DatabaseRecordList\getButtons(), BackendUserAuthentication\getCategoryMountPoints(), AbstractFormElement\getClipboardElements(), BackendLayoutView\getColPosListItemsParsed(), CommandUtility\getConfiguredApps(), TypoScriptFrontendController\getCurrentPageCacheConfiguration(), ContentObjectRenderer\getData(), ContextMenuDataProvider\getDisableActions(), DatabaseRecordList\getDocHeaderButtons(), DataHandlerHook\getEmailsForStageChangeNotification(), DataHandler\getExcludeListArray(), ExtensionCompatibilityTester\getExtensionsToExclude(), SetupModuleController\getFieldsFromShowItem(), ContentObjectRenderer\getFieldVal(), SecurityStatus\getFileDenyPatternStatus(), BackendUserAuthentication\getFileMountRecords(), ResourceFactory\getFileObjectFromCombinedIdentifier(), BackendUserAuthentication\getFilePermissions(), ExtDirectServerTest\getFileReferenceProphecies(), TypoScriptFrontendController\getFirstTimeValueForRecord(), BackendUtility\getFlexFormDS(), TcaFlexProcess\getFlexIdentifier(), ResourceFactory\getFolderObjectFromCombinedIdentifier(), UserSettingsController\getFromDottedNotation(), TemplateService\getFromMPmap(), BackendUtility\getGroupNames(), BackendLayoutView\getIdentifiersToBeExcluded(), FormInlineAjaxController\getInlineRelatedRecordsUidArray(), RteHtmlParser\getKeepTags(), Language\getLanguages(), ValidatorTask\getLinkTypes(), SpellCheckingController\getMainDictionaryCharacterSet(), ExtdirectTreeDataProvider\getNodeTypes(), ResourceFactory\getObjectFromCombinedIdentifier(), PageRepository\getPagesOverlay(), BackendUtility\getPagesTSconfig(), FormInlineAjaxController\getParentConfigFromFlexForm(), CommandUtility\getPathsInternal(), DataHandler\getPlaceholderTitleForTableLabel(), TcaInputPlaceholders\getPlaceholderValue(), CharsetConverter\getPreferredClientLanguage(), FrontendLoginController\getPreserveGetVars(), ActionHandler\getRecipientList(), TcaRecordTitle\getRecordTitleByLabelProperties(), TcaRecordTitle\getRecordTitleForGroupType(), AbstractItemProvider\getRegisteredFlexForms(), BackendUtility\getRegisteredFlexForms(), TcaInputPlaceholders\getRelatedGroupFieldUids(), ValidatorTask\getSearchField(), AbstractDatabaseRecordList\getSearchFields(), BackendUtility\getSpecConfParts(), ResourceFactory\getStorageObjectFromCombinedIdentifier(), SuggestWizard\getTablesToQueryFromFieldConfiguration(), BackendUtility\getTCAtypes(), BackendUserAuthentication\getTSConfig(), CreatePagesWizardModuleFunctionController\getTypeSelectHtml(), SoftReferenceIndex\getTypoLinkParts(), DataHandlerHook\getUniqueFields(), Indexer\getUrlHeaders(), ActionTask\getUsergroups(), BackendUtility\getUserNames(), AbstractNode\getValidationDataAsJsonString(), ContentObjectRenderer\includeLibs(), TemplateService\includeStaticTypoScriptSources(), CrawlerHook\indexSingleRecord(), ClickMenu\init(), QueryGenerator\init(), TemplateService\init(), EditDocumentController\init(), CharsetConverter\initCharset(), LanguageStore\initialize(), SearchFormController\initialize(), InlineStackProcessor\initializeByParsingDomObjectIdString(), RootlineUtility\initializeObject(), FileContentParser\initParser(), CommandUtility\initPaths(), CharsetConverter\initUnicodeData(), DataHandler\insertUpdateDB_preprocessBasedOnFieldType(), TypoScriptFrontendController\INTincScript_includeLibs(), SystemEnvironmentBuilder\isFunctionDisabled(), ExtensionManagementUtility\isServiceAvailable(), DataHandler\isTableAllowedForThisPage(), FileAllowedTypesValidator\isValid(), ArrayUtility\keepItemsInArray(), PageLayoutView\languageSelector(), DocumentController\listAction(), DeletedRecords\loadData(), BackendController\loadResourcesForRegisteredNavigationComponents(), Spellchecker\main(), CopyPaste\main(), Abbreviation\main(), ElementHistoryController\main(), CreateFolderController\main(), NewRecordController\main(), SelectImage\main_rte(), OnlineMediaController\mainAction(), LoginController\makeInterfaceSelectorBox(), PageLayoutView\makeOrdinaryList(), AbstractDatabaseRecordList\makeQueryArray(), SearchFormController\makeSearchForm(), TcaMigration\migrateExtAndSysextPathToEXTPath(), TcaMigration\migrateShowItemAdditionalPaletteToOwnPalette(), TcaMigration\migrateSpecialConfigurationAndRemoveShowItemStylePointerConfig(), TcaMigration\migrateT3editorWizardWithEnabledByTypeConfigToColumnsOverrides(), FrontendEditingController\move(), DataHandlerHook\moveRecord_wsPlaceholders(), SelectImage\orderMenuDefinition(), ContentObjectRenderer\parseFunc(), ModuleLoader\parseModulesArray(), RootlineUtility\parseMountPointParameter(), AbstractPlugin\pi_classParam(), AbstractPlugin\pi_getLL(), AbstractPlugin\pi_getPidList(), AbstractPlugin\pi_isOnlyFields(), AbstractPlugin\pi_prependFieldsWithTable(), DataHandler\placeholderShadowing(), SuggestWizardDefaultReceiver\prepareSelectStatement(), AbstractContainer\previewFieldValue(), PagePositionMap\printContentElementColumns(), TimeTracker\printTSlog(), SplitProcessor\process(), DataHandlerHook\processCmdmap(), AbstractItemProvider\processDatabaseFieldValue(), AbstractItemProvider\processForeignTableClause(), ContentObjectRenderer\processParams(), FrontendLoginController\processRedirect(), SpellCheckingController\processRequest(), RelationHandler\readList(), CategoryRegistry\registerDefaultCategorizedTables(), ExtensionUtility\registerModule(), NewRecordController\regularNew(), DataHandler\remapListedDBRecords_procDBRefs(), ExtensionCompatibilityTester\removeCurrentExtensionFromFile(), TcaFlexProcess\removeExcludeFieldsFromDataStructure(), TcaTypesShowitem\removeFields(), TcaTypesShowitem\removeFieldsByBitmaskExcludeBits(), TcaTypesShowitem\removeFieldsBySubtypeExcludeList(), TcaTypesShowitem\removeFieldsFromPalettes(), UserSettingsController\removeFromList(), NewContentElementController\removeInvalidElements(), AbstractItemProvider\removeItemsByRemoveItemsPageTsConfig(), FlexFormNoTabsContainer\render(), FlexFormTabsContainer\render(), RsaInputElement\render(), ListOfFieldsContainer\render(), FullRecordContainer\render(), SoloFieldContainer\render(), TextElement\render(), ImageManipulationElement\render(), CssStyledContentController\render_bullets(), CssStyledContentController\render_table(), CssStyledContentController\render_uploads(), InlineRecordContainer\renderForeignRecordHeader(), TranslationStatusController\renderL10nTable(), BrowseLinksController\renderLinkAttributeFields(), InlineControlContainer\renderPossibleRecordsSelectorTypeGroupDB(), BytesViewHelper\renderStatic(), ValueSliderWizard\renderWizard(), StagesService\resolveBackendUserIds(), SpriteGenerator\resolveSpritePath(), RteHtmlParser\RTE_transform(), AdministrationRepository\saveKeywords(), FileContentParser\searchTypeMediaTitle(), QueryGenerator\setAndCleanUpExternalLists(), Bootstrap\setCacheHashOptions(), DeletedRecords\setData(), DatabaseRowInitializeNew\setDefaultsFromNeighborRow(), UserSettingsController\setFromDottedNotation(), DataHandler\setMirror(), TypoScriptFrontendController\setPageCacheContent(), TypoScriptFrontendController\settingLanguage(), SpellCheckingController\spellCheckHandler(), HtmlParser\splitIntoBlock(), GraphicalFunctions\splitString(), RelationHandler\start(), AdministrationController\statisticDetailsAction(), ContentObjectRenderer\stdWrap_addPageCacheTags(), MarkerBasedTemplateService\substituteMarkerAndSubpartArrayRecursive(), MarkerBasedTemplateService\substituteMarkerArray(), ContentObjectRenderer\TCAlookup(), PostgresSpecifics\transformQueryParts(), RteHtmlParser\TS_links_rte(), ModuleMenuView\unsetHiddenModules(), PermissionController\updateAction(), LinkValidatorReport\updateBrokenLinks(), ValidatorTaskAdditionalFieldProvider\validateAdditionalFields(), NewContentElementController\wizardArray(), and ExtensionCompatibilityTester\writeCurrentExtensionToFile().
|
static |
Returns a given string with underscores as lowerCamelCase. Example: Converts minimal_value to minimalValue
string | $string | String to be converted to camel case |
Definition at line 1346 of file GeneralUtility.php.
Referenced by ContentObjectRenderer\caseshift().
|
static |
Returns a given string with underscores as UpperCamelCase. Example: Converts blog_example to BlogExample
string | $string | String to be converted to camel case |
Definition at line 1333 of file GeneralUtility.php.
Referenced by ContentObjectRenderer\caseshift(), and PageRenderer\loadRequireJs().
|
static |
Takes comma-separated lists and arrays and removes all duplicates If a value in the list is trim(empty), the value is ignored.
string | $in_list | Accept multiple parameters which can be comma-separated lists of values and arrays. |
mixed | $secondParameter | Dummy field, which if set will show a warning! |
Definition at line 822 of file GeneralUtility.php.
Referenced by ResourceStorage\checkFileExtensionPermission(), BackendUserAuthentication\fetchGroupData(), ContentObjectRenderer\filelist(), BackendUtility\getRecordWSOL(), BasicFileUtility\init(), and BackendUserAuthentication\workspaceInit().
|
static |
Deletes (unlink) a temporary filename in 'PATH_site."typo3temp/"' given as input. The function will check that the file exists, is in PATH_site."typo3temp/" and does not contain back-spaces ("../") so it should be pretty safe. Use this after upload_to_tempfile() or tempnam() from this class!
string | $uploadedTempFileName | Filepath for a file in PATH_site."typo3temp/". Must be absolute. |
Definition at line 4043 of file GeneralUtility.php.
Referenced by SpriteGenerator\generateGraphic(), SpriteGenerator\generateHighDensityGraphic(), SpellCheckingController\processRequest(), SessionUtility\removeFiles(), SpellCheckingController\spellCheckHandler(), and ImportExport\unlinkTempFiles().
|
static |
Explode a string (normally a list of filenames) with whitespaces by considering quotes in that string.
This is mostly needed by the imageMagickCommand function above.
string | $parameters | The whole parameters string |
bool | $unQuote | If set, the elements of the resulting array are unquoted. |
Definition at line 5282 of file GeneralUtility.php.
References elseif.
Referenced by CommandUtility\imageMagickCommand().
|
static |
Moves $source file to $destination if uploaded, otherwise try to make a copy
string | $source | Source file, absolute path |
string | $destination | Destination file, absolute path |
Definition at line 4000 of file GeneralUtility.php.
Referenced by ImportExport\export_addFile(), ImportExport\export_addSysFile(), SpriteGenerator\generateGraphic(), SpriteGenerator\generateHighDensityGraphic(), and UploadedFile\moveTo().
|
static |
Will move an uploaded file (normally in "/tmp/xxxxx") to a temporary filename in PATH_site."typo3temp/" from where TYPO3 can use it. Use this function to move uploaded files to where you can work on them. REMEMBER to use ::unlink_tempfile() afterwards - otherwise temp-files will build up! They are NOT automatically deleted in PATH_site."typo3temp/"!
string | $uploadedFileName | The temporary uploaded filename, eg. $_FILES['[upload field name here]']['tmp_name'] |
Definition at line 4025 of file GeneralUtility.php.
Referenced by UploadExtensionFileController\extractAction(), and HandleIncomingFormValues\saveUploadedFile().
|
static |
Checking syntax of input email address
http://tools.ietf.org/html/rfc3696 International characters are allowed in email. So the whole address needs to be converted to punicode before passing it to filter_var(). We convert the user- and domain part separately to increase the chance of hitting an entry in self::$idnaStringCache.
Also the @ sign may appear multiple times in an address. If not used as a boundary marker between the user- and domain part, it must be escaped with a backslash: @. This mean we can not just explode on the @ sign and expect to get just two parts. So we pop off the domain and then glue the rest together again.
string | Input string to evaluate |
Definition at line 1088 of file GeneralUtility.php.
Referenced by ActionHandler\getReceipientsOfStage(), ActionHandler\getRecipientList(), MailUtility\getSystemFromAddress(), EmailValidator\isValid(), AbstractMenuContentObject\link(), MailPostProcessor\setFrom(), SystemStatusUpdateTaskNotificationEmailField\validateAdditionalFields(), ValidatorTaskAdditionalFieldProvider\validateAdditionalFields(), and ActionTask\viewNewBackendUser().
|
static |
Validate a given IP address.
Possible format are IPv4 and IPv6.
string | $ip | IP address to be tested |
Definition at line 571 of file GeneralUtility.php.
|
static |
Validate a given IP address to the IPv4 address format.
Example for possible format: 10.0.45.99
string | $ip | IP address to be tested |
Definition at line 584 of file GeneralUtility.php.
|
static |
Validate a given IP address to the IPv6 address format.
Example for possible format: 43FB::BB3F:A0A0:0 | ::1
string | $ip | IP address to be tested |
Definition at line 597 of file GeneralUtility.php.
|
static |
Checks for malicious file paths.
Returns TRUE if no '//', '..', '\' or control characters are found in the $theFile. This should make sure that the path is not pointing 'backwards' and further doesn't contain double/back slashes. So it's compatible with the UNIX style path strings valid for TYPO3 internally.
string | $theFile | File path to evaluate |
Definition at line 3879 of file GeneralUtility.php.
Referenced by BasicFileUtility\checkPathAgainstMounts(), ContentObjectRenderer\clean_directory(), CharsetConverter\initCharset(), CharsetConverter\initUnicodeData(), and BasicFileUtility\is_directory().
|
static |
Verifies the input filename against the 'fileDenyPattern'. Returns TRUE if OK.
Filenames are not allowed to contain control characters. Therefore we always filter on [[:cntrl:]].
string | $filename | File path to evaluate |
Definition at line 3919 of file GeneralUtility.php.
References $filename, and $GLOBALS.
Referenced by ResourceStorage\checkFileExtensionPermission(), BasicFileUtility\checkIfAllowed(), TypoScriptParser\extractIncludes(), SecurityStatus\getHtaccessUploadStatus(), TypoScriptParser\includeFile(), CreateFolderController\main(), and FolderUtilityRenderer\uploadForm().
|
static |
Wraps JavaScript code XHTML ready with <script>-tags Automatic re-indenting of the JS code is done by using the first line as indent reference. This is nice for indenting JS code with PHP code on the same level.
string | $string | JavaScript code |
bool | $linebreak | Wrap script element in line breaks? Default is TRUE. |
Definition at line 1952 of file GeneralUtility.php.
Referenced by DebugUtility\debug(), DebugUtility\debugInPopUpWindow(), ConfigurationForm\ext_getForm(), FormResultCompiler\JSbottom(), PageRenderer\renderJqueryScriptTag(), and PageRenderer\renderMainJavaScriptLibraries().
|
static |
Writes $content to the file $file
string | $file | Filepath to write to |
string | $content | Content to write |
bool | $changePermissions | If TRUE, permissions are forced to be set |
Definition at line 2667 of file GeneralUtility.php.
Referenced by ResourceCompressor\__construct(), DatabaseConnectionTest\createFakeExtension(), FileWriter\createHtaccessFile(), FileWriter\createLogFile(), ResourceCompressor\createMergedFile(), ExtensionCompatibilityTesterTest\deleteProtocolFileDeletesFile(), SessionService\ensureSessionSavePathExists(), TypoScriptParser\extractIncludes(), AbstractSpriteHandler\generate(), ImportExport\import_addFileNameToBeCopied(), Indexer\indexExternalUrl(), ExtensionCompatibilityTester\logError(), ImportExport\processSoftReferences_saveFile_createRelFile(), ExtensionCompatibilityTester\removeCurrentExtensionFromFile(), ExtensionCompatibilityTesterTest\removeCurrentExtensionFromFileRemovesGivenExtension(), ResourceCompressor\retrieveExternalFile(), PackageManager\sortAndSavePackageStates(), DocumentationService\unzipDocumentPackage(), FileHandlingUtility\unzipExtensionFromFile(), TerService\unzipTranslationFile(), SessionService\write(), ConfigurationManager\writeAdditionalConfiguration(), ExtensionCompatibilityTester\writeCurrentExtensionToFile(), FileHandlingUtility\writeEmConfToFile(), FileHandlingUtility\writeExtensionFiles(), ResourceCompressor\writeFileAndCompressed(), ImportExport\writeFileVerify(), ConfigurationManager\writeLocalConfiguration(), and ImportExport\writeTemporaryFileFromData().
|
static |
Writes $content to a filename in the typo3temp/ folder (and possibly one or two subfolders...) Accepts an additional subdirectory in the file path!
string | $filepath | Absolute file path to write to inside "typo3temp/". First part of this string must match PATH_site."typo3temp/" |
string | $content | Content string to write |
Definition at line 2760 of file GeneralUtility.php.
Referenced by UpdateScriptUtility\determineUpdateClassName(), Helper\fetchFile(), LocallangArrayParser\generateCacheFile(), BackendController\getLocalLangFileName(), DocumentationService\getOfficialDocuments(), EditDocumentController\init(), CharsetConverter\initCaseFolding(), CharsetConverter\initCharset(), CharsetConverter\initToASCII(), CharsetConverter\initUnicodeData(), PageGenerator\inline2TempFile(), TerService\updateTranslation(), and RteHtmlAreaApi\writeTemporaryFile().
|
static |
Converts an XML string to a PHP array. This is the reverse function of array2xml() This is a wrapper for xml2arrayProcess that adds a two-level cache
string | $string | XML content to convert into an array |
string | $NSprefix | The tag-prefix resolve, eg. a namespace like "T3:" |
bool | $reportDocTag | If set, the document tag will be set in the key "_DOCUMENT_TAG" of the output array |
Definition at line 2198 of file GeneralUtility.php.
References PageRepository\storeHash().
Referenced by DataHandler\checkValueForFlex(), ResourceFactory\convertFlexFormDataToConfigurationArray(), DataHandler\copyRecord_procBasedOnFieldType(), BackendUtility\getFlexFormDS(), AbstractItemProvider\getRegisteredFlexForms(), BackendUtility\getRegisteredFlexForms(), ReferenceIndex\getRelations(), TcaFlexFetch\initializeDataValues(), TableFlexFormToTtContentFieldsUpdate\initializeFlexForm(), ImportExport\loadFile(), AbstractPlugin\pi_initPIflexForm(), ContentObjectRenderer\readFlexformIntoConf(), DataHandler\remapListedDBRecords(), ValueSliderWizard\renderWizard(), TcaFlexFetch\resolvePossibleExternalFileInDataStructure(), ImportExport\setFlexFormRelations(), FlexFormTools\traverseFlexFormXMLData(), and DataHandler\updateFlexFormData().
|
staticprotected |
Converts an XML string to a PHP array. This is the reverse function of array2xml()
string | $string | XML content to convert into an array |
string | $NSprefix | The tag-prefix resolve, eg. a namespace like "T3:" |
bool | $reportDocTag | If set, the document tag will be set in the key "_DOCUMENT_TAG" of the output array |
Definition at line 2229 of file GeneralUtility.php.
References MathUtility\canBeInterpretedAsInteger().
|
static |
Parses XML input into a PHP array with associative keys
string | $string | XML data input |
int | $depth | Number of element levels to resolve the XML into an array. Any further structure will be set as XML. |
array | $parserOptions | Options that will be passed to PHP's xml_parser_set_option() |
Definition at line 1981 of file GeneralUtility.php.
Referenced by FileContentParser\readFileContent().
|
static |
Extracts the attributes (typically encoding and version) of an XML prologue (header).
string | $xmlData | XML data |
Definition at line 2378 of file GeneralUtility.php.
Referenced by FlexFormTools\traverseFlexFormXMLData().
|
static |
This implodes an array of XML parts (made with xml_parse_into_struct()) into XML again.
array | $vals | An array of XML parts, see xml2tree |
Definition at line 2334 of file GeneralUtility.php.
|
staticprotected |
Definition at line 54 of file GeneralUtility.php.
|
staticprotected |
Definition at line 83 of file GeneralUtility.php.
Referenced by GeneralUtility\presetApplicationContext(), and GeneralUtilityFixture\setApplicationContext().
|
staticprotected |
Definition at line 76 of file GeneralUtility.php.
|
staticprotected |
Definition at line 97 of file GeneralUtility.php.
|
staticprotected |
Definition at line 90 of file GeneralUtility.php.
|
staticprotected |
Definition at line 115 of file GeneralUtility.php.
|
staticprotected |
Definition at line 69 of file GeneralUtility.php.
|
staticprotected |
Definition at line 62 of file GeneralUtility.php.
|
staticprotected |
Definition at line 104 of file GeneralUtility.php.
const ENV_TRUSTED_HOSTS_PATTERN_ALLOW_ALL = '.*' |
Definition at line 45 of file GeneralUtility.php.
Referenced by Check\checkTrustedHostPattern(), and SecurityStatus\getTrustedHostsPatternStatus().
const ENV_TRUSTED_HOSTS_PATTERN_SERVER_NAME = 'SERVER_NAME' |
Definition at line 46 of file GeneralUtility.php.
const SYSLOG_SEVERITY_ERROR = 3 |
Definition at line 42 of file GeneralUtility.php.
Referenced by TypoScriptFrontendController\acquirePageGenerationLock(), DatabaseConnection\checkConnectionCharset(), TypoScriptFrontendController\connectToDB(), DatabaseConnection\debug_check_recordset(), TypoScriptFrontendController\fetch_the_id(), SpellCheckingController\fixPersonalDictionaryCharacterSet(), TypoScriptFrontendController\getConfigArray(), AbstractUserAuthentication\getCookieDomain(), SpellCheckingController\getMainDictionaryCharacterSet(), TypoScriptFrontendController\getPageAndRootline(), TypoScriptFrontendController\getPageShortcut(), DatabaseConnection\handler_init(), RedisBackend\initializeObject(), SpellCheckingController\processRequest(), SpellCheckingController\setMainDictionaryPath(), TypoScriptFrontendController\settingLanguage(), GridDataService\sortDataArray(), and DatabaseConnection\sql_pconnect().
const SYSLOG_SEVERITY_FATAL = 4 |
Definition at line 43 of file GeneralUtility.php.
Referenced by DatabaseConnection\handler_init(), TypoScriptFrontendController\prefixLocalAnchorsWithScript(), DatabaseConnection\sql_pconnect(), DatabaseConnection\sql_select_db(), and AbstractExceptionHandler\writeLogEntries().
const SYSLOG_SEVERITY_INFO = 0 |
Definition at line 39 of file GeneralUtility.php.
Referenced by TypoScriptFrontendController\acquirePageGenerationLock(), and ValidatorResolver\createValidator().
const SYSLOG_SEVERITY_NOTICE = 1 |
Definition at line 40 of file GeneralUtility.php.
Referenced by TypoScriptFrontendController\set_no_cache().
const SYSLOG_SEVERITY_WARNING = 2 |
Definition at line 41 of file GeneralUtility.php.
Referenced by TypoScriptFrontendController\__construct(), Locker\acquire(), Locker\acquireExclusiveLock(), AuthenticationService\authUser(), AbstractUserAuthentication\createUserSession(), TypoScriptParser\executeValueModifier(), TypoScriptParser\extractIncludes(), AuthenticationService\getUser(), Locker\isLocked(), TypoScriptFrontendController\set_no_cache(), TypoScriptParser\typoscriptIncludeError(), and FrontendLoginController\validateRedirectUrl().