BlueShoes Application Framework made with PHP http://www.blueshoes.org/


Packageindex Classtrees Modulegroups Elementlist Report XML Files

File: C:/usr/local/lib/php/blueshoes-4.2/core/lang/Bs_Misc.lib.php
BlueShoes Application Framework - lang *****************************************************************************

C:/usr/local/lib/php/blueshoes-4.2/core/lang/Bs_Misc.lib.php::C:/usr/local/lib/php/blueshoes-4.2/core/lang/Bs_Misc.lib.php

***************************************************************************

 

private module C:/usr/local/lib/php/blueshoes-4.2/core/lang/Bs_Misc.lib.php

***************************************************************************
* This is not a CLASS !!!* * Some language extensions, we actually think these should come with php, maybe * in future releases.* * List of content:* Web Stuff: <-sam DEPRECATED ?? Lot of this stuff should be in Net/Http* - bsSessionBrowscap() # handle browscap* - redirect() # Redirect to the given url and terminate* - getAbsoluteWebPath() # Get the absolute path (without file) of the current script.* - getAbsoluteWebFile() # Get the absolute path (with file) of the current script.* - getAbsoluteWebFileQuery() # Get the absolute path (with file and querystring) of the current script.* - getAbsolutePath() # Get the physical abs. path (without file) of the current script.* - getAbsoluteFile() # Get the physical abs. path (with file) of the current script.* - bsSetCookie() # Sets a cookie. *ALWAYS* use this function instead of php's setcookie()!* * Helpers:* - isTrue() # Intelligent is TRUE tester. TURE is 'Yes', 'On', 'True', a.s.o.* - boolToString() # Converts a bool to a string. If $param is TRUE, returns 'true' etc.* - isAlphaNumeric() # Returns TRUE if the given var is a string, int or double.* - isInvisible() OR isWhite() # Tells if a given string contains only whitespace character.* - evalWrapper() 2do! # Like a sandbox. Evaluate code in it's own scope.* - evalWrap() # DEPRECATED, migrate to evalWrapper().* - bs_registerShutdownMethod() # Register *object methods* as shutdown functions.* - bs_testShutdown() # To test if the registered *object methods* works.* - classHyrachy() # Separate an object (or class) in it's hyrachy-components (vars and methods)* - parseUid() # parses an UID string into an array.* - uidArrayToString() # opposite of parseUid().* - getTmp() # returns the systems default temp dir.* * Debugging Stuff:* - arrayToHtml() # Loops an array or object and returns some HTML. Use for debugging.* - dump() OR var_dump_pre() # Beautify var_dump a little and add <pre>-tags around it. For debugging only.* - classHyrachyToHtml() # Returns a HTML output of a class separate in it's hyrachy-components.* - misc_ErrorHandler() # Another error handler. Not sure if its of any use but can be used as sample to cut and paste.***

Version4.0.$id:$ *

 

Public Method Summary

void

bsSessionBrowscap()

deals with session and browscap, whatever is needed.
string

rewriteUrlSession(string $string, array $params)

rewrites the urls in the given string with the sid.
void

registerOutputHandler(string $function, [ array $params ])

registers an output handler. all output (from spit() will be run through the
void

spit(string $string)

spits out the given string to the client browser using the registered output handler(s).
mixed

evalWrap(string $phpCode, [ string $security, string $suppressErrors, array $params ])

DEPRECATED, DEPRECATED, DEPRECATED, DEPRECATED, DEPRECATED, DEPRECATED, DEPRECATED, DEPRECATED,

Private Method Summary

void

redirect(string $url)

Redirect to the given url and terminate the execution of the current script immediatly.
string

&applyOutputHandlers(string &$string)

applies the registered output handlers.
void

bsSetCookie(string $name, [ string $value, string $expire, string $path, string $domain, string $secure ])

Sends a cookie to the client.
string

arrayToHtml(array $array)

Loops the given array or object and returns some html code with the key/value pairs.
void

dump( &$param, string $noEcho)

alias for var_dump_pre().
void

var_dump_pre(mixed $param, [ string $noEcho ])

Beautify var_dump a little and add <pre>-tags around it. For debugging only.
void

getAbsoluteWebPath()

Get the absolute path (without file) of the current script.
void

getAbsoluteWebFile()

Get the absolute path (with file) of the current script.
void

getAbsoluteWebFileQuery()

Get the absolute path (with file and querystring) of the current script.
void

getAbsolutePath()

Get the physical absolute path (without file) of the current script.
void

getAbsoluteFile()

Get the physical absolute path (with file) of the current script.
bool

isTrue(string $value)

Intelligent is TRUE tester.
string

boolToString(bool $param)

Converts a bool to a string. If $param is (evaluates to) TRUE, returns 'true' etc.
bool

isAlphaNumeric(mixed &$var)

Returns TRUE if the given var is a string, int or double.
bool

isInvisible(string $string)

Tells if a given string contains only whitespace character.
void

evalWrapper(string $phpCode, array &$context, [ array $params ])

evalWrapper ( The new version. Replaces evalWrap() )
void

evalErrorHandler( $errNo, $errStr, $errFile, $errLine)

DEPRECATED, DEPRECATED, DEPRECATED, DEPRECATED, DEPRECATED, DEPRECATED, DEPRECATED, DEPRECATED,
bool

bs_testShutdown(object [unknown] &$object, string $methodName)

Test the bs_registerShutdownMethod() if it works.
void

_bs_shutdown([ integer $triggerNr ])

The BS shutdown function that PHP will call on shutdown
array

&classHyrachy(mixed &$classOrObject)

Separate an object (or class) in it's hyrachy-components (vars and methods)
array

parseUid(string $UID)

parses an UID string into an array.
string

uidArrayToString(array $UID)

opposite of parseUid().
string

getTmp()

returns the systems default temp dir.
int

levenshteinPercent(string $one, string $two)

returns the levenshtein in %.
string

&classHyrachyToHtml(mixed &$param)

Returns a HTML output of a class separate in it's hyrachy-components.
void

isWhite( $string)

Warning: documentation is missing.
void

misc_ErrorHandler( $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, &$context, &$context, &$context, &$context, &$context, &$context, &$context, &$context, &$context, &$context, &$context, &$context, &$context, &$context, &$context, &$context, &$context, &$context, &$context, &$context, &$context, &$context, &$context, &$context, &$context, &$context, &$context, &$context, &$context, &$context, &$context, &$context, &$context, &$context, &$context, $MISC_evalWrapperContextDefault, string $context, $params, $params, $params, $params, $params, $params, $params, $params, $params, $params, $params, $params, $params, $params, $params, $params, $params, $params, $params, $params, $params, $params, $params, $params, $params, $params, $params, $params, $params, $params, $params, $params, $params, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $bar, $bar, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $bar, $bar, $bar, &$foo, &$foo, &$foo, &$foo, &$foo, &$foo, &$foo, &$foo, &$foo, &$foo, &$foo, &$bar, &$bar, &$bar, $phpCode, $phpCode, $phpCode, $phpCode, &$context, array $params, $MISC_evalWrapperContextDefault, $MISC_errorHandler_lastError, string $MISC_evalWrapper, $context, $MISC_evalWrapperContextDefault, $MISC_evalWrapperContextDefault, string $key, $val, $context, $context, $context, $key, $key, $context, $key, $key, $val, $val, $params, $params, $params, $params, $params, $params, $params, $params, $params, $params, string $key, $dev0, string $key}, $params, $key, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, string $phpCode, $phpCode, string $oldTrackErr, string $oldErrLevel, string $MISC_errorHandler_lastError, string $php_errormsg, string $ret, string $out, $oldTrackErr, $oldTrackErr, $oldTrackErr, $oldTrackErr, $oldTrackErr, $oldTrackErr, $oldTrackErr, $oldTrackErr, $oldTrackErr, $oldTrackErr, $oldTrackErr, $oldTrackErr, $oldTrackErr, $oldTrackErr, $oldTrackErr, $oldErrLevel, $oldErrLevel, $oldErrLevel, string $error, $MISC_errorHandler_lastError, $MISC_errorHandler_lastError, $MISC_errorHandler_lastError, $context, $context, $context, $context, $context, $context, $context, $MISC_errorHandler_lastError, $context, $context, $context, $context, $context, $MISC_errorHandler_lastError, $context, $context, $context, $context, $context, $MISC_errorHandler_lastError, $context, $context, $context, $context, $context, $MISC_errorHandler_lastError, $context, $context, $context, $context, $context, $MISC_errorHandler_lastError, string $error, $php_errormsg, $php_errormsg, $php_errormsg, $php_errormsg, $php_errormsg, $php_errormsg, $php_errormsg, $php_errormsg, $php_errormsg, $php_errormsg, $out, $out, $out, $out, $out, $out, $out, $out, $out, $errLine, $context, $context, $context, $context, $context, $context, $context, $context, $context, $context, $context, $context, $context, $context, $context, $context, $php_errormsg, $php_errormsg, $context, $context, $context, $errLine, $errLine, string $out, string $error, $context, $context, $context, $context, $context, $context, $context, $error, $error, $error, $error)

Warning: documentation is missing.
void

bs_registerShutdownMethod( $line, $file, &$object, $methodName, string $params)

Warning: documentation is missing.
void

register_shutdown_function( $objHyrachy, $objHyrachy, $objHyrachy, $objHyrachy, $objHyrachy, $objHyrachy, $objHyrachy, $objHyrachy, $objHyrachy, $objHyrachy, $objHyrachy, $objHyrachy, $objHyrachy, $objHyrachy, $objHyrachy, $objHyrachy, $objHyrachy, $objHyrachy, $objHyrachy, $objHyrachy, $objHyrachy, $objHyrachy, $objHyrachy, $objHyrachy, $objHyrachy, $objHyrachy, $nr, $nr, &$classOrObject, &$classOrObject, &$classOrObject, &$classOrObject, &$classOrObject, &$classOrObject, &$classOrObject, &$classOrObject, &$classOrObject, &$classOrObject, &$classOrObject, &$classOrObject, &$classOrObject, &$classOrObject, &$classOrObject, &$classOrObject, &$classOrObject, &$classOrObject, &$classOrObject, &$classOrObject, &$classOrObject, &$classOrObject, &$classOrObject, &$classOrObject, &$classOrObject, &$classOrObject, &$classOrObject, &$classOrObject, &$classOrObject, &$classOrObject, &$classOrObject, &$classOrObject, &$classOrObject, &$classOrObject, &$classOrObject, &$classOrObject, &$classOrObject, &$classOrObject, &$classOrObject, &$classOrObject)

Warning: documentation is missing.
void

classHyrachy( &$param, &$param, &$param, &$param, &$param, &$param, &$param, &$param, &$param, &$param, &$param, &$param, &$param, &$param, &$param, &$param, &$param, &$param, &$param, &$param, &$param, &$param, &$param, &$param, &$param, &$param, &$param, &$param, &$param, &$param, &$param, &$param, &$param, &$param, &$param, &$param, &$param, &$param, &$param, &$param, $param)

Warning: documentation is missing.
void

shell( $command, string $output, string $file)

Warning: documentation is missing.

Public Method Details

bsSessionBrowscap

public void bsSessionBrowscap( )

  deals with session and browscap, whatever is needed.
this code could be in the site's conf file, but becauseit's always the same logic this code has been outsourced.it's required that $GLOBALS['bsSession'] is set. otherwisethis function won't do anything.

Returns void


rewriteUrlSession

public string rewriteUrlSession( string $string, array $params )

  rewrites the urls in the given string with the sid.
if sid is not given, the global one will be used.unfortunately php does not have such a function yet. the functionality existsusing --enable-trans-sid, but not as separate function. and it does not workin all cases, namely:- Header("Location: url") => Header("Location: url?" . SID)- Meta-refresh <META http-equiv="refresh" content="5; URL=$refresh?SID">- Javascript client side programmed links- 4.0.6, it apparently did not work with POST forms.- only works on relative url's.- someone said he lost the var when referring dir/ instead of dir/index.php- does not work with output buffering because the SID is added after, andthus fucks up the output size value.- links to downloadable file slike download.exe?PHPSESSID=SID give problems?this function uses the vars- $GLOBALS['bsSession']->getSid() string the session id to use- $APP['sess']['tags'] array vector the tags to search for url's- $APP['sess']['domains'] array vector the domains to treat as local

Parameter
string $string
array $params
(vector, empty here but we need it set.)
Returns string

See Also registerOutputHandler()

registerOutputHandler

public void registerOutputHandler( string $function, [ array $params ] )

  registers an output handler. all output (from spit() will be run through the
given output handler(s). they are applied in the same order as they areregistered.param $params:vector with the params to call the output handler. you may want to pass thearray (or the params inside the array) by reference. see example.example:let's use the rewriteUrlSession() output handler. it will attach the currentsession id to all url's. bedefault it will only be applied to relative url's.but we're going to tell it our own domains so it can do it on absolute linksaswell:$absoluteUrl = array(); //define array$params = array(NULL, $absoluteUrl);registerOutputHandler('rewriteUrlSession', $params);$absoluteUrl = array('www.yourdomain.com', 'yourdomain.com');now because you did not pass $params by reference (or add $absoluteUrl byreference to the array $params) it cannot be done, your domains won't beknown. got that?all output handlers need to take exactly 2 params by reference: the stringand additional params. take rewriteUrlSession() as an example.

Parameter
string $function
the function name of the output handler
array $params = >>array()<<
(vector, see above)
Returns void

See Also spit()

spit

public void spit( string $string )

  spits out the given string to the client browser using the registered output handler(s).
spit it out ... CH-T ... in your face (missy elliott :)

Parameter
string $string
give it by reference if you can, but be aware that it will most likely be modified.
Returns void

See Also registerOutputHandler()

evalWrap

public mixed evalWrap( string $phpCode, [ string $security, string $suppressErrors, array $params ] )

  DEPRECATED, DEPRECATED, DEPRECATED, DEPRECATED, DEPRECATED, DEPRECATED, DEPRECATED, DEPRECATED,
DEPRECATED, DEPRECATED, DEPRECATED, DEPRECATED, DEPRECATED, DEPRECATED, DEPRECATED, DEPRECATED,DEPRECATED, DEPRECATED, DEPRECATED, DEPRECATED, DEPRECATED, DEPRECATED, DEPRECATED, DEPRECATED,DEPRECATED, DEPRECATED, DEPRECATED, DEPRECATED, DEPRECATED, DEPRECATED, DEPRECATED, DEPRECATED,Please migrate to evalWrapper().evalWrap() wraps PHP's eval() ('old' version)The passed PHP code rests in it's own scope and will not interfere with the rest of the program by accident.In future it may prevent certain calls. The passed $phpCode is interpreted just like a normal php script but alloutput (e.g. normal text and PHP-echo's) is catched and will make up the output of this function.NOTE I : It's recommended to pass the $phpCode WITH the '<?php'- wrapping tags. Just as if your werecoding a php-script. Mix of html and PHP is allowed!If you leave out the '<?php'- wrapping tags it will still work. This is a PHP-eval() feature; don't knowhow it exactly works but if eval() fails to understand the *beginning* of the passed $phpCode it assumes it'snormal text and will stop (without a message). Otherwise it starts parsing as usual.NOTE II: If the $phpCode contains a 'return $foo;' at the *top* level, thus *outside* a class or function, thenthe that return value is the return value of this function.IMPORTANT! : Output has priority over a return-value!If you're interested in the unsing a return() call, then *no* output is to be produced.Reason: See above "Comment to PHP's eval() an the evalWrapper's"param $phpCodeThe passed PHP code rests in it's own scope and will not interfere with the rest of the program by accident.In future it may prevent certain calls. The passed $phpCode is interpreted just like a normal php script but alloutput (e.g. normal text and PHP-echo's) is catched and will make up the output of this function.param $security: (For future use)VALUE | MEANING-------+--------------------------------------------------------'high' | no db and file access is permitted. no shell commands.'low' | no shell commands.'none' | everything is permitted, no restrictions.param $params:If you want to pass variables into the scope of the passed code you must set up ahash array with the variable name as key and the value that belongs to it.E.g. If you want $foo and $bar to be in scope, make an hash as follows: array('foo'=>$foo, 'bar'=>$bar);You can also pass by reference doing array('foo'=> &$foo, 'bar'=> &$bar);

Parameter
string $phpCode
the string you want to evaluate. Must be properly escaped etc. rtfm.
string $security = >>'high'<<
(optional, default 'high') see above.
string $suppressErrors = >>FALSE,<<
(optional, default FALSE).
array $params = >>array()<<
default is an empty array. can be a hash holding key/value pairs where the key is the var name and the value is the var value (or a reference to it isn't a bad idea).
Returns mixed

this can be anything, whatever the evaluated code returns.
@throw if the evaluated code does not return, or if a parse error occures, or if the security check complains, NULL is returned.

Deprecated since 1.3.02 Use evalWrapper() --Sam

Private Method Details

redirect

private void redirect( string $url )

  Redirect to the given url and terminate the execution of the current script immediatly.
please use this and don't do it manually using header() because then we could not dothe output handlers.

Parameter
string $url
(may be relative but i highly recommend to use it absolute.)
Returns void


&applyOutputHandlers

private string &applyOutputHandlers( string &$string )

  applies the registered output handlers.

Parameter
string &$string
Returns string

See Also registerOutputHandler(), spit(), redirect()

bsSetCookie

private void bsSetCookie( string $name, [ string $value, string $expire, string $path, string $domain, string $secure ] )

  Sends a cookie to the client.
Please *always* use this function instead of php's setcookie() function. If you look athttp://www.php.net/manual/en/function.setcookie.php there are currently over 100 (!) usercontributed messages about this topic. This has a reason.Sean McLean's had a closer look at the problem in the "The great PHP cookie test" http://www.rnetwork.tv/cookietest/(and http://www.chipchapin.com/WebTools/cookietest.php) and his comment is:"The answer to the problem of different browsers handling cookies differently: There is none!I conducted a test, running 10 different ways of setting cookies, and not a single way of settingcookies worked consistently on every browser.Our solution was to use multiple ways of setting cookies ..."In the mean time (1.1.2002) Sean has added 3 additional setting and method #13 seems quite successful so far.#13 : header("Set-Cookie: testCookie=foo; path=/; domain=.foo.com; expires=" .gmstrftime("%A, %d-%b-%Y %H:%M:%S GMT",time()+9600));This would mean to set the header manually using the header() function.So we wrap the cookie handling here. All params are the same as in setcookie().Please rtfm for cookies. It really is a special case with many pitfalls.INFO:- Per default, IE6 requires sites that set cookies to have P3P policies (as defined by W3C) or otherwise thecookies are 'downgraded', thus are deleted when IE is closed.See http://support.microsoft.com/default.aspx?scid=kb;EN-US;q260971&GSSNB=1http://www.w3.org/P3P/- According to Netscape's cookie spec: 20 cookies per server or domain, 300 total cookies, and 4k per cookie.http://www.netscape.com/newsref/std/cookie_spec.html- Surprisingly, javascript cookies are the most reliable (if javascript is able to run of course).E.g.: echo "<script>document.cookie = 'test_cookie' + '=' + 'foo';</script>\n";

Parameter
string $name
the key
string $value = >>''<<
if not set or set to an empty string '', the client will delete the cookie.
string $expire = >>NULL,<<
a unix timestamp
string $path = >>NULL,<<
string $domain = >>NULL,<<
string $secure = >>NULL<<
(would be a boolean, but because php uses an int, we do it too.)
Returns void


arrayToHtml

private string arrayToHtml( array $array )

  Loops the given array or object and returns some html code with the key/value pairs.
I am using this peace of code all the time while coding/debugging so i thoughtit would be a handy function.of course this moves the array pointer.

Parameter
array $array
object $array
Returns string


dump

private void dump( &$param, string $noEcho )

  alias for var_dump_pre().

Parameter
&$param
Warning: documentation is missing.
string $noEcho
Warning: documentation is missing.
Returns void


var_dump_pre

private void var_dump_pre( mixed $param, [ string $noEcho ] )

  Beautify var_dump a little and add <pre>-tags around it. For debugging only.

Parameter
mixed $param
string $noEcho = >>FALSE<<
FALSE= echo / TRUE = return output string
Returns void


getAbsoluteWebPath

private void getAbsoluteWebPath( )

  Get the absolute path (without file) of the current script.
example: http://www.domain.com:80/directory/

Returns void

See Also getAbsoluteWebFile(), getAbsoluteWebFileQuery()

getAbsoluteWebFile

private void getAbsoluteWebFile( )

  Get the absolute path (with file) of the current script.
example: http://www.domain.com:80/directory/file.php

Returns void

See Also getAbsoluteWebPath(), getAbsoluteWebFileQuery()

getAbsoluteWebFileQuery

private void getAbsoluteWebFileQuery( )

  Get the absolute path (with file and querystring) of the current script.
example: http://www.domain.com:80/directory/file.php?a=b&c=d

Returns void

See Also getAbsoluteWebPath(), getAbsoluteWebFile()

getAbsolutePath

private void getAbsolutePath( )

  Get the physical absolute path (without file) of the current script.
example: c:/sites/www.domain.com/directory/

Returns void

See Also getAbsoluteFile()

getAbsoluteFile

private void getAbsoluteFile( )

  Get the physical absolute path (with file) of the current script.
example: c:/sites/www.domain.com/directory/index.php

Returns void

See Also getAbsolutePath()

isTrue

private bool isTrue( string $value )

  Intelligent is TRUE tester.
Tells whether a value should be considered as true or not.this is useful for ini files for example where all these valuesshould be treated as TRUE:Yes, Y, Ja, Oui, On, True (string or bool), 1 (string or int) => all case insensitiveeverything else, like No, Off, False, 0, is treated as FALSE.

Parameter
string $value
Returns bool


boolToString

private string boolToString( bool $param )

  Converts a bool to a string. If $param is (evaluates to) TRUE, returns 'true' etc.

Parameter
bool $param
Returns string

('true' or 'false')


isAlphaNumeric

private bool isAlphaNumeric( mixed &$var )

  Returns TRUE if the given var is a string, int or double.
returns FALSE otherwise (object, array, bool, resource, unknown, null).

Parameter
mixed &$var
Returns bool


isInvisible

private bool isInvisible( string $string )

  Tells if a given string contains only whitespace character.
For example a string with coposed of onlyspaces,tabs: "\t",line breaks: "\n" and "\r"is considered invisible.A string like '0' is considered to be visible.--sam to andrej: What is "\v"? And a better name isWhite()

Parameter
string $string
Returns bool


evalWrapper

private void evalWrapper( string $phpCode, array &$context, [ array $params ] )

  evalWrapper ( The new version. Replaces evalWrap() )
NOTE: Read the stuff above as intro.The passed PHP code rests in it's own scope and will not interfere with the rest ofthe program by accident. In future it may prevent certain calls. The passed $phpCode is interpretedjust like a normal php script but all output (e.g. normal text and PHP-echo's) is catched and willmake up the output of this function.example usage:

Parameter
string $phpCode
The PHP code to evaluate. It's recommended to write the $phpCode you pass
*WITH* the '<?php'- wrapping tags. Just as if you were coding a php-script. Mix of HTML
and PHP is then allowed! If you leave out the '<?php'- wrapping tags it will still work,
assuming it's pure PHP code (no HTML/PHP mix).
array &$context
('file'=>__FILE__, 'function'=>'foo', 'line'=>__LINE__, 'sourceFile'=>'foo.php');
this param is taken by reference, so check if after you called this function to see if any
errors occured.
array $params = >>array()<<
If you want to pass variables into the scope of the passed code you must set up a
hash array holding key/value pairs where the key is the var name and the value is the var
value (or a reference to it isn't a bad idea).
E.g. If you want $foo and $bar to be in scope, make an hash as follows: array('foo'=>$foo, 'bar'=>$bar);
You can also pass by reference doing array('foo'=> &$foo, 'bar'=> &$bar);
Returns void


evalErrorHandler

private void evalErrorHandler( $errNo, $errStr, $errFile, $errLine )

  DEPRECATED, DEPRECATED, DEPRECATED, DEPRECATED, DEPRECATED, DEPRECATED, DEPRECATED, DEPRECATED,
Used only by evalWrap().

Parameter
$errNo
Warning: documentation is missing.
$errStr
Warning: documentation is missing.
$errFile
Warning: documentation is missing.
$errLine
Warning: documentation is missing.
Returns void


bs_testShutdown

private bool bs_testShutdown( object [unknown] &$object, string $methodName )

  Test the bs_registerShutdownMethod() if it works.
To see if your method gets properly called you may call this function for testing.Supply the same object and method name as you registered before and themethod will be called just as it would during a shutdown.But as it isn't a real shutdown you can echo some output to check if it's running OK.During a real PHP shutdown echo's don't work.

Parameter
object [unknown] &$object
string $methodName
the method name without parenthesis (eg 'someFunction')
Returns bool

TRUE if object/method found, otherwise FALSE

Author(s) samuel blume <sb@infeer.com>, andrej arn <andrej@arn.li>

_bs_shutdown

private void _bs_shutdown( [ integer $triggerNr ] )

  The BS shutdown function that PHP will call on shutdown
Read above what this function is used for.NOTE: The parameter $triggerNr is ued for testing. If >=0 only the method thatis at position $triggerNr will be called.

Parameter
integer $triggerNr = >>-1<<
(see text above)
Returns void

Author(s) samuel blume <sb@infeer.com>, andrej arn <andrej@arn.li>

&classHyrachy

private array &classHyrachy( mixed &$classOrObject )

  Separate an object (or class) in it's hyrachy-components (vars and methods)
Analyse the class and it's parents and divide the vars and methods in aclass (object) hyrachy-tree. Starts with 0 with the root object and hasfollowing stucture:$objHyrachy[$nr]['name'] -> object name['vars'] -> object vars *excluding all* vars from parent objects['methods'] -> object methods *excluding all* methods from parent objects['allVars'] -> all vars of the passed object['allMethods'] -> all methods of the passed objectNOTE: Needs PHP V4.0.5 or up

Parameter
mixed &$classOrObject
Either a object or the name of the class (string)
Returns array

See above

Throws FALSE on error.

parseUid

private array parseUid( string $UID )

  parses an UID string into an array.
for the definition of an UID see the naming part of codingGuidelines.txt.

Parameter
string $UID
Returns array

(hash)

See Also uidArrayToString()

uidArrayToString

private string uidArrayToString( array $UID )

  opposite of parseUid().

Parameter
array $UID
Returns string

See Also parseUid()

getTmp

private string getTmp( )

  returns the systems default temp dir.
if it cannot be determined, the function attempts to create '/tmp'. if thatfails aswell, the function throws bool FALSE. i don't expect this to happen. but...backslashs are returned as foreslashes, and the last slash is added. examples:c:/temp//tmp/

Returns string

Throws bool FALSE (if could not determine temp dir. that should never happen.)

levenshteinPercent

private int levenshteinPercent( string $one, string $two )

  returns the levenshtein in %.
the smaller the number the better (more similar) the strings.examples:levenshteinPercent('foo', 'bar'); => 100 (all letters need to be changed.)levenshteinPercent('aaaaaa', 'b'); => 100 (all letters need to be changed.)levenshteinPercent('foobar', 'bar'); => 50 (3 letters need to be inserted, that's 50% changes.)levenshteinPercent('foobar', 'foobar'); => 0 (no changes are needed.)

Parameter
string $one
string $two
Returns int

(full non-float number from 0 to 100)


&classHyrachyToHtml

private string &classHyrachyToHtml( mixed &$param )

  Returns a HTML output of a class separate in it's hyrachy-components.
Analyse the class and it's parents using the function classHyrachy() andreturn a HTML output. Used for debugging.NOTE: Needs PHP V4.0.5 or up

Parameter
mixed &$param
Either a object or the name of the class (string) or the output of classHyrachy()
Returns string

see above

See Also classHyrachy()

isWhite

private void isWhite( $string )

 

Warning: documentation is missing.

Parameter
$string
Warning: documentation is missing.
Returns void


misc_ErrorHandler

private void misc_ErrorHandler( $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, &$context, &$context, &$context, &$context, &$context, &$context, &$context, &$context, &$context, &$context, &$context, &$context, &$context, &$context, &$context, &$context, &$context, &$context, &$context, &$context, &$context, &$context, &$context, &$context, &$context, &$context, &$context, &$context, &$context, &$context, &$context, &$context, &$context, &$context, &$context, $MISC_evalWrapperContextDefault, string $context, $params, $params, $params, $params, $params, $params, $params, $params, $params, $params, $params, $params, $params, $params, $params, $params, $params, $params, $params, $params, $params, $params, $params, $params, $params, $params, $params, $params, $params, $params, $params, $params, $params, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $bar, $bar, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $foo, $bar, $bar, $bar, &$foo, &$foo, &$foo, &$foo, &$foo, &$foo, &$foo, &$foo, &$foo, &$foo, &$foo, &$bar, &$bar, &$bar, $phpCode, $phpCode, $phpCode, $phpCode, &$context, array $params, $MISC_evalWrapperContextDefault, $MISC_errorHandler_lastError, string $MISC_evalWrapper, $context, $MISC_evalWrapperContextDefault, $MISC_evalWrapperContextDefault, string $key, $val, $context, $context, $context, $key, $key, $context, $key, $key, $val, $val, $params, $params, $params, $params, $params, $params, $params, $params, $params, $params, string $key, $dev0, string $key}, $params, $key, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, $phpCode, string $phpCode, $phpCode, string $oldTrackErr, string $oldErrLevel, string $MISC_errorHandler_lastError, string $php_errormsg, string $ret, string $out, $oldTrackErr, $oldTrackErr, $oldTrackErr, $oldTrackErr, $oldTrackErr, $oldTrackErr, $oldTrackErr, $oldTrackErr, $oldTrackErr, $oldTrackErr, $oldTrackErr, $oldTrackErr, $oldTrackErr, $oldTrackErr, $oldTrackErr, $oldErrLevel, $oldErrLevel, $oldErrLevel, string $error, $MISC_errorHandler_lastError, $MISC_errorHandler_lastError, $MISC_errorHandler_lastError, $context, $context, $context, $context, $context, $context, $context, $MISC_errorHandler_lastError, $context, $context, $context, $context, $context, $MISC_errorHandler_lastError, $context, $context, $context, $context, $context, $MISC_errorHandler_lastError, $context, $context, $context, $context, $context, $MISC_errorHandler_lastError, $context, $context, $context, $context, $context, $MISC_errorHandler_lastError, string $error, $php_errormsg, $php_errormsg, $php_errormsg, $php_errormsg, $php_errormsg, $php_errormsg, $php_errormsg, $php_errormsg, $php_errormsg, $php_errormsg, $out, $out, $out, $out, $out, $out, $out, $out, $out, $errLine, $context, $context, $context, $context, $context, $context, $context, $context, $context, $context, $context, $context, $context, $context, $context, $context, $php_errormsg, $php_errormsg, $context, $context, $context, $errLine, $errLine, string $out, string $error, $context, $context, $context, $context, $context, $context, $context, $error, $error, $error, $error )

 

Warning: documentation is missing.

Parameter
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode
Warning: documentation is missing.
$phpCode