Moodle  2.2.1
http://www.collinsharper.com
t3lib_div Class Reference

Public Member Functions

 remapArrayKeys (&$array, $mappingTable)

Static Public Member Functions

static _GP ($var)
static _GPmerged ($parameter)
static _GET ($var=NULL)
static _POST ($var=NULL)
static _GETset ($inputGet, $key= '')
static GPvar ($var, $strip=0)
static GParrayMerged ($var)
static removeXSS ($string)
static gif_compress ($theFile, $type)
static png_to_gif_by_imagemagick ($theFile)
static read_png_gif ($theFile, $output_png=0)
static fixed_lgd ($string, $origChars, $preStr= '...')
static fixed_lgd_pre ($string, $chars)
static fixed_lgd_cs ($string, $chars, $appendString= '...')
static breakTextForEmail ($str, $implChar=LF, $charWidth=76)
static breakLinesForEmail ($str, $implChar=LF, $charWidth=76)
static cmpIP ($baseIP, $list)
static cmpIPv4 ($baseIP, $list)
static cmpIPv6 ($baseIP, $list)
static IPv6Hex2Bin ($hex)
static normalizeIPv6 ($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 intInRange ($theInt, $min, $max=2000000000, $zeroValue=0)
static intval_positive ($theInt)
static int_from_ver ($verNumberStr)
static compat_version ($verNumberStr)
static md5int ($str)
static shortMD5 ($input, $len=10)
static hmac ($input)
static uniqueList ($in_list, $secondParameter=NULL)
static split_fileref ($fileref)
static dirname ($path)
static modifyHTMLColor ($color, $R, $G, $B)
static modifyHTMLColorAll ($color, $all)
static rm_endcomma ($string)
static danish_strtoupper ($string)
static convUmlauts ($str)
static testInt ($var)
static isFirstPartOfStr ($str, $partStr)
static formatSize ($sizeInBytes, $labels= '')
static convertMicrotime ($microtime)
static splitCalc ($string, $operators)
static calcPriority ($string)
static calcParenthesis ($string)
static htmlspecialchars_decode ($value)
static deHSCentities ($str)
static slashJS ($string, $extended=0, $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 ($count)
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, $onlyNonEmptyValues=FALSE, $limit=0)
static revExplode ($delimiter, $string, $count=0)
static trimExplode ($delim, $string, $removeEmptyValues=FALSE, $limit=0)
static uniqueArray (array $valueArray)
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=1)
static addSlashesOnArray (array &$theArray)
static stripSlashesOnArray (array &$theArray)
static slashArray (array $arr, $cmd)
static array_merge_recursive_overrule (array $arr0, array $arr1, $notAddKeys=0, $includeEmtpyValues=TRUE)
static array_merge (array $arr1, array $arr2)
static arrayDiffAssocRecursive (array $array1, array $array2)
static csvValues (array $row, $delim= ',', $quote= '"')
static array2json (array $jsonArray)
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 implodeParams (array $arr, $xhtmlSafe=FALSE, $dontOmitBlankAttribs=FALSE)
static wrapJS ($string, $linebreak=TRUE)
static xml2tree ($string, $depth=999)
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)
static fixPermissions ($path, $recursive=FALSE)
static writeFileToTypo3tempDir ($filepath, $content)
static mkdir ($newFolder)
static mkdir_deep ($destination, $deepDir)
static rmdir ($path, $removeNonEmpty=FALSE)
static get_dirs ($path)
static getFilesInDir ($path, $extensionList= '', $prependPath=0, $order= '', $excludePattern= '')
static getAllFilesAndFoldersInPath (array $fileArr, $path, $extList= '', $regDirs=0, $recursivityLevels=99, $excludePattern= '')
static removePrefixPathFromList (array $fileArr, $prefixToRemove)
static fixWindowsFilePath ($theFile)
static resolveBackPath ($pathStr)
static locationHeaderUrl ($path)
static getMaxUploadFileSize ($localLimit=0)
static getBytesFromSizeMeasurement ($measurement)
static getMaximumPathLength ()
static createVersionNumberedFilename ($file, $forceQueryString=FALSE)
static debug_ordvalue ($string, $characters=100)
static view_array ($array_in)
static print_array ($array_in)
static debug ($var= '', $header= '', $group= 'Debug')
static debug_trail ()
static debugRows ($rows, $header= '', $returnHTML=FALSE)
static getThisUrl ()
static linkThisScript (array $getParams=array())
static linkThisUrl ($url, array $getParams=array())
static getIndpEnv ($getEnvName)
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 sanitizeLocalUrl ($url= '')
static upload_copy_move ($source, $destination)
static upload_to_tempfile ($uploadedFileName)
static unlink_tempfile ($uploadedTempFileName)
static tempnam ($filePrefix)
static stdAuthCode ($uid_or_record, $fields= '', $codeLength=8)
static cHashParams ($addQueryParams)
static generateCHash ($addQueryParams)
static calculateCHash ($params)
static hideIfNotTranslated ($l18n_cfg_fieldValue)
static readLLfile ($fileRef, $langKey, $charset= '', $errorMode=0)
static readLLPHPfile ($fileRef, $langKey, $charset= '')
static readLLXMLfile ($fileRef, $langKey, $charset= '')
static llXmlAutoFileName ($fileRef, $language)
static loadTCA ($table)
static resolveSheetDefInDS ($dataStructArray, $sheet= 'sDEF')
static resolveAllSheetsInDS (array $dataStructArray)
static callUserFunction ($funcName, &$params, &$ref, $checkPrefix= 'user_', $errorMode=0)
static getUserObj ($classRef, $checkPrefix= 'user_', $silent=FALSE)
static hasValidClassPrefix ($classRef, array $additionalPrefixes=array())
static makeInstance ($className)
static makeInstanceClassName ($className)
static setSingletonInstance ($className, t3lib_Singleton $instance)
static addInstance ($className, $instance)
static purgeInstances ()
static makeInstanceService ($serviceType, $serviceSubType= '', $excludeServiceKeys=array())
static requireOnce ($requireFile)
static requireFile ($requireFile)
static plainMailEncoded ($email, $subject, $message, $headers= '', $encoding= 'quoted-printable', $charset= '', $dontEncodeHeader=FALSE)
static quoted_printable ($string, $maxlen=76)
static encodeHeader ($line, $enc= 'quoted-printable', $charset= 'iso-8859-1')
static substUrlsInPlainText ($message, $urlmode= '76', $index_script_url= '')
static makeRedirectUrl ($inUrl, $l=0, $index_script_url= '')
static freetypeDpiComp ($font_size)
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, $withinCData=FALSE)
static cleanOutputBuffers ()
static flushOutputBuffers ()

Data Fields

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

Protected Member Functions

 xml2arrayProcess ($string, $NSprefix= '', $reportDocTag=FALSE)
 getClassName ($className)

Static Protected Member Functions

static checkInstanceClassName ($className, $instance)

Static Protected Attributes

static $singletonInstances = array()
static $nonSingletonInstances = array()
static $finalClassNameRegister = array()

Detailed Description

Definition at line 230 of file class.t3lib_div.php.


Member Function Documentation

static _GET ( var = NULL) [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! Usage: 27

Parameters:
stringOptional pointer to value in GET array (basically name of GET var)
Returns:
mixed If $var is set it returns the value of $_GET[$var]. If $var is NULL (default), returns $_GET itself. In any case *slashes are stipped from the output!*
See also:
_POST(), _GP(), _GETset()

Definition at line 324 of file class.t3lib_div.php.

Here is the call graph for this function:

Here is the caller graph for this function:

static _GETset ( inputGet,
key = '' 
) [static]

Writes input value to $_GET. Usage: 2

Parameters:
mixed$inputGetarray or single value to write to $_GET. Values should NOT be escaped at input time (but will be escaped before writing according to TYPO3 standards).
string$keyalternative key; If set, this will not set the WHOLE GET array, but only the key in it specified by this value! You can specify to replace keys on deeper array levels by separating the keys with a pipe. Example: 'parentKey|childKey' will result in array('parentKey' => array('childKey' => $inputGet))
Returns:
void

Definition at line 375 of file class.t3lib_div.php.

Here is the call graph for this function:

static _GP ( var) [static]

Returns the 'GLOBAL' value of incoming data from POST or GET, with priority to POST (that is equalent to 'GP' order) Strips slashes from all output, both strings and arrays. This function substitutes t3lib_div::GPvar() To enhancement security in your scripts, please consider using t3lib_div::_GET or t3lib_div::_POST if you already know by which method your data is arriving to the scripts! Usage: 537

Parameters:
stringGET/POST var to return
Returns:
mixed POST var named $var and if not set, the GET var of the same name.

Definition at line 284 of file class.t3lib_div.php.

Here is the call graph for this function:

Here is the caller graph for this function:

static _GPmerged ( parameter) [static]

Returns the global arrays $_GET and $_POST merged with $_POST taking precedence.

Parameters:
stringKey (variable name) from GET or POST vars
Returns:
array Returns the GET vars merged recursively onto the POST vars.

Definition at line 305 of file class.t3lib_div.php.

Here is the call graph for this function:

Here is the caller graph for this function:

static _POST ( var = NULL) [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! Usage: 41

Parameters:
stringOptional pointer to value in POST array (basically name of POST var)
Returns:
mixed If $var is set it returns the value of $_POST[$var]. If $var is NULL (default), returns $_POST itself. In any case *slashes are stipped from the output!*
See also:
_GET(), _GP()

Definition at line 345 of file class.t3lib_div.php.

Here is the call graph for this function:

static addInstance ( className,
instance 
) [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!

See also:
makeInstance
Exceptions:
InvalidArgumentExceptionif class extends t3lib_Singleton
Parameters:
string$classNamethe name of the class to set, must not be empty
object$instancethe instance to set, must be an instance of $className
Returns:
void

Definition at line 5438 of file class.t3lib_div.php.

Here is the call graph for this function:

static addSlashesOnArray ( array &$  theArray) [static]

AddSlash array This function traverses a multidimentional array and adds slashes to the values. NOTE that the input array is and argument by reference.!! Twin-function to stripSlashesOnArray Usage: 8

Parameters:
arrayMultidimensional input array, (REFERENCE!)
Returns:
array

Definition at line 2133 of file class.t3lib_div.php.

Here is the caller graph for this function:

static array2json ( array jsonArray) [static]

Creates recursively a JSON literal from a multidimensional associative array. Uses native function of PHP >= 5.2.0

Parameters:
array$jsonArray,:The array to be transformed to JSON
Returns:
string JSON string
Deprecated:
since TYPO3 4.3, will be removed in TYPO3 4.6 - use PHP native function json_encode() instead, will be removed in TYPO3 4.5

Definition at line 2301 of file class.t3lib_div.php.

Here is the call graph for this function:

static array2xml ( array array,
NSprefix = '',
level = 0,
docTag = 'phparray',
spaceInd = 0,
array options = array(),
array stackData = array() 
) [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 tagnames. 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 tagname "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... Usage: 5

Parameters:
arrayThe input PHP array with any kind of data; text, binary, integers. Not objects though.
stringtag-prefix, eg. a namespace prefix like "T3:"
integerCurrent recursion level. Don't change, stay at zero!
stringAlternative document tag. Default is "phparray".
integerIf 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
arrayOptions 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')
stringStack data. Don't touch.
Returns:
string An XML string made from the input content in the array.
See also:
xml2array()

Definition at line 2628 of file class.t3lib_div.php.

Here is the caller graph for this function:

static array2xml_cs ( array array,
docTag = 'phparray',
array options = array(),
charset = '' 
) [static]

Turns PHP array into XML. See array2xml()

Parameters:
arrayThe input PHP array with any kind of data; text, binary, integers. Not objects though.
stringAlternative document tag. Default is "phparray".
arrayOptions for the compilation. See array2xml() for description.
stringForced charset to prologue
Returns:
string An XML string made from the input content in the array.
See also:
xml2array(),array2xml()

Definition at line 2587 of file class.t3lib_div.php.

Here is the call graph for this function:

static array_merge ( array arr1,
array arr2 
) [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. Usage: 16

Parameters:
arrayFirst array
arraySecond array
Returns:
array Merged result.

Definition at line 2247 of file class.t3lib_div.php.

Here is the caller graph for this function:

static array_merge_recursive_overrule ( array arr0,
array arr1,
notAddKeys = 0,
includeEmtpyValues = TRUE 
) [static]

Merges two arrays recursively and "binary safe" (integer keys are overridden as well), overruling similar values in the first array ($arr0) with the values of the second array ($arr1) In case of identical keys, ie. keeping the values of the second. Usage: 0

Parameters:
arrayFirst array
arraySecond array, overruling the first array
booleanIf set, keys that are NOT found in $arr0 (first array) will not be set. Thus only existing value can/will be overruled from second array.
booleanIf set, values from $arr1 will overrule if they are empty or zero. Default: true
Returns:
array Resulting array where $arr1 values has overruled $arr0 values

Definition at line 2215 of file class.t3lib_div.php.

Here is the caller graph for this function:

static arrayDiffAssocRecursive ( array array1,
array array2 
) [static]

Filters keys off from first array that also exist in second array. Comparision is done by keys. This method is a recursive version of php array_diff_assoc()

Parameters:
arraySource array
arrayReduce source array by this array
Returns:
array Source array reduced by keys also present in second array

Definition at line 2259 of file class.t3lib_div.php.

static arrayToLogString ( array arr,
valueList = array(),
valueLength = 20 
) [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;"

Parameters:
arrayData array which should be outputted
mixedList of keys which should be listed in the output string. Pass a comma list or an array. An empty list outputs the whole array.
integerLong string values are shortened to this length. Default: 20
Returns:
string Output string with key names and their value as string

Definition at line 6106 of file class.t3lib_div.php.

Here is the call graph for this function:

static breakLinesForEmail ( str,
implChar = LF,
charWidth = 76 
) [static]

Breaks up a single line of text for emails Usage: 5

Parameters:
stringThe string to break up
stringThe string to implode the broken lines with (default/typically
)
integerThe line length
Returns:
string
See also:
breakTextForEmail()

Definition at line 685 of file class.t3lib_div.php.

Here is the caller graph for this function:

static breakTextForEmail ( str,
implChar = LF,
charWidth = 76 
) [static]

Breaks up the text for emails Usage: 1

Parameters:
stringThe string to break up
stringThe string to implode the broken lines with (default/typically
)
integerThe line length
Deprecated:
since TYPO3 4.1, will be removed in TYPO3 4.6 - Use PHP function wordwrap()
Returns:
string

Definition at line 664 of file class.t3lib_div.php.

Here is the call graph for this function:

static calcParenthesis ( string) [static]

Calculates the input with parenthesis levels Usage: 2

Parameters:
stringInput string, eg "(123 + 456) / 789 - 4"
Returns:
integer Calculated value. Or error string.
See also:
calcPriority(), tslib_cObj::stdWrap()

Definition at line 1558 of file class.t3lib_div.php.

Here is the call graph for this function:

static calcPriority ( string) [static]

Calculates the input by +,-,*,/,%,^ with priority to + and - Usage: 1

Parameters:
stringInput string, eg "123 + 456 / 789 - 4"
Returns:
integer Calculated value. Or error string.
See also:
calcParenthesis()

Definition at line 1500 of file class.t3lib_div.php.

Here is the caller graph for this function:

static calculateCHash ( params) [static]

Calculates the cHash based on the provided parameters

Parameters:
arrayArray of key-value pairs
Returns:
string Hash of all the values

Definition at line 4641 of file class.t3lib_div.php.

Here is the caller graph for this function:

static callUserFunction ( funcName,
&$  params,
&$  ref,
checkPrefix = 'user_',
errorMode = 0 
) [static]

Calls a userdefined function/method in class Such a function/method should look like this: "function proc(&$params, &$ref) {...}" Usage: 17

Parameters:
stringFunction/Method reference, '[file-reference":"]["&"]class/function["->"method-name]'. You can prefix this reference with "[file-reference]:" and t3lib_div::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").
mixedParameters to be pass along (typically an array) (REFERENCE!)
mixedReference to be passed along (typically "$this" - being a reference to the calling object) (REFERENCE!)
stringRequired prefix of class or function name
integerError 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)
Returns:
mixed Content from method/function call or false if the class/method/function was not found
See also:
getUserObj()

Definition at line 5119 of file class.t3lib_div.php.

Here is the call graph for this function:

Here is the caller graph for this function:

static camelCaseToLowerCaseUnderscored ( string) [static]

Returns a given CamelCasedString as an lowercase string with underscores. Example: Converts BlogExample to blog_example, and minimalValue to minimal_value

Parameters:
string$string,:String to be converted to lowercase underscore
Returns:
string lowercase_and_underscored_string

Definition at line 1826 of file class.t3lib_div.php.

Here is the call graph for this function:

static cHashParams ( addQueryParams) [static]

Splits the input query-parameters into an array with certain parameters filtered out. Used to create the cHash value

Parameters:
stringQuery-parameters: "&xxx=yyy&zzz=uuu"
Returns:
array Array with key/value pairs of query-parameters WITHOUT a certain list of variable names (like id, type, no_cache etc.) and WITH a variable, encryptionKey, specific for this server/installation
See also:
tslib_fe::makeCacheHash(), tslib_cObj::typoLink(), t3lib_div::calculateCHash()

Definition at line 4589 of file class.t3lib_div.php.

Here is the call graph for this function:

Here is the caller graph for this function:

static checkInstanceClassName ( className,
instance 
) [static, protected]

Checks that $className is non-empty and that $instance is an instance of $className.

Exceptions:
InvalidArgumentExceptionif $className is empty or if $instance is no instance of $className
Parameters:
string$classNamea class name
object$instancean object
Returns:
void

Definition at line 5464 of file class.t3lib_div.php.

Here is the caller graph for this function:

static cleanOutputBuffers ( ) [static]

Ends and cleans all output buffers

Returns:
void

Definition at line 6199 of file class.t3lib_div.php.

static clientInfo ( useragent = '') [static]

Client Browser Information Usage: 4

Parameters:
stringAlternative User Agent string (if empty, t3lib_div::getIndpEnv('HTTP_USER_AGENT') is used)
Returns:
array Parsed information about the HTTP_USER_AGENT in categories BROWSER, VERSION, SYSTEM and FORMSTYLE

Definition at line 4208 of file class.t3lib_div.php.

Here is the call graph for this function:

static cmpFQDN ( baseHost,
list 
) [static]

Match fully qualified domain name with list of strings with wildcard

Parameters:
string$baseIPA hostname or an IPv4/IPv6-address (will by reverse-resolved; typically REMOTE_ADDR)
string$listA 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)
Returns:
boolean TRUE if a domain name mask from $list matches $baseIP

Definition at line 956 of file class.t3lib_div.php.

Here is the call graph for this function:

static cmpIP ( baseIP,
list 
) [static]

Match IP number with list of numbers with wildcard Dispatcher method for switching into specialised IPv4 and IPv6 methods. Usage: 10

Parameters:
string$baseIPis the current remote IP address for instance, typ. REMOTE_ADDR
string$listis 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.
Returns:
boolean True if an IP-mask from $list matches $baseIP

Definition at line 725 of file class.t3lib_div.php.

Here is the call graph for this function:

Here is the caller graph for this function:

static cmpIPv4 ( baseIP,
list 
) [static]

Match IPv4 number with list of numbers with wildcard

Parameters:
string$baseIPis the current remote IP address for instance, typ. REMOTE_ADDR
string$listis 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)
Returns:
boolean True if an IP-mask from $list matches $baseIP

Definition at line 746 of file class.t3lib_div.php.

Here is the call graph for this function:

Here is the caller graph for this function:

static cmpIPv6 ( baseIP,
list 
) [static]

Match IPv6 address with a list of IPv6 prefixes

Parameters:
string$baseIPis the current remote IP address for instance
string$listis a comma-list of IPv6 prefixes, could also contain IPv4 addresses
Returns:
boolean True if an baseIP matches any prefix

Definition at line 789 of file class.t3lib_div.php.

Here is the call graph for this function:

Here is the caller graph for this function:

static compat_version ( verNumberStr) [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)

Parameters:
stringMinimum branch number required (format x.y / e.g. "4.0" NOT "4.0.0"!)
Returns:
boolean Returns true if this setup is compatible with the provided version number
Todo:
Still needs a function to convert versions to branches

Definition at line 1155 of file class.t3lib_div.php.

static compileSelectedGetVarsFromArray ( varList,
array getArray,
GPvarAlt = 1 
) [static]

Returns an array with selected keys from incoming data. (Better read source code if you want to find out...) Usage: 3

Parameters:
stringList of variable/key names
arrayArray from where to get values based on the keys in $varList
booleanIf set, then t3lib_div::_GP() is used to fetch the value if not found (isset) in the $getArray
Returns:
array Output array with selected variables.

Definition at line 2110 of file class.t3lib_div.php.

Here is the call graph for this function:

static convertMicrotime ( microtime) [static]

Returns microtime input to milliseconds Usage: 2

Parameters:
stringMicrotime
Returns:
integer Microtime input string converted to an integer (milliseconds)

Definition at line 1464 of file class.t3lib_div.php.

static convUmlauts ( str) [static]

Change umlaut characters to plain ASCII with normally two character target Only known characters will be converted, so don't expect a result for any character.

ä => ae, Ö => Oe

Parameters:
stringString to convert.
Deprecated:
since TYPO3 4.1, will be removed in TYPO3 4.6 - Works only for western europe single-byte charsets! Use t3lib_cs::specCharsToASCII() instead!
Returns:
string

Definition at line 1388 of file class.t3lib_div.php.

Here is the call graph for this function:

static createVersionNumberedFilename ( file,
forceQueryString = FALSE 
) [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

Parameters:
string$fileRelative path to file including all potential query parameters (not htmlspecialchared yet)
boolean$forceQueryStringIf settings would suggest to embed in filename, this parameter allows us to force the versioning to occur in the query string. This is needed for scriptaculous.js which cannot have a different filename in order to load its modules (?load=...)
Returns:
Relative path with version filename including the timestamp
Author:
Lars Houmark <lars@houmark.com>

Definition at line 3680 of file class.t3lib_div.php.

Here is the call graph for this function:

static csvValues ( array row,
delim = ',',
quote = '"' 
) [static]

Takes a row and returns a CSV string of the values with $delim (default is ,) and $quote (default is ") as separator chars. Usage: 5

Parameters:
arrayInput array of values
stringDelimited, default is comman
stringQuote-character to wrap around the values.
Returns:
string A single line of CSV

Definition at line 2283 of file class.t3lib_div.php.

static danish_strtoupper ( string) [static]

strtoupper which converts danish (and other characters) characters as well Usage: 0

Parameters:
stringString to process
Returns:
string
Deprecated:
since TYPO3 3.5, will be removed in TYPO3 4.6 - Use t3lib_cs::conv_case() instead or for HTML output, wrap your content in ...)

Definition at line 1355 of file class.t3lib_div.php.

Here is the call graph for this function:

static debug ( var = '',
header = '',
group = 'Debug' 
) [static]

Makes debug output Prints $var in bold between two vertical lines If not $var the word 'debug' is printed If $var is an array, the array is printed by t3lib_div::print_array() Usage: 8

Parameters:
mixedVariable to print
stringThe header.
stringGroup for the debug console
Returns:
void
Deprecated:
since TYPO3 4.5 - Use t3lib_utility_Debug::debug instead

Definition at line 3795 of file class.t3lib_div.php.

Here is the call graph for this function:

Here is the caller graph for this function:

static debug_ordvalue ( string,
characters = 100 
) [static]

Returns a string with a list of ascii-values for the first $characters characters in $string Usage: 0

Parameters:
stringString to show ASCII value for
integerNumber of characters to show
Returns:
string The string with ASCII values in separated by a space char.
Deprecated:
since TYPO3 4.5 - Use t3lib_utility_Debug::ordinalValue instead

Definition at line 3748 of file class.t3lib_div.php.

Here is the call graph for this function:

static debug_trail ( ) [static]

Displays the "path" of the function call stack in a string, using debug_backtrace

Returns:
string
Deprecated:
since TYPO3 4.5 - Use t3lib_utility_Debug::debugTrail instead

Definition at line 3806 of file class.t3lib_div.php.

Here is the call graph for this function:

static debugRows ( rows,
header = '',
returnHTML = FALSE 
) [static]

Displays an array as rows in a table. Useful to debug output like an array of database records.

Parameters:
mixedArray of arrays with similar keys
stringTable header
booleanIf TRUE, will return content instead of echo'ing out.
Returns:
void Outputs to browser.
Deprecated:
since TYPO3 4.5 - Use t3lib_utility_Debug::debugRows instead

Definition at line 3820 of file class.t3lib_div.php.

Here is the call graph for this function:

static deHSCentities ( str) [static]

Re-converts HTML entities if they have been converted by htmlspecialchars() Usage: 10

Parameters:
stringString which contains eg. "&amp;amp;" which should stay "&amp;". Or "&amp;#1234;" to "&#1234;". Or "&amp;#x1b;" to "&#x1b;"
Returns:
string Converted result.

Definition at line 1601 of file class.t3lib_div.php.

static deprecationLog ( msg) [static]

Writes a message to the deprecation log.

Parameters:
stringMessage (in English).
Returns:
void

Definition at line 6009 of file class.t3lib_div.php.

Here is the call graph for this function:

Here is the caller graph for this function:

static devLog ( msg,
extKey,
severity = 0,
dataVar = FALSE 
) [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) t3lib_div::devLog('[write message in english here]', 'extension key');

Parameters:
stringMessage (in english).
stringExtension key (from which extension you are calling the log)
integerSeverity: 0 is info, 1 is notice, 2 is warning, 3 is fatal error, -1 is "OK" message
mixedAdditional data you want to pass to the logger.
Returns:
void

Definition at line 5991 of file class.t3lib_div.php.

Here is the call graph for this function:

Here is the caller graph for this function:

static dirname ( path) [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' => '' '' => '' Usage: 5

Parameters:
stringDirectory name / path
Returns:
string Processed input value. See function description.

Definition at line 1292 of file class.t3lib_div.php.

Here is the call graph for this function:

Here is the caller graph for this function:

static encodeHeader ( line,
enc = 'quoted-printable',
charset = 'iso-8859-1' 
) [static]

Encode header lines Email headers must be ASCII, therefore they will be encoded to quoted_printable (default) or base64.

Parameters:
stringContent to encode
stringEncoding type: "base64" or "quoted-printable". Default value is "quoted-printable".
stringCharset used for encoding
Returns:
string The encoded string

Definition at line 5709 of file class.t3lib_div.php.

Here is the call graph for this function:

Here is the caller graph for this function:

static expandList ( list) [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.

Parameters:
stringcomma-separated list of integers with ranges (string)
Returns:
string new comma-separated list of items
Author:
Martin Kutschker <martin.kutschker@activesolution.at>

Definition at line 1070 of file class.t3lib_div.php.

static explodeUrl2Array ( string,
multidim = FALSE 
) [static]

Explodes a string with GETvars (eg. "&id=1&type=2&ext[mykey]=3") into an array

Parameters:
stringGETvars string
booleanIf set, the string will be parsed into a multidimensional array if square brackets are used in variable names (using PHP function parse_str())
Returns:
array Array of values. All values AND keys are rawurldecoded() as they properly should be. But this means that any implosion of the array again must rawurlencode it!
See also:
implodeArrayForUrl()

Definition at line 2084 of file class.t3lib_div.php.

static fixed_lgd ( string,
origChars,
preStr = '...' 
) [static]

Truncates string. Returns a new string of max. $chars length. If the string is longer, it will be truncated and appended with '...'. Usage: 39

Parameters:
stringstring to truncate
integermust be an integer with an absolute value of at least 4. if negative the string is cropped from the right end.
stringString to append to the output if it is truncated, default is '...'
Returns:
string new string
Deprecated:
since TYPO3 4.1, will be removed in TYPO3 4.6 - Works ONLY for single-byte charsets! Use t3lib_div::fixed_lgd_cs() instead
See also:
fixed_lgd_pre()

Definition at line 599 of file class.t3lib_div.php.

Here is the call graph for this function:

static fixed_lgd_cs ( string,
chars,
appendString = '...' 
) [static]

Truncates a string with appended/prepended "..." and takes current character set into consideration. Usage: 75

Parameters:
stringstring to truncate
integermust be an integer with an absolute value of at least 4. if negative the string is cropped from the right end.
stringappendix to the truncated string
Returns:
string cropped string

Definition at line 641 of file class.t3lib_div.php.

Here is the call graph for this function:

static fixed_lgd_pre ( string,
chars 
) [static]

Truncates string. Returns a new string of max. $chars length. If the string is longer, it will be truncated and prepended with '...'. This works like fixed_lgd(), but is truncated in the start of the string instead of the end Usage: 6

Parameters:
stringstring to truncate
integermust be an integer of at least 4
Returns:
string new string
Deprecated:
since TYPO3 4.1, will be removed in TYPO3 4.6 - Use t3lib_div::fixed_lgd_cs() instead (with negative input value for $chars)
See also:
fixed_lgd()

Definition at line 626 of file class.t3lib_div.php.

Here is the call graph for this function:

static fixPermissions ( path,
recursive = FALSE 
) [static]

Sets the file system mode and group ownership of a file or a folder.

Parameters:
stringPath of file or folder, must not be escaped. Path can be absolute or relative
booleanIf set, also fixes permissions of files and folders in the folder (if $path is a folder)
Returns:
mixed TRUE on success, FALSE on error, always TRUE on Windows OS

Definition at line 3207 of file class.t3lib_div.php.

Here is the call graph for this function:

Here is the caller graph for this function:

static fixWindowsFilePath ( theFile) [static]

Fixes a path for windows-backslashes and reduces double-slashes to single slashes Usage: 2

Parameters:
stringFile path to process
Returns:
string

Definition at line 3533 of file class.t3lib_div.php.

static flushOutputBuffers ( ) [static]

Ends and flushes all output buffers

Returns:
void

Definition at line 6212 of file class.t3lib_div.php.

Here is the call graph for this function:

static formatForTextarea ( content) [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! Usage: 23

Parameters:
stringInput string to be formatted.
Returns:
string Formatted for <textarea>-tags

Definition at line 1701 of file class.t3lib_div.php.

static formatSize ( sizeInBytes,
labels = '' 
) [static]

Formats the input integer $sizeInBytes as bytes/kilobytes/megabytes (-/K/M) Usage: 53

Parameters:
integerNumber of bytes to format.
stringLabels for bytes, kilo, mega and giga separated by vertical bar (|) and possibly encapsulated in "". Eg: " | K| M| G" (which is the default value)
Returns:
string Formatted representation of the byte number, for output.

Definition at line 1429 of file class.t3lib_div.php.

static freetypeDpiComp ( font_size) [static]

Function to compensate for FreeType2 96 dpi Usage: 21

Parameters:
integerFontsize for freetype function call
Returns:
integer Compensated fontsize based on $GLOBALS['TYPO3_CONF_VARS']['GFX']['TTFdpi']

Definition at line 5827 of file class.t3lib_div.php.

static generateCHash ( addQueryParams) [static]

Returns the cHash based on provided query parameters and added values from internal call

Parameters:
stringQuery-parameters: "&xxx=yyy&zzz=uuu"
Returns:
string Hash of all the values
See also:
t3lib_div::cHashParams(), t3lib_div::calculateCHash()

Definition at line 4629 of file class.t3lib_div.php.

Here is the call graph for this function:

static generateRandomBytes ( count) [static]

Returns a string of highly randomized bytes (over the full 8-bit range).

Parameters:
integerNumber of characters (bytes) to return
Returns:
string Random Bytes

Definition at line 1739 of file class.t3lib_div.php.

static get_dirs ( path) [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. Usage: 11

Parameters:
stringPath to list directories from
Returns:
array Returns an array with the directory entries as values. If no path, the return value is nothing.

Definition at line 3402 of file class.t3lib_div.php.

Here is the caller graph for this function:

static get_tag_attributes ( tag) [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 parameterlist (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() Usage: 8

Parameters:
stringHTML-tag string (or attributes only)
Returns:
array Array with the attribute values.

Definition at line 2360 of file class.t3lib_div.php.

Here is the call graph for this function:

Here is the caller graph for this function:

static getAllFilesAndFoldersInPath ( array fileArr,
path,
extList = '',
regDirs = 0,
recursivityLevels = 99,
excludePattern = '' 
) [static]

Recursively gather all files and folders of a path. Usage: 5

Parameters:
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.
boolean$regDirs,:If set, directories are also included in output.
integer$recursivityLevels,:The number of levels to dig down...
string$excludePattern,:regex pattern of files/directories to exclude
Returns:
array An array with the found files/directories.

Definition at line 3490 of file class.t3lib_div.php.

Here is the call graph for this function:

static getBytesFromSizeMeasurement ( measurement) [static]

Gets the bytes value from a measurement string like "100k".

Parameters:
string$measurement,:The measurement (e.g. "100k")
Returns:
integer The bytes value (e.g. 102400)

Definition at line 3619 of file class.t3lib_div.php.

Here is the caller graph for this function:

getClassName ( className) [protected]

Returns the class name for a new instance, taking into account the class-extension API.

Parameters:
stringBase class name to evaluate
Returns:
string Final class name to instantiate with "new [classname]"

Definition at line 5391 of file class.t3lib_div.php.

Here is the caller graph for this function:

static getDeprecationLogFileName ( ) [static]

Gets the absolute path to the deprecation log file.

Returns:
string absolute path to the deprecation log file

Definition at line 6051 of file class.t3lib_div.php.

Here is the call graph for this function:

Here is the caller graph for this function:

static getFileAbsFileName ( filename,
onlyRelative = TRUE,
relToTYPO3_mainDir = FALSE 
) [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 t3lib_div::validPathStr(). Returns false if checks failed. Does not check if the file exists. Usage: 24

Parameters:
stringThe input filename/filepath to evaluate
booleanIf $onlyRelative is set (which it is by default), then only return values relative to the current PATH_site is accepted.
booleanIf $relToTYPO3_mainDir is set, then relative paths are relative to PATH_typo3 constant - otherwise (default) they are relative to PATH_site
Returns:
string Returns the absolute filename of $filename IF valid, otherwise blank string.

Definition at line 4325 of file class.t3lib_div.php.

Here is the caller graph for this function:

static getFilesInDir ( path,
extensionList = '',
prependPath = 0,
order = '',
excludePattern = '' 
) [static]

Returns an array with the names of files in a specific path Usage: 18

Parameters:
string$path,:Is the path to the file
string$extensionListis the comma list of extensions to read only (blank = all)
booleanIf set, then the path is prepended the filenames. Otherwise only the filenames are returned in the array
string$orderis sorting: 1= sort alphabetically, 'mtime' = sort by modification time.
stringA comma seperated list of filenames to exclude, no wildcards
Returns:
array Array of the files found

Definition at line 3430 of file class.t3lib_div.php.

Here is the call graph for this function:

static getHostname ( requestHost = TRUE) [static]

Get the fully-qualified domain name of the host. Usage: 2

Parameters:
booleanUse request host (when not in CLI mode).
Returns:
string The fully-qualified host name.

Definition at line 4276 of file class.t3lib_div.php.

Here is the call graph for this function:

Here is the caller graph for this function:

static getIndpEnv ( getEnvName) [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. Usage: 221

Parameters:
stringName 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
Returns:
string Value based on the input key, independent of server/os environment.

Definition at line 3903 of file class.t3lib_div.php.

Here is the call graph for this function:

Here is the caller graph for this function:

static getMaximumPathLength ( ) [static]

Retrieves the maximum path length that is valid in the current environment.

Returns:
integer The maximum available path length
Author:
Ingo Renner <ingo@typo3.org>

Definition at line 3642 of file class.t3lib_div.php.

static getMaxUploadFileSize ( localLimit = 0) [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. The first parameter can be used to set something that overrides the maxFileSize, usually for the TCA values.

Parameters:
integer$localLimit,:the number of Kilobytes (!) that should be used as the initial Limit, otherwise $TYPO3_CONF_VARS['BE']['maxFileSize'] will be used
Returns:
integer the maximum size of uploads that are allowed (measuered in kilobytes)

Definition at line 3595 of file class.t3lib_div.php.

Here is the call graph for this function:

static getRandomHexString ( count) [static]

Returns a hex representation of a random byte string.

Parameters:
integerNumber of hex characters to return
Returns:
string Random Bytes

Definition at line 1790 of file class.t3lib_div.php.

static getThisUrl ( ) [static]

Returns the HOST+DIR-PATH of the current script (The URL, but without 'http://' and without script-filename) Usage: 1

Returns:
string

Definition at line 3838 of file class.t3lib_div.php.

Here is the call graph for this function:

static getUrl ( url,
includeHeader = 0,
requestHeaders = FALSE,
&$  report = NULL 
) [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 $TYPO3_CONF_VARS['SYS']['curlUse'] etc. Usage: 83

Parameters:
stringFile/URL to read
integerWhether the HTTP header should be fetched or not. 0=disable, 1=fetch header+content, 2=fetch header only
arrayHTTP headers to be used in the request
arrayError code/message and, if $includeHeader is 1, response meta data (HTTP status and content type)
Returns:
string The content from the resource given as input. FALSE if an error has occured.

Definition at line 2992 of file class.t3lib_div.php.

Here is the caller graph for this function:

static getUserObj ( classRef,
checkPrefix = 'user_',
silent = FALSE 
) [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 = &t3lib_div::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. Usage: 5

Parameters:
stringClass reference, '[file-reference":"]["&"]class-name'. You can prefix the class name with "[file-reference]:" and t3lib_div::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!).
stringRequired prefix of class name. By default "tx_" and "Tx_" are allowed.
booleanIf set, no debug() error message is shown if class/function is not present.
Returns:
object The instance of the class asked for. Instance is created with t3lib_div::makeInstance
See also:
callUserFunction()

Definition at line 5235 of file class.t3lib_div.php.

Here is the call graph for this function:

static gif_compress ( theFile,
type 
) [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. Usage: 9

Parameters:
stringFilepath
stringSee description of function
Returns:
string Returns "GD" if GD was used, otherwise "IM" if ImageMagick was used. If nothing done at all, it returns empty string.

Definition at line 493 of file class.t3lib_div.php.

Here is the call graph for this function:

static GParrayMerged ( var) [static]

Returns the global arrays $_GET and $_POST merged with $_POST taking precedence. Usage: 1

Parameters:
stringKey (variable name) from GET or POST vars
Returns:
array Returns the GET vars merged recursively onto the POST vars.
Deprecated:
since TYPO3 3.7, will be removed in TYPO3 4.6 - Use t3lib_div::_GPmerged instead
See also:
_GP()

Definition at line 445 of file class.t3lib_div.php.

Here is the call graph for this function:

static GPvar ( var,
strip = 0 
) [static]

Returns the value of incoming data from globals variable $_POST or $_GET, with priority to $_POST (that is equalent to 'GP' order). Strips slashes of string-outputs, but not arrays UNLESS $strip is set. If $strip is set all output will have escaped characters unescaped. Usage: 2

Parameters:
stringGET/POST var to return
booleanIf set, values are stripped of return values that are *arrays!* - string/integer values returned are always strip-slashed()
Returns:
mixed POST var named $var and if not set, the GET var of the same name.
Deprecated:
since TYPO3 3.6, will be removed in TYPO3 4.6 - Use t3lib_div::_GP instead (ALWAYS delivers a value with un-escaped values!)
See also:
_GP()

Definition at line 420 of file class.t3lib_div.php.

Here is the call graph for this function:

static hasValidClassPrefix ( classRef,
array additionalPrefixes = array() 
) [static]

Checks if a class or function has a valid prefix: tx_, Tx_ or custom, e.g. user_

Parameters:
string$classRefThe class or function to check
array$additionalPrefixesAdditional allowed prefixes, mostly this will be user_
Returns:
bool TRUE if name is allowed

Definition at line 5294 of file class.t3lib_div.php.

Here is the call graph for this function:

static hideIfNotTranslated ( l18n_cfg_fieldValue) [static]

Responds on input localization setting value whether the page it comes from should be hidden if no translation exists or not.

Parameters:
integerValue from "l18n_cfg" field of a page record
Returns:
boolean True if the page should be hidden

Definition at line 4652 of file class.t3lib_div.php.

static hmac ( input) [static]

Returns a proper HMAC on a given input string and secret TYPO3 encryption key.

Parameters:
stringInput string to create HMAC from
Returns:
string resulting (hexadecimal) HMAC currently with a length of 40 (HMAC-SHA-1)

Definition at line 1196 of file class.t3lib_div.php.

static htmlspecialchars_decode ( value) [static]

Inverse version of htmlspecialchars() Usage: 4

Parameters:
stringValue where >, <, " and & should be converted to regular chars.
Returns:
string Converted result.

Definition at line 1586 of file class.t3lib_div.php.

static imageMagickCommand ( command,
parameters,
path = '' 
) [static]

Compile the command for running ImageMagick/GraphicsMagick.

Parameters:
stringCommand to be run: identify, convert or combine/composite
stringThe parameters string
stringOverride the default path (e.g. used by the install tool)
Returns:
string Compiled command that deals with IM6 & GraphicsMagick

Definition at line 6128 of file class.t3lib_div.php.

Here is the caller graph for this function:

static implodeArrayForUrl ( name,
array theArray,
str = '',
skipBlank = FALSE,
rawurlencodeParamName = FALSE 
) [static]

Implodes a multidim-array into GET-parameters (eg. &param[key][key2]=value2&param[key][key3]=value3) Usage: 24

Parameters:
stringName prefix for entries. Set to blank if you wish none.
arrayThe (multidim) array to implode
string(keep blank)
booleanIf set, parameters which were blank strings would be removed.
booleanIf set, the param name itself (for example "param[key][key2]") would be rawurlencoded as well.
Returns:
string Imploded result, fx. &param[key][key2]=value2&param[key][key3]=value3
See also:
explodeUrl2Array()

Definition at line 2061 of file class.t3lib_div.php.

Here is the caller graph for this function:

static implodeAttributes ( array arr,
xhtmlSafe = FALSE,
dontOmitBlankAttribs = FALSE 
) [static]

Implodes attributes in the array $arr for an attribute list in eg. and HTML tag (with quotes) Usage: 14

Parameters:
arrayArray with attribute key/value pairs, eg. "bgcolor"=>"red", "border"=>0
booleanIf 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!
booleanIf true, don't check if values are blank. Default is to omit attributes with blank values.
Returns:
string Imploded attributes, eg. 'bgcolor="red" border="0"'

Definition at line 2429 of file class.t3lib_div.php.

Here is the call graph for this function:

Here is the caller graph for this function:

static implodeParams ( array arr,
xhtmlSafe = FALSE,
dontOmitBlankAttribs = FALSE 
) [static]

Implodes attributes in the array $arr for an attribute list in eg. and HTML tag (with quotes)

Parameters:
arraySee implodeAttributes()
booleanSee implodeAttributes()
booleanSee implodeAttributes()
Returns:
string See implodeAttributes()
Deprecated:
since TYPO3 3.7, will be removed in TYPO3 4.6 - Name was changed into implodeAttributes
See also:
implodeAttributes()

Definition at line 2458 of file class.t3lib_div.php.

Here is the call graph for this function:

static inArray ( array in_array,
item 
) [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 := t3lib_div::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 | +---------+-----------+-----------+-----------+ Usage: 3

Parameters:
arrayone-dimensional array of items
stringitem to check for
Returns:
boolean true if $item is in the one-dimensional array $in_array

Definition at line 1881 of file class.t3lib_div.php.

static initSysLog ( ) [static]

Initialize the system log.

Returns:
void
See also:
sysLog()

Definition at line 5841 of file class.t3lib_div.php.

Here is the call graph for this function:

static inList ( list,
item 
) [static]

Check for item in list Check if an item exists in a comma-separated list of items. Usage: 163

Parameters:
stringcomma-separated list of items (string)
stringitem to check for
Returns:
boolean true if $item is in $list

Definition at line 1040 of file class.t3lib_div.php.

static int_from_ver ( verNumberStr) [static]

Returns an integer from a three part version number, eg '4.12.3' -> 4012003 This method will be deprecated in TYPO3 4.6. You are encouraged to start using t3lib_utility_VersionNumber::convertVersionNumberToInteger() instead Usage: 2

Parameters:
stringVersion number on format x.x.x
Returns:
integer Integer version of version number (where each part can count to 999)
See also:
t3lib_utility_VersionNumber::convertVersionNumberToInteger()

Definition at line 1142 of file class.t3lib_div.php.

static intExplode ( delimiter,
string,
onlyNonEmptyValues = FALSE,
limit = 0 
) [static]

Explodes a $string delimited by $delim and passes each item in the array through intval(). Corresponds to t3lib_div::trimExplode(), but with conversion to integers for all values. Usage: 76

Parameters:
stringDelimiter string to explode with
stringThe string to explode
booleanIf set, all empty values (='') will NOT be set in output
integerIf positive, the result will contain a maximum of limit elements, if negative, all components except the last -limit are returned, if zero (default), the result is not limited at all
Returns:
array Exploded values, all converted to integers

Definition at line 1903 of file class.t3lib_div.php.

Here is the call graph for this function:

static intInRange ( theInt,
min,
max = 2000000000,
zeroValue = 0 
) [static]

Forces the integer $theInt into the boundaries of $min and $max. If the $theInt is 'false' then the $zeroValue is applied. Usage: 224

Parameters:
integerInput value
integerLower limit
integerHigher limit
integerDefault value if input is false.
Returns:
integer The input value forced into the boundaries of $min and $max

Definition at line 1102 of file class.t3lib_div.php.

Here is the caller graph for this function:

static intval_positive ( theInt) [static]

Returns the $integer if greater than zero, otherwise returns zero. Usage: 1

Parameters:
integerInteger string to process
Returns:
integer

Definition at line 1124 of file class.t3lib_div.php.

static IPv6Hex2Bin ( hex) [static]

Transform a regular IPv6 address from hex-representation into binary

Parameters:
string$hexIPv6 address in hex-presentation
Returns:
string Binary representation (16 characters, 128 characters)
See also:
normalizeIPv6()

Definition at line 844 of file class.t3lib_div.php.

Here is the call graph for this function:

Here is the caller graph for this function:

static isAbsPath ( path) [static]

Checks if the $path is absolute or relative (detecting either '/' or 'x:/' as first part of string) and returns true if so. Usage: 8

Parameters:
stringFilepath to evaluate
Returns:
boolean

Definition at line 4380 of file class.t3lib_div.php.

static isAllowedAbsPath ( path) [static]

Returns true if the path is absolute, without backpath '..' and within the PATH_site OR within the lockRootPath Usage: 5

Parameters:
stringFilepath to evaluate
Returns:
boolean

Definition at line 4397 of file class.t3lib_div.php.

static isBrokenEmailEnvironment ( ) [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().

TODO: 4.3 should have additional configuration variable, which is combined by || with the rest in this function.

Returns:
boolean true if mail() does not accept recipient name

Definition at line 1673 of file class.t3lib_div.php.

static isFirstPartOfStr ( str,
partStr 
) [static]

Returns true if the first part of $str matches the string $partStr Usage: 59

Parameters:
stringFull string to check
stringReference string which must be found as the "first part" of the full string
Returns:
boolean True if $partStr was found to be equal to the first part of $str

Definition at line 1417 of file class.t3lib_div.php.

static isOnCurrentHost ( url) [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.

Parameters:
string$url,:URL to compare with the TYPO3 request host
Returns:
boolean Whether the URL matches the TYPO3 request host

Definition at line 1027 of file class.t3lib_div.php.

static isValidUrl ( url) [static]

Checks if a given string is a Uniform Resource Locator (URL).

Parameters:
string$url,:The URL to be validated
Returns:
boolean Whether the given URL is valid

Definition at line 1847 of file class.t3lib_div.php.

static keepItemsInArray ( array array,
keepItems,
getValueFunc = NULL 
) [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 = create_function('$value', 'return $value[0];');

Returns: array( array('bb' => array('third', 'fourth'), )

Parameters:
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) Unique function name set by create_function() used to get the value to keep
Returns:
array The filtered/reduced array with the kept items

Definition at line 2025 of file class.t3lib_div.php.

Here is the call graph for this function:

static lcfirst ( string) [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"

Parameters:
string$string,:The string to be used to lowercase the first character
Returns:
string The string with the first character as lowercase

Definition at line 1837 of file class.t3lib_div.php.

Here is the call graph for this function:

Here is the caller graph for this function:

static linkThisScript ( array getParams = array()) [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) Usage: 52

Parameters:
arrayArray of GET parameters to include
Returns:
string

Definition at line 3854 of file class.t3lib_div.php.

Here is the call graph for this function:

static linkThisUrl ( url,
array getParams = array() 
) [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 Usage: 2

Parameters:
stringURL string
arrayArray of key/value pairs for get parameters to add/overrule with. Can be multidimensional.
Returns:
string Output URL with added getParams.

Definition at line 3880 of file class.t3lib_div.php.

Here is the call graph for this function:

static llXmlAutoFileName ( fileRef,
language 
) [static]

Returns auto-filename for locallang-XML localizations.

Parameters:
stringAbsolute file reference to locallang-XML file. Must be inside system/global/local extension
stringLanguage key
Returns:
string Returns the filename reference for the language unless error occured (or local mode is used) in which case it will be NULL

Definition at line 4973 of file class.t3lib_div.php.

Here is the call graph for this function:

Here is the caller graph for this function:

static loadTCA ( table) [static]

Loads the $TCA (Table Configuration Array) for the $table

Requirements: 1) must be configured table (the ctrl-section configured), 2) columns must not be an array (which it is always if whole table loaded), and 3) there is a value for dynamicConfigFile (filename in typo3conf)

Note: For the frontend this loads only 'ctrl' and 'feInterface' parts. For complete TCA use $GLOBALS['TSFE']->includeTCA() instead.

Usage: 84

Parameters:
stringTable name for which to load the full TCA array part into the global $TCA
Returns:
void

Definition at line 5024 of file class.t3lib_div.php.

static locationHeaderUrl ( path) [static]

Prefixes a URL used with 'header-location' with 'http://...' depending on whether it has it already.

  • If already having a scheme, nothing is prepended
  • If having REQUEST_URI slash '/', then prefixing 'http://[host]' (relative to host)
  • Otherwise prefixed with TYPO3_REQUEST_DIR (relative to current dir / TYPO3_REQUEST_DIR) Usage: 30
Parameters:
stringURL / path to prepend full URL addressing to.
Returns:
string

Definition at line 3575 of file class.t3lib_div.php.

Here is the call graph for this function:

static logDeprecatedFunction ( ) [static]

Logs a call to a deprecated function. The log message will be taken from the annotation.

Returns:
void

Definition at line 6065 of file class.t3lib_div.php.

Here is the call graph for this function:

Here is the caller graph for this function:

static makeInstance ( className) [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 = t3lib_div::makeInstance("myclass")" instead!

You can also pass arguments for a constructor: t3lib_div::makeInstance('myClass', $arg1, $arg2, ..., $argN)

Exceptions:
InvalidArgumentExceptionif classname is an empty string
Parameters:
string$classNamename of the class to instantiate, must not be empty
Returns:
object the created instance

Definition at line 5326 of file class.t3lib_div.php.

Here is the call graph for this function:

Here is the caller graph for this function:

static makeInstanceClassName ( className) [static]

Return classname for new instance Takes the class-extensions API of TYPO3 into account Usage: 17

Parameters:
stringBase Class name to evaluate
Returns:
string Final class name to instantiate with "new [classname]"
Deprecated:
since TYPO3 4.3, will be removed in TYPO3 4.6 - Use t3lib_div::makeInstance('myClass', $arg1, $arg2, ..., $argN)

Definition at line 5378 of file class.t3lib_div.php.

Here is the call graph for this function:

static makeInstanceService ( serviceType,
serviceSubType = '',
excludeServiceKeys = array() 
) [static]

Find the best service and check if it works. Returns object of the service class.

Parameters:
stringType of service (service key).
stringSub type like file extensions or similar. Defined by the service.
mixedList of service keys which should be exluded in the search for a service. Array or comma list.
Returns:
object The service object or an array with error info's.
Author:
René Fritz <r.fritz@colorcube.de>

Definition at line 5502 of file class.t3lib_div.php.

Here is the call graph for this function:

static makeRedirectUrl ( inUrl,
l = 0,
index_script_url = '' 
) [static]

Subfunction for substUrlsInPlainText() above. Usage: 2

Parameters:
stringInput URL
integerURL string length limit
stringURL of "index script" - the prefix of the "?RDCT=..." parameter. If not supplyed it will default to t3lib_div::getIndpEnv('TYPO3_REQUEST_DIR').'index.php'
Returns:
string Processed URL

Definition at line 5795 of file class.t3lib_div.php.

Here is the call graph for this function:

Here is the caller graph for this function:

static md5int ( str) [static]

Makes a positive integer hash out of the first 7 chars from the md5 hash of the input Usage: 5

Parameters:
stringString to md5-hash
Returns:
integer Returns 28bit integer-hash

Definition at line 1173 of file class.t3lib_div.php.

static milliseconds ( ) [static]

Gets the unixtime as milliseconds.

Returns:
integer The unixtime as milliseconds

Definition at line 4197 of file class.t3lib_div.php.

static minifyJavaScript ( script,
&$  error = '' 
) [static]

Minifies JavaScript

Parameters:
string$scriptScript to minify
string$errorError message (if any)
Returns:
string Minified script or source string if error happened

Definition at line 2960 of file class.t3lib_div.php.

Here is the call graph for this function:

static mkdir ( newFolder) [static]

Wrapper function for mkdir. Sets folder permissions according to $GLOBALS['TYPO3_CONF_VARS']['BE']['folderCreateMask'] and group ownership according to $GLOBALS['TYPO3_CONF_VARS']['BE']['createGroup']

Parameters:
stringAbsolute path to folder, see PHP mkdir() function. Removes trailing slash internally.
Returns:
boolean TRUE if went well!

Definition at line 3326 of file class.t3lib_div.php.

Here is the call graph for this function:

Here is the caller graph for this function:

static mkdir_deep ( destination,
deepDir 
) [static]

Creates a directory - including parent directories if necessary - in the file system

Parameters:
stringBase folder. This must exist! Must have trailing slash! Example "/root/typo3site/"
stringDeep directory to create, eg. "xx/yy/" which creates "/root/typo3site/xx/yy/" if $destination is "/root/typo3site/"
Returns:
string If error, returns error string.

Definition at line 3342 of file class.t3lib_div.php.

Here is the call graph for this function:

Here is the caller graph for this function:

static modifyHTMLColor ( color,
R,
G,
B 
) [static]

Modifies a HTML Hex color by adding/subtracting $R,$G and $B integers Usage: 11

Parameters:
stringA hexadecimal color code, #xxxxxx
integerOffset value 0-255
integerOffset value 0-255
integerOffset value 0-255
Returns:
string A hexadecimal color code, #xxxxxx, modified according to input vars
See also:
modifyHTMLColorAll()

Definition at line 1308 of file class.t3lib_div.php.

Here is the call graph for this function:

Here is the caller graph for this function:

static modifyHTMLColorAll ( color,
all 
) [static]

Modifies a HTML Hex color by adding/subtracting $all integer from all R/G/B channels Usage: 6

Parameters:
stringA hexadecimal color code, #xxxxxx
integerOffset value 0-255 for all three channels.
Returns:
string A hexadecimal color code, #xxxxxx, modified according to input vars
See also:
modifyHTMLColor()

Definition at line 1328 of file class.t3lib_div.php.

Here is the call graph for this function:

static naturalKeySortRecursive ( &$  array) [static]

Sorts an array by key recursive - uses natural sort order (aAbB-zZ)

Parameters:
array$arrayarray to be sorted recursively, passed by reference
Returns:
boolean TRUE if param is an array

Definition at line 2333 of file class.t3lib_div.php.

static normalizeIPv6 ( address) [static]

Normalize an IPv6 address to full length

Parameters:
stringGiven IPv6 address
Returns:
string Normalized address

Definition at line 860 of file class.t3lib_div.php.

Here is the caller graph for this function:

static normalizeMailAddress ( address) [static]

Changes from/to arguments for mail() function to work in any environment.

Parameters:
string$addressAddress to adjust
Returns:
string Adjusted address
See also:
t3lib_::isBrokenEmailEnvironment()

Definition at line 1684 of file class.t3lib_div.php.

Here is the caller graph for this function:

static plainMailEncoded ( email,
subject,
message,
headers = '',
encoding = 'quoted-printable',
charset = '',
dontEncodeHeader = FALSE 
) [static]

Simple substitute for the PHP function mail() which allows you to specify encoding and character set The fifth parameter ($encoding) will allow you to specify 'base64' encryption for the output (set $encoding=base64) Further the output has the charset set to ISO-8859-1 by default. Usage: 4

Parameters:
stringEmail address to send to. (see PHP function mail())
stringSubject line, non-encoded. (see PHP function mail())
stringMessage content, non-encoded. (see PHP function mail())
stringHeaders, separated by LF
stringEncoding type: "base64", "quoted-printable", "8bit". Default value is "quoted-printable".
stringCharset used in encoding-headers (only if $encoding is set to a valid value which produces such a header)
booleanIf set, the header content will not be encoded.
Returns:
boolean True if mail was accepted for delivery, false otherwise

Definition at line 5589 of file class.t3lib_div.php.

Here is the call graph for this function:

static png_to_gif_by_imagemagick ( theFile) [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. Usage: 5

Parameters:
string$theFilethe filename with path
Returns:
string new filename

Definition at line 532 of file class.t3lib_div.php.

Here is the call graph for this function:

static print_array ( array_in) [static]

Prints an array Usage: 6

Parameters:
mixedArray to print visually (in a table).
Returns:
void
See also:
view_array()
Deprecated:
since TYPO3 4.5 - Use t3lib_utility_Debug::printArray instead

Definition at line 3777 of file class.t3lib_div.php.

Here is the call graph for this function:

static purgeInstances ( ) [static]

Purge all instances returned by makeInstance.

This function is most useful when called from tearDown in a testcase 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!

See also:
makeInstance
Returns:
void

Definition at line 5487 of file class.t3lib_div.php.

static quoted_printable ( string,
maxlen = 76 
) [static]

Implementation of quoted-printable encode. This functions is buggy. It seems that in the part where the lines are breaked every 76th character, that it fails if the break happens right in a quoted_printable encode character! See RFC 1521, section 5.1 Quoted-Printable Content-Transfer-Encoding Usage: 2

Parameters:
stringContent to encode
integerLength of the lines, default is 76
Returns:
string The QP encoded string

Definition at line 5662 of file class.t3lib_div.php.

Here is the caller graph for this function:

static quoteJSvalue ( value,
withinCData = FALSE 
) [static]

Quotes a string for usage as JS parameter. Depends whether the value is used in script tags (it doesn't need/must not get htmlspecialchar'ed in this case).

Parameters:
string$valuethe string to encode, may be empty
boolean$withinCDatawhether the escaped data is expected to be used as CDATA and thus does not need to be htmlspecialchared
Returns:
string the encoded value already quoted (with single quotes), will not be empty

Definition at line 6183 of file class.t3lib_div.php.

static rawUrlEncodeFP ( str) [static]

rawurlencode which preserves "/" chars Usefull when filepaths should keep the "/" chars, but have all other special chars encoded. Usage: 5

Parameters:
stringInput string
Returns:
string Output string

Definition at line 1641 of file class.t3lib_div.php.

static rawUrlEncodeJS ( str) [static]

Version of rawurlencode() where all spaces (%20) are re-converted to space-characters. Usefull when passing text to JavaScript where you simply url-encode it to get around problems with syntax-errors, linebreaks etc. Usage: 4

Parameters:
stringString to raw-url-encode with spaces preserved
Returns:
string Rawurlencoded result of input string, but with all %20 (space chars) converted to real spaces.

Definition at line 1629 of file class.t3lib_div.php.

static read_png_gif ( theFile,
output_png = 0 
) [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. Usage: 2

Parameters:
stringFilepath of image file
booleanIf set, then input file is converted to PNG, otherwise to GIF
Returns:
string If the new image file exists, it's filepath is returned

Definition at line 559 of file class.t3lib_div.php.

Here is the call graph for this function:

static readLLfile ( fileRef,
langKey,
charset = '',
errorMode = 0 
) [static]

Includes a locallang file and returns the $LOCAL_LANG array found inside.

Parameters:
stringInput is a file-reference (see t3lib_div::getFileAbsFileName). That file is expected to be a 'locallang.php' file containing a $LOCAL_LANG array (will be included!) or a 'locallang.xml' file conataining a valid XML TYPO3 language structure.
stringLanguage key
stringCharacter set (option); if not set, determined by the language key
integerError mode (when file could not be found): 0 - syslog entry, 1 - do nothing, 2 - throw an exception
Returns:
array Value of $LOCAL_LANG found in the included file. If that array is found it will returned. Otherwise an empty array and it is FALSE in error case.

Definition at line 4670 of file class.t3lib_div.php.

Here is the call graph for this function:

static readLLPHPfile ( fileRef,
langKey,
charset = '' 
) [static]

Includes a locallang-php file and returns the $LOCAL_LANG array Works only when the frontend or backend has been initialized with a charset conversion object. See first code lines.

Parameters:
stringAbsolute reference to locallang-PHP file
stringTYPO3 language key, eg. "dk" or "de" or "default"
stringCharacter set (optional)
Returns:
array LOCAL_LANG array in return.

Definition at line 4734 of file class.t3lib_div.php.

Here is the call graph for this function:

Here is the caller graph for this function:

static readLLXMLfile ( fileRef,
langKey,
charset = '' 
) [static]

Includes a locallang-xml file and returns the $LOCAL_LANG array Works only when the frontend or backend has been initialized with a charset conversion object. See first code lines.

Parameters:
stringAbsolute reference to locallang-XML file
stringTYPO3 language key, eg. "dk" or "de" or "default"
stringCharacter set (optional)
Returns:
array LOCAL_LANG array in return.

Definition at line 4817 of file class.t3lib_div.php.

Here is the call graph for this function:

Here is the caller graph for this function:

remapArrayKeys ( &$  array,
mappingTable 
)

Rename Array keys with a given mapping table

Parameters:
arrayArray by reference which should be remapped
arrayArray with remap information, array/$oldKey => $newKey)

Definition at line 2190 of file class.t3lib_div.php.

static removeArrayEntryByValue ( array array,
cmpValue 
) [static]

Removes the value $cmpValue from the $array if found there. Returns the modified array Usage: 3

Parameters:
arrayArray containing the values
stringValue to search for and if found remove array entry where found.
Returns:
array Output array with entries removed if search string is found

Definition at line 1991 of file class.t3lib_div.php.

static removeDotsFromTS ( array ts) [static]

Removes dots "." from end of a key identifier of TypoScript styled array. array('key.' => array('property.' => 'value')) --> array('key' => array('property' => 'value'))

Parameters:
array$ts,:TypoScript configuration array
Returns:
array TypoScript configuration array without dots at the end of all keys

Definition at line 2314 of file class.t3lib_div.php.

static removePrefixPathFromList ( array fileArr,
prefixToRemove 
) [static]

Removes the absolute part of all files/folders in fileArr Usage: 2

Parameters:
array$fileArr,:The file array to remove the prefix from
string$prefixToRemove,:The prefix path to remove (if found as first part of string!)
Returns:
array The input $fileArr processed.

Definition at line 3515 of file class.t3lib_div.php.

static removeXSS ( string) [static]

Wrapper for the RemoveXSS function. Removes potential XSS code from an input string.

Using an external class by Travis Puderbaugh <kallahar@quickwired.com>

Parameters:
stringInput string
Returns:
string Input string with potential XSS code removed

Definition at line 460 of file class.t3lib_div.php.

static requireFile ( requireFile) [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)

Parameters:
string$requireFile,:Path of the file to be included
Returns:
void

Definition at line 5569 of file class.t3lib_div.php.

static requireOnce ( requireFile) [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)

Definition at line 5555 of file class.t3lib_div.php.

Here is the caller graph for this function:

static resolveAllSheetsInDS ( array dataStructArray) [static]

Resolves ALL sheet definitions in dataStructArray If no sheet is found, then the default "sDEF" will be created with the dataStructure inside.

Parameters:
arrayInput data structure, possibly with a sheet-definition and references to external data source files.
Returns:
array Output data structure with all sheets resolved as arrays.

Definition at line 5090 of file class.t3lib_div.php.

Here is the call graph for this function:

static resolveBackPath ( pathStr) [static]

Resolves "../" sections in the input path string. For example "fileadmin/directory/../other_directory/" will be resolved to "fileadmin/other_directory/" Usage: 2

Parameters:
stringFile path in which "/../" is resolved
Returns:
string

Definition at line 3545 of file class.t3lib_div.php.

Here is the caller graph for this function:

static resolveSheetDefInDS ( dataStructArray,
sheet = 'sDEF' 
) [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. Usage: 5

Parameters:
arrayInput data structure, possibly with a sheet-definition and references to external data source files.
stringThe sheet to return, preferably.
Returns:
array An array with two num. keys: key0: The data structure is returned in this key (array) UNLESS an error happend in which case an error string is returned (string). key1: The used sheet key value!

Definition at line 5053 of file class.t3lib_div.php.

Here is the call graph for this function:

Here is the caller graph for this function:

static revExplode ( delimiter,
string,
count = 0 
) [static]

Reverse explode which explodes the string counting from behind. Thus t3lib_div::revExplode(':','my:words:here',2) will return array('my:words','here') Usage: 8

Parameters:
stringDelimiter string to explode with
stringThe string to explode
integerNumber of array entries
Returns:
array Exploded values

Definition at line 1918 of file class.t3lib_div.php.

Here is the caller graph for this function:

static rm_endcomma ( string) [static]

Removes comma (if present) in the end of string Usage: 2

Parameters:
stringString from which the comma in the end (if any) will be removed.
Returns:
string
Deprecated:
since TYPO3 4.5, will be removed in TYPO3 4.7 - Use rtrim() directly

Definition at line 1340 of file class.t3lib_div.php.

Here is the call graph for this function:

static rmdir ( path,
removeNonEmpty = FALSE 
) [static]

Wrapper function for rmdir, allowing recursive deletion of folders and files

Parameters:
stringAbsolute path to folder, see PHP rmdir() function. Removes trailing slash internally.
booleanAllow deletion of non-empty directories
Returns:
boolean true if went well!

Definition at line 3363 of file class.t3lib_div.php.

static rmFromList ( element,
list 
) [static]

Removes an item from a comma-separated list of items. Usage: 1

Parameters:
stringelement to remove
stringcomma-separated list of items (string)
Returns:
string new comma-separated list of items

Definition at line 1052 of file class.t3lib_div.php.

static sanitizeLocalUrl ( url = '') [static]

Checks if a given string is a valid frame URL to be loaded in the backend.

Parameters:
string$urlpotential URL to check
Returns:
string either $url if $url is considered to be harmless, or an empty string otherwise

Definition at line 4440 of file class.t3lib_div.php.

Here is the call graph for this function:

static setSingletonInstance ( className,
t3lib_Singleton $  instance 
) [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 a helper method for unit tests. Do not call this directly in production code!

See also:
makeInstance
Parameters:
string$classNamethe name of the class to set, must not be empty
t3lib_Singleton$instancethe instance to set, must be an instance of $className
Returns:
void

Definition at line 5416 of file class.t3lib_div.php.

Here is the call graph for this function:

static shortMD5 ( input,
len = 10 
) [static]

Returns the first 10 positions of the MD5-hash (changed from 6 to 10 recently)

Usage: 37

Parameters:
stringInput string to be md5-hashed
integerThe string-length of the output
Returns:
string Substring of the resulting md5-hash, being $len chars long (from beginning)

Definition at line 1186 of file class.t3lib_div.php.

Here is the caller graph for this function:

static slashArray ( array arr,
cmd 
) [static]

Either slashes ($cmd=add) or strips ($cmd=strip) array $arr depending on $cmd Usage: 0

Parameters:
arrayMultidimensional input array
string"add" or "strip", depending on usage you wish.
Returns:
array

Definition at line 2175 of file class.t3lib_div.php.

Here is the call graph for this function:

static slashJS ( string,
extended = 0,
char = "'" 
) [static]

This function is used to escape any ' -characters when transferring text to JavaScript! Usage: 3

Parameters:
stringString to escape
booleanIf set, also backslashes are escaped.
stringThe character to escape, default is ' (single-quote)
Returns:
string Processed input string

Definition at line 1614 of file class.t3lib_div.php.

static split_fileref ( fileref) [static]

Splits a reference to a file in 5 parts Usage: 43

Parameters:
stringFilename/filepath to be analysed
Returns:
array Contains keys [path], [file], [filebody], [fileext], [realFileext]

Definition at line 1253 of file class.t3lib_div.php.

Here is the call graph for this function:

static split_tag_attributes ( tag) [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 Usage: 2

Parameters:
stringHTML-tag string (or attributes only)
Returns:
array Array with the attribute values.

Definition at line 2394 of file class.t3lib_div.php.

Here is the caller graph for this function:

static splitCalc ( string,
operators 
) [static]

This splits a string by the chars in $operators (typical /+-*) and returns an array with them in Usage: 2

Parameters:
stringInput string, eg "123 + 456 / 789 - 4"
stringOperators to split by, typically "/+-*"
Returns:
array Array with operators and operands separated.
See also:
tslib_cObj::calc(), tslib_gifBuilder::calcOffset()

Definition at line 1478 of file class.t3lib_div.php.

static stdAuthCode ( uid_or_record,
fields = '',
codeLength = 8 
) [static]

Standard authentication code (used in Direct Mail, checkJumpUrl and setfixed links computations) Usage: 2

Parameters:
mixedUid (integer) or record (array)
stringList of fields from the record if that is given.
integerLength of returned authentication code.
Returns:
string MD5 hash of 8 chars.

Definition at line 4559 of file class.t3lib_div.php.

Here is the call graph for this function:

static stripSlashesOnArray ( array &$  theArray) [static]

StripSlash array This function traverses a multidimentional array and strips slashes to the values. NOTE that the input array is and argument by reference.!! Twin-function to addSlashesOnArray Usage: 10

Parameters:
arrayMultidimensional input array, (REFERENCE!)
Returns:
array

Definition at line 2155 of file class.t3lib_div.php.

Here is the caller graph for this function:

static strtolower ( str) [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.

Parameters:
stringInput string
Returns:
string Lowercase String

Definition at line 1727 of file class.t3lib_div.php.

Here is the caller graph for this function:

static strtoupper ( str) [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.

Parameters:
stringInput string
Returns:
string Uppercase String

Definition at line 1714 of file class.t3lib_div.php.

Here is the caller graph for this function:

static substUrlsInPlainText ( message,
urlmode = '76',
index_script_url = '' 
) [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. Usage: 3

Parameters:
stringMessage content
stringURL mode; "76" or "all"
stringURL of index script (see makeRedirectUrl())
Returns:
string Processed message content
See also:
makeRedirectUrl()

Definition at line 5760 of file class.t3lib_div.php.

Here is the call graph for this function:

static tempnam ( filePrefix) [static]

Create temporary filename (Create file with unique file name) This function should be used for getting temporary filenames - will make your applications safe for open_basedir = on REMEMBER to delete the temporary files after use! This is done by t3lib_div::unlink_tempfile() Usage: 7

Parameters:
stringPrefix to temp file (which will have no extension btw)
Returns:
string result from PHP function tempnam() with PATH_site.'typo3temp/' set for temp path.
See also:
unlink_tempfile(), upload_to_tempfile()

Definition at line 4546 of file class.t3lib_div.php.

Here is the caller graph for this function:

static testInt ( var) [static]

Tests if the input can be interpreted as integer.

Parameters:
mixedAny input variable to test
Returns:
boolean Returns true if string is an integer

Definition at line 1402 of file class.t3lib_div.php.

static trimExplode ( delim,
string,
removeEmptyValues = FALSE,
limit = 0 
) [static]

Explodes a string and trims all values for whitespace in the ends. If $onlyNonEmptyValues is set, then all blank ('') values are removed. Usage: 256

Parameters:
stringDelimiter string to explode with
stringThe string to explode
booleanIf set, all empty values will be removed in output
integerIf positive, the result will contain a maximum of $limit elements, if negative, all components except the last -$limit are returned, if zero (default), the result is not limited at all. Attention though that the use of this parameter can slow down this function.
Returns:
array Exploded values

Definition at line 1940 of file class.t3lib_div.php.

Here is the caller graph for this function:

static underscoredToLowerCamelCase ( string) [static]

Returns a given string with underscores as lowerCamelCase. Example: Converts minimal_value to minimalValue

Parameters:
string$string,:String to be converted to camel case
Returns:
string lowerCamelCasedWord

Definition at line 1813 of file class.t3lib_div.php.

Here is the call graph for this function:

static underscoredToUpperCamelCase ( string) [static]

Returns a given string with underscores as UpperCamelCase. Example: Converts blog_example to BlogExample

Parameters:
string$string,:String to be converted to camel case
Returns:
string UpperCamelCasedWord

Definition at line 1801 of file class.t3lib_div.php.

static uniqueArray ( array valueArray) [static]

Remove duplicate values from an array Usage: 0

Parameters:
arrayArray of values to make unique
Returns:
array
Deprecated:
since TYPO3 3.5, will be removed in TYPO3 4.6 - Use the PHP function array_unique instead

Definition at line 1977 of file class.t3lib_div.php.

Here is the call graph for this function:

static uniqueList ( in_list,
secondParameter = NULL 
) [static]

Takes comma-separated lists and arrays and removes all duplicates If a value in the list is trim(empty), the value is ignored. Usage: 16

Parameters:
stringAccept multiple parameters wich can be comma-separated lists of values and arrays.
mixed$secondParameter,:Dummy field, which if set will show a warning!
Returns:
string Returns the list without any duplicates of values, space around values are trimmed

Definition at line 1229 of file class.t3lib_div.php.

static unlink_tempfile ( uploadedTempFileName) [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! Usage: 9

Parameters:
stringFilepath for a file in PATH_site."typo3temp/". Must be absolute.
Returns:
boolean Returns true if the file was unlink()'ed
See also:
upload_to_tempfile(), tempnam()

Definition at line 4528 of file class.t3lib_div.php.

static unQuoteFilenames ( parameters,
unQuote = FALSE 
) [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.

Parameters:
stringThe whole parameters string
booleanIf set, the elements of the resulting array are unquoted.
Returns:
array Exploded parameters

Definition at line 6139 of file class.t3lib_div.php.

static upload_copy_move ( source,
destination 
) [static]

Moves $source file to $destination if uploaded, otherwise try to make a copy Usage: 4

Parameters:
stringSource file, absolute path
stringDestination file, absolute path
Returns:
boolean Returns true if the file was moved. Dennis Petersen <fessor@software.dk>
See also:
upload_to_tempfile()

Definition at line 4484 of file class.t3lib_div.php.

Here is the call graph for this function:

static upload_to_tempfile ( uploadedFileName) [static]

Will move an uploaded file (normally in "/tmp/xxxxx") to a temporary filename in PATH_site."typo3temp/" from where TYPO3 can use it under safe_mode. Use this function to move uploaded files to where you can work on them. REMEMBER to use t3lib_div::unlink_tempfile() afterwards - otherwise temp-files will build up! They are NOT automatically deleted in PATH_site."typo3temp/"! Usage: 6

Parameters:
stringThe temporary uploaded filename, eg. $_FILES['[upload field name here]']['tmp_name']
Returns:
string If a new file was successfully created, return its filename, otherwise blank string.
See also:
unlink_tempfile(), upload_copy_move()

Definition at line 4510 of file class.t3lib_div.php.

Here is the call graph for this function:

static validEmail ( email) [static]

Checking syntax of input email address Usage: 5

Parameters:
stringInput string to evaluate
Returns:
boolean Returns true if the $email address (input string) is valid

Definition at line 1652 of file class.t3lib_div.php.

static validIP ( ip) [static]

Validate a given IP address.

Possible format are IPv4 and IPv6.

Parameters:
stringIP address to be tested
Returns:
boolean True if $ip is either of IPv4 or IPv6 format.

Definition at line 921 of file class.t3lib_div.php.

static validIPv4 ( ip) [static]

Validate a given IP address to the IPv4 address format.

Example for possible format: 10.0.45.99

Parameters:
stringIP address to be tested
Returns:
boolean True if $ip is of IPv4 format.

Definition at line 933 of file class.t3lib_div.php.

static validIPv6 ( ip) [static]

Validate a given IP address to the IPv6 address format.

Example for possible format: 43FB::BB3F:A0A0:0 | ::1

Parameters:
stringIP address to be tested
Returns:
boolean True if $ip is of IPv6 format.

Definition at line 945 of file class.t3lib_div.php.

static validPathStr ( theFile) [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. Usage: 14

Parameters:
stringFilepath to evaluate
Returns:
boolean TRUE, $theFile is allowed path string
See also:
http://php.net/manual/en/security.filesystem.nullbytes.php
Todo:
Possible improvement: Should it rawurldecode the string first to check if any of these characters is encoded ?

Definition at line 4367 of file class.t3lib_div.php.

Here is the caller graph for this function:

static verifyFilenameAgainstDenyPattern ( filename) [static]

Verifies the input filename againts the 'fileDenyPattern'. Returns true if OK. Usage: 2

Parameters:
stringFilepath to evaluate
Returns:
boolean

Definition at line 4416 of file class.t3lib_div.php.

static view_array ( array_in) [static]

Returns HTML-code, which is a visual representation of a multidimensional array use t3lib_div::print_array() in order to print an array Returns false if $array_in is not an array Usage: 31

Parameters:
mixedArray to view
Returns:
string HTML output
Deprecated:
since TYPO3 4.5 - Use t3lib_utility_Debug::viewArray instead

Definition at line 3763 of file class.t3lib_div.php.

Here is the call graph for this function:

static wrapJS ( string,
linebreak = TRUE 
) [static]

Wraps JavaScript code XHTML ready with <script>-tags Automatic re-identing of the JS code is done by using the first line as ident reference. This is nice for identing JS code with PHP code on the same level.

Parameters:
stringJavaScript code
booleanWrap script element in linebreaks? Default is TRUE.
Returns:
string The wrapped JS code, ready to put into a XHTML page
Author:
Ingmar Schlecht <ingmars@web.de>
René Fritz <r.fritz@colorcube.de>

Definition at line 2475 of file class.t3lib_div.php.

static writeFile ( file,
content 
) [static]

Writes $content to the file $file Usage: 30

Parameters:
stringFilepath to write to
stringContent to write
Returns:
boolean True if the file was successfully opened and written to.

Definition at line 3177 of file class.t3lib_div.php.

Here is the call graph for this function:

Here is the caller graph for this function:

static writeFileToTypo3tempDir ( filepath,
content 
) [static]

Writes $content to a filename in the typo3temp/ folder (and possibly one or two subfolders...) Accepts an additional subdirectory in the file path!

Parameters:
stringAbsolute filepath to write to inside "typo3temp/". First part of this string must match PATH_site."typo3temp/"
stringContent string to write
Returns:
string Returns NULL on success, otherwise an error string telling about the problem.

Definition at line 3266 of file class.t3lib_div.php.

Here is the call graph for this function:

Here is the caller graph for this function:

static xml2array ( string,
NSprefix = '',
reportDocTag = FALSE 
) [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 Usage: 17

Parameters:
stringXML content to convert into an array
stringThe tag-prefix resolve, eg. a namespace like "T3:"
booleanIf set, the document tag will be set in the key "_DOCUMENT_TAG" of the output array
Returns:
mixed If the parsing had errors, a string with the error message is returned. Otherwise an array with the content.
See also:
array2xml(),xml2arrayProcess()
Author:
Fabrizio Branca <typo3@fabrizio-branca.de> (added caching)

Definition at line 2755 of file class.t3lib_div.php.

Here is the call graph for this function:

Here is the caller graph for this function:

xml2arrayProcess ( string,
NSprefix = '',
reportDocTag = FALSE 
) [protected]

Converts an XML string to a PHP array. This is the reverse function of array2xml() Usage: 1

Parameters:
stringXML content to convert into an array
stringThe tag-prefix resolve, eg. a namespace like "T3:"
booleanIf set, the document tag will be set in the key "_DOCUMENT_TAG" of the output array
Returns:
mixed If the parsing had errors, a string with the error message is returned. Otherwise an array with the content.
See also:
array2xml()

Definition at line 2789 of file class.t3lib_div.php.

Here is the caller graph for this function:

static xml2tree ( string,
depth = 999 
) [static]

Parses XML input into a PHP array with associative keys Usage: 0

Parameters:
stringXML data input
integerNumber of element levels to resolve the XML into an array. Any further structure will be set as XML.
Returns:
mixed The array with the parsed structure unless the XML parser returns with an error in which case the error message string is returned.
Author:
bisqwit at iki dot fi dot not dot for dot ads dot invalid / http://dk.php.net/xml_parse_into_struct + kasperYYYY@typo3.com

Definition at line 2506 of file class.t3lib_div.php.

Here is the call graph for this function:

static xmlGetHeaderAttribs ( xmlData) [static]

Extracts the attributes (typically encoding and version) of an XML prologue (header). Usage: 1

Parameters:
stringXML data
Returns:
array Attributes of the xml prologue (header)

Definition at line 2946 of file class.t3lib_div.php.

Here is the call graph for this function:

static xmlRecompileFromStructValArray ( array vals) [static]

This implodes an array of XML parts (made with xml_parse_into_struct()) into XML again. Usage: 2

Parameters:
arrayA array of XML parts, see xml2tree
Returns:
string Re-compiled XML data.

Definition at line 2898 of file class.t3lib_div.php.

Here is the caller graph for this function:


Field Documentation

$finalClassNameRegister = array() [static, protected]

Definition at line 259 of file class.t3lib_div.php.

$nonSingletonInstances = array() [static, protected]

Definition at line 252 of file class.t3lib_div.php.

$singletonInstances = array() [static, protected]

Definition at line 245 of file class.t3lib_div.php.

Definition at line 236 of file class.t3lib_div.php.

Definition at line 237 of file class.t3lib_div.php.

Definition at line 233 of file class.t3lib_div.php.

Definition at line 234 of file class.t3lib_div.php.

Definition at line 235 of file class.t3lib_div.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations