Method | Description | |
---|---|---|
addslashes_deep ( $value ) : addslashes | Add slash for variable & array | |
append_params ( $array, $separator = '&', $parent = '' ) : string | Converts an array of parameters into a query string to be appended to a URL. | |
backtrace ( $log = 'php-errors', $hide = '', array $skip = [] ) : string | Generate a Backtrace | |
canUseImapPop ( ) : boolean | Determine if Imap/Pop is usable checking extension existence | |
canUseLdap ( ) : boolean | Determine if Ldap is usable checking ldap extension existence | |
checkMemoryLimit ( ) | Check is current memory_limit is enough for GLPI | |
checkNewVersionAvailable ( $auto = true, $messageafterredirect = false ) : string | Check if new version is available | |
checkSELinux ( $fordebug = false ) : integer | Check SELinux configuration | |
checkValidReferer ( ) : nothing | Check valid referer accessing GLPI | |
cleanDecimal ( $decimal ) : clean | Clean decimal value (strip all chars not - and spaces ) | |
cleanInteger ( $integer ) : clean | Clean integer value (strip all chars not - and spaces ) | |
cleanNewLines ( $string ) : clean | Clean new lines of a string | |
clean_cross_side_scripting_deep ( $value ) : clean | Prevent from XSS Clean code | |
commonCheckForUseGLPI ( ) : 2 | Common Checks needed to use GLPI | |
constructMailServerConfig ( $input ) | ||
createSchema ( $lang = 'en_GB' ) : nothing | Create the GLPI default schema | |
decodeArrayFromInput ( $value ) : string | Decode array passed on an input form | |
decodeFromUtf8 ( $string, $to_charset = "ISO-8859-1" ) : converted | Decode string from UTF-8 to specified charset | |
decrypt ( $string, $key ) : decrypted | Decrypt a string | |
deleteDir ( $dir ) | Delete a directory and file contains in it | |
encodeInUtf8 ( $string, $from_charset = "ISO-8859-1" ) : utf8 | Encode string to UTF-8 | |
encrypt ( $string, $key ) : encrypted | Encrypt a string | |
filesizeDirectory ( $path ) : size | Get the filesize of a complete directory (from php.net) | |
getDaysOfWeekArray ( ) | ||
getItemTypeFormURL ( $itemtype, $full = true ) | Get form URL for itemtype | |
getItemTypeSearchURL ( $itemtype, $full = true ) | Get search URL for itemtype | |
getItemTypeTabsURL ( $itemtype, $full = true ) | Get ajax tabs url for itemtype | |
getMemoryLimit ( $ininame = 'memory_limit' ) : memory | Compute PHP memory_limit | |
getMime ( $file, $type = false ) : string | Retrieve the mime type of a file | |
getMonthsOfYearArray ( ) | ||
getRandomString ( integer $length, boolean $high = false ) : random | Get a random string | |
getSize ( $size ) : formatted | Format a size passing a size in octet | |
getTimestampTimeUnits ( $time ) : string | Split timestamp in time units | |
getURLContent ( $url, &$msgerr = NULL, $rec ) : content | Get a web page. Use proxy if configured | |
get_magic_quotes_gpc ( ) : boolean | Wrapper for get_magic_quotes_gpc - deprecated | |
get_magic_quotes_runtime ( ) : boolean | Wrapper for get_magic_quotes_runtime - deprecated | |
get_max_input_vars ( ) : integer | Wrapper for max_input_vars | |
inArrayCaseCompare ( $string, $datas = [] ) : boolean | Do a in_array search comparing string using strcasecmp | |
in_array_recursive ( mixed $needle, array $haystack, $strict = false ) : boolean | Summary of in_array_recursive | |
is_a ( $object, $class_name ) : true | Check if the given object is of the type $class_name. Can be identical or a subclass. | |
key_exists_deep ( $need, $tab ) | ||
logDebug ( ) | Log in 'php-errors' all args | |
logInFile ( $name, $text, $force = false ) | Log a message in log file | |
manageBeginAndEndPlanDates ( &$data ) : processed | Manage planning posted datas (must have begin + duration or end) Compute end if duration is set | |
manageRedirect ( $where ) | Manage login redirection | |
parseMailServerConnectString ( $value, $forceport = false ) : array | Parse imap open connect string | |
prepareArrayForInput ( array $value ) : string | Prepare array passed on an input form | |
removeHtmlSpecialChars ( string $string ) : string | Remove accentued characters and return lower case string | |
resizePicture ( $source_path, $dest_path, $new_width = 71, $new_height = 71, $img_y, $img_x, $img_width, $img_height, $max_size = 500 ) : boolean | Resize a picture to the new size | |
return_bytes_from_ini_vars ( $val ) | Convert a value in byte, kbyte, megabyte etc. | |
sanitize ( array $array ) : array | Sanitize received values | |
seems_utf8 ( $str ) : boolean | Is a string seems to be UTF-8 one ? | |
sendFile ( $file, $filename, $mime = null ) : nothing | Send a file (not a document) to the navigator See Document->send(); | |
setDebugMode ( $mode = NULL, $debug_sql = NULL, $debug_vars = NULL, $log_in_files = NULL ) | Switch error mode for GLPI | |
shortcut ( $str, $shortcut ) : string | to underline shortcut letter | |
showMailServerConfig ( $value ) : String | Display a mail server configuration form | |
slugify ( string $string ) : string | Slugify | |
str_pad ( $input, $pad_length, $pad_string = " ", $pad_type = STR_PAD_RIGHT ) : string | Replace str_pad() who bug with utf8 | |
stripslashes_deep ( $value ) : stripslashes | Strip slash for variable & array | |
strlen ( $str ) : length | strlen function for utf8 string | |
strpos ( $str, $tofound, $offset ) : substring | substr function for utf8 string | |
strtolower ( $str ) : lower | strtolower function for utf8 string | |
strtoupper ( $str ) : upper | strtoupper function for utf8 string | |
substr ( $str, $start, $length ) : substring | substr function for utf8 string | |
testWriteAccessToDirectory ( $dir ) : 2 | Check Write Access to a directory | |
ucfirst ( $str ) : string | Convert first caracter in upper | |
unclean_cross_side_scripting_deep ( $value ) : unclean | Invert fonction from clean_cross_side_scripting_deep | |
unclean_html_cross_side_scripting_deep ( $value ) : unclean | Invert fonction from clean_cross_side_scripting_deep to display HTML striping XSS code | |
userErrorHandlerDebug ( $errno, $errmsg, $filename, $linenum, $vars ) | Specific error handler in Debug mode | |
userErrorHandlerNormal ( $errno, $errmsg, $filename, $linenum, $vars ) | Specific error handler in Normal mode | |
writeConfig ( $name, $content ) : boolean | Save a configuration file |
static public addslashes_deep ( $value ) : addslashes | ||
$value | array or string: value to add slashes (array or string) | |
return | addslashes | value |
static public append_params ( $array, $separator = '&', $parent = '' ) : string | ||
$array | array parameters to append to the query string. | |
$separator | separator may be defined as & to display purpose (default '&') | |
$parent | This should be left blank (it is used internally by the function). (default '') | |
return | string | : Query string to append to a URL. |
static public backtrace ( $log = 'php-errors', $hide = '', array $skip = [] ) : string | ||
$log | String log file name (default php-errors) if false, return the strung | |
$hide | String call to hide (but display script/line) (default '') | |
$skip | array | Array of call to not display at all |
return | string | if $log is false |
static public canUseImapPop ( ) : boolean | ||
return | boolean |
static public canUseLdap ( ) : boolean | ||
return | boolean |
static public checkMemoryLimit ( ) |
static public checkNewVersionAvailable ( $auto = true, $messageafterredirect = false ) : string | ||
$auto | boolean: check done autically ? (if not display result) (true by default) | |
$messageafterredirect | boolean: use message after redirect instead of display (false by default) | |
return | string | explaining the result |
static public checkSELinux ( $fordebug = false ) : integer | ||
$fordebug | Boolean true is displayed in system information @return integer 0: OK, 1:Warning, 2:Error | |
return | integer |
static public checkValidReferer ( ) : nothing | ||
return | nothing | : display error if not permit |
static public cleanDecimal ( $decimal ) : clean | ||
$decimal | string float string | |
return | clean | integer |
static public cleanInteger ( $integer ) : clean | ||
$integer | string integer string | |
return | clean | integer |
static public cleanNewLines ( $string ) : clean | ||
$string | string string to clean | |
return | clean | string |
static public clean_cross_side_scripting_deep ( $value ) : clean | ||
$value | array or string: item to prevent (array or string) | |
return | clean | item |
static public commonCheckForUseGLPI ( ) : 2 | ||
return | 2 |
static public constructMailServerConfig ( $input ) | ||
$input |
static public createSchema ( $lang = 'en_GB' ) : nothing | ||
$lang | ||
return | nothing |
static public decodeArrayFromInput ( $value ) : string | ||
$value | string encoded value | |
return | string | decoded array |
static public decodeFromUtf8 ( $string, $to_charset = "ISO-8859-1" ) : converted | ||
$string | string string to convert | |
$to_charset | string destination charset (default "ISO-8859-1") | |
return | converted | string |
static public decrypt ( $string, $key ) : decrypted | ||
$string | string to decrypt | |
$key | string key used to decrypt | |
return | decrypted | string |
static public deleteDir ( $dir ) | ||
$dir | string: directory to delete |
static public encodeInUtf8 ( $string, $from_charset = "ISO-8859-1" ) : utf8 | ||
$string | string string to convert | |
$from_charset | string original charset (if 'auto' try to autodetect) (default "ISO-8859-1") | |
return | utf8 | string |
static public encrypt ( $string, $key ) : encrypted | ||
$string | string to encrypt | |
$key | string key used to encrypt | |
return | encrypted | string |
static public filesizeDirectory ( $path ) : size | ||
$path | string: directory or file to get size | |
return | size | of the $path |
static public getItemTypeFormURL ( $itemtype, $full = true ) | ||
$itemtype | string item type | |
$full | path or relative one (true by default) return string itemtype Form URL |
static public getItemTypeSearchURL ( $itemtype, $full = true ) | ||
$itemtype | string item type | |
$full | path or relative one (true by default) return string itemtype search URL |
static public getItemTypeTabsURL ( $itemtype, $full = true ) | ||
$itemtype | string item type | |
$full | path or relative one (true by default) return string itemtype tabs URL |
static public getMemoryLimit ( $ininame = 'memory_limit' ) : memory | ||
$ininame | String name of the ini ooption to retrieve (since 9.1) | |
return | memory | limit |
static public getRandomString ( integer $length, boolean $high = false ) : random | ||
$length | integer | of the random string |
$high | boolean | strength of the random source (since 9.2) |
return | random | string |
static public getSize ( $size ) : formatted | ||
$size | integer: Size in octet | |
return | formatted | size |
static public getTimestampTimeUnits ( $time ) : string | ||
$time | integer: timestamp | |
return | string |
static public getURLContent ( $url, &$msgerr = NULL, $rec ) : content | ||
$url | string to retrieve | |
$msgerr | string set if problem encountered (default NULL) | |
$rec | integer internal use only Must be 0 (default 0) | |
return | content | of the page (or empty) |
static public get_magic_quotes_gpc ( ) : boolean | ||
return | boolean |
static public get_magic_quotes_runtime ( ) : boolean | ||
return | boolean |
static public get_max_input_vars ( ) : integer | ||
return | integer |
static public inArrayCaseCompare ( $string, $datas = [] ) : boolean | ||
$string | string to search | |
$datas | array to search to search | |
return | boolean | : string founded ? |
static public is_a ( $object, $class_name ) : true | ||
$object | can be an object or a string contining the class name | |
$class_name | the name of the class to compare | |
return | true | if $object is an instance of $class_name |
static public logInFile ( $name, $text, $force = false ) | ||
$name | string name of the log file | |
$text | string text to log | |
$force | boolean force log in file not seeing use_log_in_files config (false by default) |
static public manageBeginAndEndPlanDates ( &$data ) : processed | ||
$data | array data to process | |
return | processed | datas |
static public manageRedirect ( $where ) | ||
$where | string: where to redirect ? |
static public parseMailServerConnectString ( $value, $forceport = false ) : array | ||
$value | string: connect string | |
$forceport | boolean: force compute port if not set (false by default) | |
return | array | of parsed arguments (address, port, mailbox, type, ssl, tls, validate-cert norsh, secure and debug) : options are empty if not set and options have boolean values if set |
static public prepareArrayForInput ( array $value ) : string | ||
$value | array | array passed array |
return | string | encoded array |
public static removeHtmlSpecialChars ( string $string ) : string | ||
$string | string | String to handle |
return | string |
static public resizePicture ( $source_path, $dest_path, $new_width = 71, $new_height = 71, $img_y, $img_x, $img_width, $img_height, $max_size = 500 ) : boolean | ||
$source_path | string path of the picture to be resized | |
$dest_path | string path of the new resized picture | |
$new_width | string new width after resized (default 71) | |
$new_height | string new height after resized (default 71) | |
$img_y | string y axis of picture (default 0) | |
$img_x | string x axis of picture (default 0) | |
$img_width | string width of picture (default 0) | |
$img_height | string height of picture (default 0) | |
$max_size | integer max size of the picture (default 500, is set to 0 no resize) | |
return | boolean | : true or false |
static public return_bytes_from_ini_vars ( $val ) | ||
$val | string: config value (like 10k, 5M) |
static public seems_utf8 ( $str ) : boolean | ||
$str | string string to analyze | |
return | boolean |
static public sendFile ( $file, $filename, $mime = null ) : nothing | ||
$file | string: storage filename | |
$filename | string: file title | |
$mime | string: file mime type | |
return | nothing |
static public setDebugMode ( $mode = NULL, $debug_sql = NULL, $debug_vars = NULL, $log_in_files = NULL ) | ||
$mode | Integer from Session::*_MODE (default NULL) | |
$debug_sql | Boolean (default NULL) | |
$debug_vars | Boolean (default NULL) | |
$log_in_files | Boolean (default NULL) |
static public showMailServerConfig ( $value ) : String | ||
$value | String host connect string ex {localhost:993/imap/ssl}INBOX | |
return | String | type of the server (imap/pop) |
static public stripslashes_deep ( $value ) : stripslashes | ||
$value | array or string: item to stripslashes (array or string) | |
return | stripslashes | item |
static public strlen ( $str ) : length | ||
$str | string | |
return | length | of the string |
static public strpos ( $str, $tofound, $offset ) : substring | ||
$str | string string | |
$tofound | string string to found | |
$offset | integer The search offset. If it is not specified, 0 is used. (default 0) | |
return | substring |
static public strtolower ( $str ) : lower | ||
$str | string | |
return | lower | case string |
static public strtoupper ( $str ) : upper | ||
$str | string | |
return | upper | case string |
static public substr ( $str, $start, $length ) : substring | ||
$str | string | |
$start | integer start of the result substring | |
$length | integer The maximum length of the returned string if > 0 (default -1) | |
return | substring |
static public testWriteAccessToDirectory ( $dir ) : 2 | ||
$dir | string: directory to check | |
return | 2 |
static public unclean_cross_side_scripting_deep ( $value ) : unclean | ||
$value | array or string item to unclean from clean_cross_side_scripting_deep | |
return | unclean | item |
static public unclean_html_cross_side_scripting_deep ( $value ) : unclean | ||
$value | array or string: item to unclean from clean_cross_side_scripting_deep | |
return | unclean | item |
static public userErrorHandlerDebug ( $errno, $errmsg, $filename, $linenum, $vars ) | ||
$errno | integer level of the error raised. | |
$errmsg | string error message. | |
$filename | string filename that the error was raised in. | |
$linenum | integer line number the error was raised at. | |
$vars | array that points to the active symbol table at the point the error occurred. |
static public userErrorHandlerNormal ( $errno, $errmsg, $filename, $linenum, $vars ) | ||
$errno | integer level of the error raised. | |
$errmsg | string error message. | |
$filename | string filename that the error was raised in. | |
$linenum | integer line number the error was raised at. | |
$vars | array that points to the active symbol table at the point the error occurred. |
static public writeConfig ( $name, $content ) : boolean | ||
$name | string config file name | |
$content | string config file content | |
return | boolean |