public static function onCreate() { /* * This is used to provide a 'auth' lock. * Since this library is depended on sessions, locking this will also lock sessions. * That way sessions is not closed and re-opened if used during shutdown. */ Runtime::addLock("session"); }
public static function onCreate() { if (!Runtime::$SETTINGS->getBoolean("FILE_IMPORT_DISABLE_AUTOINCLUDE")) { if (Runtime::$SETTINGS->containsKey("FILE_IMPORT")) { static::$mGroups = Runtime::$SETTINGS->getArray("FILE_IMPORT", []); } Runtime::addLock("router"); } }
public function read() : string { /* * If cache uses things like database etc. * this will lock those things from disconnection during shutdown * until sessions has been re-cached. */ Runtime::addLock("cache"); return (string) Cache::getRaw($this->mSessId); }
public static function onCreate() { /* * This is used to provide a 'cache' lock. * Cache might be using a Database that should not be stopped until cache is done. */ if (Runtime::$SETTINGS->getString("CACHE_DRIVER") == "database") { Runtime::addLock("database"); } }
public function read() : string { $data = null; if (Database::isConnected()) { $result = Database::select("sessions")->field("cData")->cond("cSessId", "s", $this->mSessId)->enquire(); if ($result !== null) { if ($result->numRows() > 0) { $row = $result->fetch(); $data = $row[0]; $this->mUpdate = true; } $result->destroy(); } } Runtime::addLock("database"); return (string) $data; }