global.php
This includes code to update < 4.1.0 globals to the newer format It also has some session register functions that work across various php versions.
returns true if current php version is at mimimum a.b.c
Called: check_php_version(4,1)
returns true if the current internal SM version is at minimum a.b.c These are plain integer comparisons, as our internal version is constructed by us, as an array of 3 ints.
Called: check_sm_version(1,3,3)
Find files and/or directories in a given directory optionally limited to only those with the given file extension. If the directory is not found or cannot be opened, no error is generated; only an empty file list is returned.
session_regenerate_id replacement for PHP < 4.3.2
This code is borrowed from Gallery, session.php version 1.53.2.1
php_self
Creates an URL for the page calling this function, using either the PHP global REQUEST_URI, or the PHP global PHP_SELF with QUERY_STRING added. Before 1.5.1 function was stored in function/strings.php.
Print variable
sm_print_r($some_variable, [$some_other_variable [, ...]]);
Debugging function - does the same as print_r, but makes sure special characters are converted to htmlentities first. This will allow values like <[email protected]> to be displayed. The output is wrapped in <pre> and </pre> tags. Since 1.4.2 accepts unlimited number of arguments.
Search for the var $name in $_SESSION, $_POST, $_GET, $_COOKIE, or $_SERVER and set it in provided var.
If $search is not provided, or if it is SQ_INORDER, it will search $_SESSION, then $_POST, then $_GET. If $search is SQ_FORM it will search $_POST and $_GET. Otherwise, use one of the defined constants to look for a var in one place specifically.
Note: $search is an int value equal to one of the constants defined above.
Example: sqgetGlobalVar('username',$username,SQ_SESSION); // No quotes around last param, it's a constant - not a string!
Deletes an existing session, more advanced than the standard PHP session_destroy(), it explicitly deletes the cookies and global vars.
WARNING: Older PHP versions have some issues with session management. See http://bugs.php.net/11643 (warning, spammed bug tracker) and http://bugs.php.net/13834. SID constant is not destroyed in PHP 4.1.2, 4.2.3 and maybe other versions. If you restart session after session is destroyed, affected PHP versions produce PHP notice. Bug should be fixed only in 4.3.0
Function to verify a session has been started. If it hasn't
start a session up. php.net doesn't tell you that $_SESSION (even though autoglobal), is not created unless a session is started, unlike $_POST, $_GET and such
Checks to see if a variable has already been registered in the session.
Add a variable to the session.
Function to start the session and store the cookie with the session_id as
HttpOnly cookie which means that the cookie isn't accessible by javascript (IE6 only)
Delete a variable from the session.
Set a cookie
Send the cookie header
Cookies set with sqsetcookie will bet set after a sqsetcookieflush call.
Recursively strip slashes from the values of an array.
Documentation generated on Sat, 07 Oct 2006 16:11:26 +0300 by phpDocumentor 1.3.0RC6