src/Session/Factory.php
static function getSession(){
		if(self::$session == null){
			$sessionImplClassName = Settings::getSettings('php-platform/session',"session.class");
			try{
				$sessionImplReflectionClass = new \ReflectionClass($sessionImplClassName);
			}catch (\ReflectionException $re){
				throw new ProgrammingError("session implementation class is not configured or invalid");
			}
			$sessionInterfaceName = 'PhpPlatform\Session\Session';
			if(!$sessionImplReflectionClass->implementsInterface($sessionInterfaceName)){
				throw new ProgrammingError("$sessionImplClassName does not implement $sessionInterfaceName");
			}
			
			$sessionGetInstanceReflectionMethod = $sessionImplReflectionClass->getMethod('getInstance');
			
			self::$session = $sessionGetInstanceReflectionMethod->invokeArgs(null,array());
		}
		return self::$session;
	}
static function getSession(){
		if(self::$session == null){
			$sessionImplClassName = Settings::getSettings('php-platform/session',"session.class");
			try{
				$sessionImplReflectionClass = new \ReflectionClass($sessionImplClassName);
			}catch (\ReflectionException $re){
				throw new ProgrammingError("session implementation class is not configured or invalid");
			}
			$sessionInterfaceName = 'PhpPlatform\Session\Session';
			if(!$sessionImplReflectionClass->implementsInterface($sessionInterfaceName)){
				throw new ProgrammingError("$sessionImplClassName does not implement $sessionInterfaceName");
			}
			
			$sessionGetInstanceReflectionMethod = $sessionImplReflectionClass->getMethod('getInstance');
			
			self::$session = $sessionGetInstanceReflectionMethod->invokeArgs(null,array());
		}
		return self::$session;
	}
static function getSession ( ) { if ( self :: $ session == null ) { $ sessionImplClassName = Settings :: getSettings ( 'php-platform/session' , "session.class" ) ; try { $ sessionImplReflectionClass = new \ ReflectionClass ( $ sessionImplClassName ) ; } catch ( \ ReflectionException $ re ) { throw new ProgrammingError ( "session implementation class is not configured or invalid" ) ; } $ sessionInterfaceName = 'PhpPlatform\Session\Session' ; if ( ! $ sessionImplReflectionClass -> implementsInterface ( $ sessionInterfaceName ) ) { throw new ProgrammingError ( "$sessionImplClassName does not implement $sessionInterfaceName" ) ; } $ sessionGetInstanceReflectionMethod = $ sessionImplReflectionClass -> getMethod ( 'getInstance' ) ; self :: $ session = $ sessionGetInstanceReflectionMethod -> invokeArgs ( null , array ( ) ) ; } return self :: $ session ; }
This method returns Session singleton object
@throws ProgrammingError
@return Session
This method returns Session singleton object