johanafm;10988150 wrote:As usual, go to the doc at php.net...
Thanks for the reply. I already looked at several examples but I still don't "get it".
Php.net is the first place I go to for answers. If it's still unclear, I google. If it still does not make since I search various forums for answers, then I post a question.
That's where I'm at... I'm just not getting it so I posted the question here.
Below is a larger snippet, if that helps:
function getStorageHandlers()
{
$path = dirname(__FILE__).DIRECTORY_SEPARATOR.'storage';
if( !($handle = opendir($path)) )
{
return FALSE;
}
$storageHandlers = array();
while( ($file = readdir($handle)) !== false )
{
if( !preg_match('/\.php$/i', $file) ) continue;
$name = strtolower(substr($file, 0, strrpos($file, '.')));
$class = 'SESessionStorage'.ucfirst($name);
if( !class_exists($class) )
{
require_once(dirname(__FILE__).DIRECTORY_SEPARATOR.'storage'.DIRECTORY_SEPARATOR.$name.'.php');
}
if( call_user_func_array(array( trim($class), 'test'), NULL) ) {
$storageHandlers[] = $name;
}
}
return $storageHandlers;
}
function isNew()
{
$counter = $this->get( 'session.counter' );
return ( $counter === 1 );
}
function &get($key, $default = null, $group='default')
{
$group = '__' . $group;
if( $this->_state !== 'active' && $this->_state !== 'expired' )
{
return NULL;
}