Actions

API15

JSession/getStores

From Joomla! Documentation

< API15:JSession
Revision as of 12:46, 12 May 2013 by JoomlaWikiBot (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Replacement filing cabinet.png
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.

Contents

Description

Get the session handlers

[<! removed edit link to red link >]

<! removed transcluded page call, red link never existed >

Syntax

getStores()


Returns

array An array of available session handlers

Defined in

libraries/joomla/session/session.php

Importing

jimport( 'joomla.session.session' );

Source Body

function getStores()
{
        jimport('joomla.filesystem.folder');
        $handlers = JFolder::files(dirname(__FILE__).DS.'storage', '.php$');
 
        $names = array();
        foreach($handlers as $handler)
        {
                $name = substr($handler, 0, strrpos($handler, '.'));
                $class = 'JSessionStorage'.ucfirst($name);
 
                //Load the class only if needed
                if(!class_exists($class)) {
                        require_once(dirname(__FILE__).DS.'storage'.DS.$name.'.php');
                }
 
                if(call_user_func_array( array( trim($class), 'test' ), array())) {
                        $names[] = $name;
                }
        }
 
        return $names;
}

[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >

Examples

<CodeExamplesForm />