KWeb  6.4
tools.php File Reference

Functions

 httpRoot ($s='')
 httpUrl ($query=false)
 getRequestUrl ($https=null, $domain=false, $port=false, $path=false, $query=false, $queryPrefix=false)
 Builds url based on current request.
 varQuery ()
 varWholeQuery ($m='')
 vG ($n, $d='')
 print_array ($arr, $end="\n")
 var_dump_html ($v, $return=false)
 getmicrotime ()
 set_cookie ($name, $value='', $exp=0, $path='', $domain='')
 Sets cookie.
 escape ($s)
 mysql_escape ($s)
 mysql_get ($query, $link=-1)
 mysql_get_row ($query, $link=-1)
 mysql_get_rows ($query)
 generate_password ($length)
 dirsize ($name, $recursive=false)
 Enter description here ...
 unlinkMask ($dir, $mask, $pathMask=false, $olderThan=false, $removeEmptyFolder=false)
 Unlinks files that match the masks.
 findFiles ($dir, $mask, $pathMask=false, $includeDirs=false)
 GetIP ()
 IPToNumber ($dotquad_ip)
 numberToVersion ($num)
 versionsToNumber ($maj, $min, $rls, $compile)
 versionToNumber ($version)
 compareVersions ($versionA, $versionB)
 RGB ($r, $g, $b)
 htmlToFlashText ($s, $charset= 'utf-8')
 htmlToFlashHtml ($s)
 getUniqueColor ($i, $stepping, $range, $bright, $reversed=false)
 mkdirs ($dir, $rights=null)
 noPHPMagic ()
 Strips magic quotes.
 stripslashes_array ($data)
 safeFilename ($file)
 utf_substr ($str, $start, $length=0x7FFFFF)
 file_exists_cached ($path)
get_public_object_vars ($object)
object_get (&$object, $key, $default=null)
 Returns default value for specified key in object in case it's not set.
array_get (&$array, $key, $default=null)
 Returns default value for specified key in array in case it's not set.
 array_remove (&$array, $what)
 Removes value from the array.
 array_search_prefix ($prefix, $array)
 Searches an array for string prefix.
 array_merge_recursive_distinct ()
 Merges any number of arrays / parameters recursively, replacing entries with string keys with values from latter arrays.
 array_splice_keys (&$input, $offset, $length=null, $replacement=null)
 Peforms array_splice on associative arrays.
 array_insert (&$array, $value, $position=false, $insertAfter=false)
 Insert one or more values into array.
 exec_background ($cmd)
 strftime_dict ($format, $timestamp, array $dict)
 Extends strftime format with any supplied dictionary.
 strftime_pl ($format, $timestamp=null)
 binary_search (array $a, $key, $first=null, $last=null, $compare=null)
 Parameters:

Function Documentation

& array_get ( &$  array,
key,
default = null 
)

Returns default value for specified key in array in case it's not set.

This is the safe way to access arrays, instead of using $array[$key]

Parameters:
array$array
string$key
mixed$default
Returns:
mixed
array_insert ( &$  array,
value,
position = false,
insertAfter = false 
)

Insert one or more values into array.

Parameters:
$value- array of values, or single value
$position- numeric position, or key of insertion point
$insertAfter- if TRUE, value will be inserted one position after insertion point
array_merge_recursive_distinct ( )

Merges any number of arrays / parameters recursively, replacing entries with string keys with values from latter arrays.

If the entry or the next value to be assigned is an array, then it automagically treats both arguments as an array. Numeric entries are appended, not replaced, but only if they are unique

calling: result = array_merge_recursive_distinct(a1, a2, ... aN)

array_remove ( &$  array,
what 
)

Removes value from the array.

Parameters:
$array
$what
Returns:
boolean
array_search_prefix ( prefix,
array 
)

Searches an array for string prefix.

array_splice_keys ( &$  input,
offset,
length = null,
replacement = null 
)

Peforms array_splice on associative arrays.

binary_search ( array $  a,
key,
first = null,
last = null,
compare = null 
)

Parameters:

Parameters:
$a- The sort array.
$first- First index of the array to be searched (inclusive).
$last- Last index of the array to be searched (exclusive).
$key- The key to be searched for.
$compare- A user defined function for comparison. Same definition as the one in usort

Return: index of the search key if found, otherwise return (-insert_index - 1). insert_index is the index of smallest element that is greater than $key or sizeof($a) if $key is larger than all elements in the array.

Author:
http://terenceyim.wordpress.com
compareVersions ( versionA,
versionB 
)
dirsize ( name,
recursive = false 
)

Enter description here ...

Parameters:
unknown_type$name
$recursive
Returns:
number
escape ( s)
exec_background ( cmd)
file_exists_cached ( path)
findFiles ( dir,
mask,
pathMask = false,
includeDirs = false 
)
generate_password ( length)
& get_public_object_vars ( object)
GetIP ( )
getmicrotime ( )
getRequestUrl ( https = null,
domain = false,
port = false,
path = false,
query = false,
queryPrefix = false 
)

Builds url based on current request.

You can exchange parts of the request...

getUniqueColor ( i,
stepping,
range,
bright,
reversed = false 
)
htmlToFlashHtml ( s)
htmlToFlashText ( s,
charset = 'utf-8' 
)
httpRoot ( s = '')
httpUrl ( query = false)
IPToNumber ( dotquad_ip)
mkdirs ( dir,
rights = null 
)
mysql_escape ( s)
mysql_get ( query,
link = -1 
)
mysql_get_row ( query,
link = -1 
)
mysql_get_rows ( query)
noPHPMagic ( )

Strips magic quotes.

numberToVersion ( num)
& object_get ( &$  object,
key,
default = null 
)

Returns default value for specified key in object in case it's not set.

This is the safe way to access arrays, instead of using $object->key

Parameters:
$object
string$key
mixed$default
Returns:
mixed
print_array ( arr,
end = "\n" 
)
RGB ( r,
g,
b 
)
safeFilename ( file)
set_cookie ( name,
value = '',
exp = 0,
path = '',
domain = '' 
)

Sets cookie.

Parameters:
unknown_type$name
unknown_type$value
unknown_type$exp- 0, timeout in seconds (up to 100.000.000), time
unknown_type$path
unknown_type$domain
strftime_dict ( format,
timestamp,
array $  dict 
)

Extends strftime format with any supplied dictionary.

strftime_pl ( format,
timestamp = null 
)
stripslashes_array ( data)
unlinkMask ( dir,
mask,
pathMask = false,
olderThan = false,
removeEmptyFolder = false 
)

Unlinks files that match the masks.

Parameters:
$dir- Directory to start in
$mask- regexp to match the filename, or false to match everything
$pathMask- regexp to match the whole path for recursion ('/' separators are guaranteed)
$olderThan- remove only files that are older then this time
$removeEmptyFolder- removes folder when it becomes empty
Returns:
number
utf_substr ( str,
start,
length = 0x7FFFFF 
)
var_dump_html ( v,
return = false 
)
varQuery ( )
varWholeQuery ( m = '')
versionsToNumber ( maj,
min,
rls,
compile 
)
versionToNumber ( version)
vG ( n,
d = '' 
)