public function __construct($dbName = null, $dbConnection = null, $tableName = 'sessions', $sessionName = '__sess', $lifetime = 3600, $path = null, $domain = null, $secure = false, $httpOnly = TRUE) { $this->dbName = $dbName; parent::__construct($dbConnection); $this->tableName = $tableName; $this->sessionName = $sessionName; $this->lifetime = $lifetime; $this->path = $path; $this->domain = $domain; $this->secure = $secure; $this->httpOnly = $httpOnly; $this->logger = \GTFramework\App::getLogger(); LOG < 0 ?: $this->logger->log('__construct in DBSession called with params: ' . 'dbName: ' . $dbName . ', dbConnection = ' . $dbConnection . ', tableName = ' . $tableName . ', sessionName = ' . $sessionName . ', lifetime = ' . $lifetime . ', path = ' . $path . ', domain = ' . $domain . ', secure = ' . $secure . ', httpOnly = ' . $httpOnly); if (rand(0, 100) === 52) { // echo '<pre>' . print_r('------------------CLEAR-----CLEAR----CLEAR-------------', TRUE) . '</pre><br />'; $this->dbClearOldSessions(); } if (isset($_COOKIE[$sessionName])) { $this->sessionId = $_COOKIE[$sessionName]; } if (strlen($this->sessionId) < 32) { LOG < 2 ?: $this->logger->log('__construct in DBSession check strlen of sessionId < 32 : ( ' . strlen($this->sessionId) . ' )'); $this->startNewSession(); } else { if (!$this->validateSession()) { LOG < 2 ?: $this->logger->log('__construct in DBSession validate session'); $this->startNewSession(); } } }
/** * * @return \GTFramework\Kernel */ public static function getInstance() { if (self::$_instance == null) { self::$_instance = new \GTFramework\Kernel(\GTFramework\App::getLogger()); } return self::$_instance; }
public function __construct($name = null, $lifetime = 3600, $path = null, $domain = null, $secure = false, $httponly = TRUE) { if (strlen($name) < 1) { $name = '_sess'; } $this->logger = \GTFramework\App::getLogger(); LOG < 2 ?: $this->logger->log('__construct in NativeSession created with params: name: ' . $name . ' lifetime: ' . $lifetime . ' path: ' . $path . ' domain: ' . $domain . ' secure: ' . $secure . ' httpOnly: ' . $httponly); session_name($name); session_set_cookie_params($lifetime, $path, $domain, $secure, $httponly); session_start(); $_COOKIE['__sess'] = session_id(); }
public function __construct($connection = NULL) { if ($connection instanceof \PDO) { $this->db = $connection; } else { if ($connection != NULL) { $this->db = \GTFramework\App::getInstance()->getConnectionToDB($connection); $this->connection = $connection; } else { $this->db = \GTFramework\App::getInstance()->getConnectionToDB($this->connection); } } if (!$this->logger) { $this->logger = \GTFramework\App::getLogger(); } LOG < 0 ?: $this->logger->log('__constructor in SimpleDB called with param: ' . print_r($connection, TRUE)); }
/** * * @return \GTFramework\View */ public static function getInstance() { if (self::$_instance == NULL) { self::$_instance = new \GTFramework\View(\GTFramework\App::getLogger()); } return self::$_instance; }
public function __construct() { $this->content = \GTFramework\View::getInstance()->getCDN(); $this->logger = \GTFramework\App::getLogger(); }
public function __construct($class) { $this->logger = \GTFramework\App::getLogger(); $this->reflection = new \ReflectionClass($class); }