Sitellite Application Framework
Class Tree         Index         All Elements

Procedural File: Functions.php

Source Location: Program_Root/Functions.php



Classes:



Page Details:

This is a list of functions aimed at improving something about existing PHP functions, and which are used in places in the Sitellite Application Framework.








CASE_LOWER [line 414]

CASE_LOWER = 2


Tags:

global:  int 0: CASE_LOWER lowercase array keys

[ Top ]



CASE_UPPER [line 409]

CASE_UPPER = 1


Tags:

global:  int 0: CASE_UPPER uppercase array kes

[ Top ]




array_change_key_case [line 425]

array array_change_key_case( array $array, [int $changeCase = CASE_LOWER])

Returns an array with all string keys lowercased or uppercased



Tags:

see:  http://www.php.net/array_change_key_case
access:  public


Parameters

array   $array   array to change keys
int   $changeCase   how to transform keys
[ Top ]



array_chunk [line 372]

void array_chunk( mixed $input, mixed $size, [mixed $preserve_keys = false])

Provides array_chunk() for PHP 4.1 users.



Tags:

access:  public


[ Top ]



array_chunk_fill [line 456]

array array_chunk_fill( array $list, integer $chunk, [boolean $assoc = false], [mixed $fill = ' '])

Calls array_chunk(), but adds a parameter $fill, which "fills out" the potentially uneven number if items in the last array with the value of $fill.



Tags:

access:  public


Parameters

array   $list  
integer   $chunk  
boolean   $assoc  
mixed   $fill  
[ Top ]



array_search [line 277]

mixed array_search( [mixed $needle = ''], [array $haystack = ''])

If the PHP version is less than 4.0.5, emulates the array_search() function.



Tags:

access:  public


Parameters

mixed   $needle  
array   $haystack  
[ Top ]



assocify [line 358]

array assocify( array $arr)

Turns a regular array into an associative array with a $value => $value new key/value relation. For example, an array [1=>Joe,2=>Jane,3=>Joe] would become [Joe=>Joe,Jane=>Jane]. Please note the loss of duplicate values.



Tags:

return:  hash
access:  public


Parameters

array   $arr  
[ Top ]



better_crypt [line 183]

string better_crypt( string $pass, [string $salt = ''])

Makes sure that the salt is always two characters in length before sending it to the crypt() function. Also generates its own two character salt if none is provided.



Tags:

access:  public


Parameters

string   $pass  
string   $salt  
[ Top ]



better_crypt_compare [line 203]

boolean better_crypt_compare( string $pass, string $original)

Calls the better_crypt() function instead of crypt() when comparing a new password to the original to see if it matches up.



Tags:

access:  public


Parameters

string   $pass  
string   $original  
[ Top ]



better_strrpos [line 651]

int better_strrpos( string $haystack, string $needle)

strrpos() which allows multiple characters in the needle.



Tags:

access:  public


Parameters

string   $haystack  
string   $needle  
[ Top ]



commify [line 315]

string commify( [string $number = ""])

Adds commas every three numbers from the right of the period to a given number.



Tags:

access:  public


Parameters

string   $number  
[ Top ]



format_filesize [line 295]

string format_filesize( [integer $size = 0])

Returns a file size formatted in a more human-friendly format, rounded to the nearest Gb, Mb, Kb, or byte.



Tags:

access:  public


Parameters

integer   $size  
[ Top ]



htmlentities_compat [line 55]

string htmlentities_compat( string $val1, [string $val2 = ENT_COMPAT], [string $val3 = 'iso-8859-1'])

Where htmlentities() causes corruption of data in alternate character

sets, this function aims to translate the necessary entities without damaging the data. Currently does a str_replace for the following entities:

  • '&' * => '&'
  • '<' * => '<'
  • '>' * => '>'
  • '<' * * => '&lt;'
  • '>' * * => '&gt;'
  • '"' * * => '"'
It also does an extra preg_replace for & followed by a space/tab/cr/lf and replaces the & with a &amp;.




Tags:

access:  public


Parameters

string   $val1  
string   $val2  
string   $val3  
[ Top ]



htmlentities_reverse [line 85]

string htmlentities_reverse( string $val1)

Reverses the htmlentities_compat() function exactly.



Tags:

access:  public


Parameters

string   $val1  
[ Top ]



html_marker [line 259]

string html_marker( string $note)

Creates an HTML comment padded with dashes for easily marking sections of a document. Hnady for viewing the source of large documents.



Tags:

access:  public


Parameters

string   $note  
[ Top ]



info [line 330]

void info( mixed $value, [boolean $full = false])

Wraps a print_r() or var_dump() of the given $value with a set of
  tags around it, and echoes it.



Tags:

access:  public


Parameters

mixed   $value  
boolean   $full  
[ Top ]



is_a [line 239]

boolean is_a( string $class, string $match)

If the PHP version is less than 4.2.0, emulates the is_a() function, which determines whether the object, $class, is of the class specified by $match.



Tags:

access:  public


Parameters

string   $class  
string   $match  
[ Top ]



is_assoc [line 601]

boolean is_assoc( mixed $arr)

Determines whether the specified variable is an associative array.



Tags:

access:  public


Parameters

mixed   $arr  
[ Top ]



localdate [line 683]

string localdate( string $format, [int $unixdate = ''])

A date() replacement which respects your setlocale() setting.

From php.net/date comments, user "isp dot phptime at spsoft dot de"




Tags:

access:  public


Parameters

string   $format  
int   $unixdate  
[ Top ]



make_assoc [line 140]

array make_assoc( array $array, [string $key = ''], [string $value = ''])

Creates a single-level associative array out of an array of objects or an array of associative arrays. $key and $value specify the property or array key name to use for their respective values in the new associative array.



Tags:

return:  hash
access:  public


Parameters

array   $array  
string   $key  
string   $value  
[ Top ]



make_obj [line 124]

object &make_obj( array $array)

Note: Deprecated in favour of a simple:

$obj = (object) $array;

Creates an object out of a hash (or any other type). There is no make_hash() function because that can simply be cast as well ($array = (array) $obj). Thanks to Demian Turner for pointing out this equivalence.




Tags:

access:  public


Parameters

array   $array  
[ Top ]



mime [line 514]

string mime( string $file)

Determines the content type of a file based on a small list of common types.

Useful when mime_content_type() isn't available or isn't configured correctly.




Tags:

access:  public


Parameters

string   $file  
[ Top ]



mime_content_type [line 589]

void mime_content_type( mixed $file)



[ Top ]



readfile_chunked [line 720]

int readfile_chunked( string $filename, [boolean $retbytes = true])

Replacement for readfile() in PHP5 which doesn't encounter memory limits.



Tags:

access:  public


Parameters

string   $filename  
boolean   $retbytes  
[ Top ]



sql_split [line 623]

array sql_split( string $sql)

Splits an SQL script into distinct queries which can be evaluated or manipulated individually.



Tags:

access:  public


Parameters

string   $sql  
[ Top ]



vsprintf [line 222]

string vsprintf( string $str, array $args)

If the PHP version is less than 4.1.0, emulates the vsprintf() function using a call_user_func_array() with the sprintf() function. The use of this function in the saf.I18n package was causing fatal errors in Sitellite on earlier PHP versions.



Tags:

access:  public


Parameters

string   $str  
array   $args  
[ Top ]



xmlentities [line 476]

string xmlentities( string $string, [string $quote_style = ENT_COMPAT])

Converts entities to unicode entities (ie. < becomes &#60;).

From php.net/htmlentities comments, user "webwurst at web dot de"




Tags:

access:  public


Parameters

string   $string  
string   $quote_style  
[ Top ]



xmlentities_reverse [line 494]

string xmlentities_reverse( string $string)

Converts XML unicode entities back to their original characters (ie. &#60; becomes <).



Tags:

access:  public


Parameters

string   $string  
[ Top ]



Copyright © 2007, SIMIAN systems Inc.
All rights reserved. Privacy policy
Documentation generated on Tue, 13 Feb 2007 17:17:37 -0600 by Sitellite AppDoc and phpDocumentor 1.2.2