芝麻web文件管理V1.00
编辑当前文件:/home2/sdektunc/.trash/libraries.1/vendor/joomla/session/src/Handler/ApcuHandler.php
prefix = $options['prefix'] ?? 'jfw'; } /** * Close the session * * @return boolean True on success, false otherwise * * @since 2.0.0 */ public function close() { return true; } /** * Destroy a session * * @param integer $session_id The session ID being destroyed * * @return boolean True on success, false otherwise * * @since 2.0.0 */ public function destroy($session_id): bool { // The apcu_delete function returns false if the id does not exist return apcu_delete($this->prefix . $session_id) || !apcu_exists($this->prefix . $session_id); } /** * Cleanup old sessions * * @param integer $maxlifetime Sessions that have not updated for the last maxlifetime seconds will be removed * * @return boolean True on success, false otherwise * * @since 2.0.0 */ public function gc($maxlifetime) { return true; } /** * Test to see if the HandlerInterface is available * * @return boolean True on success, false otherwise * * @since 2.0.0 */ public static function isSupported(): bool { $supported = \extension_loaded('apcu') && ini_get('apc.enabled'); // If on the CLI interface, the `apc.enable_cli` option must also be enabled if ($supported && PHP_SAPI === 'cli') { $supported = ini_get('apc.enable_cli'); } return (bool) $supported; } /** * Initialize session * * @param string $save_path The path where to store/retrieve the session * @param string $session_id The session id * * @return boolean True on success, false otherwise * * @since 2.0.0 */ public function open($save_path, $session_id) { return true; } /** * Read session data * * @param string $session_id The session id to read data for * * @return string The session data * * @since 2.0.0 */ public function read($session_id) { return (string) apcu_fetch($this->prefix . $session_id); } /** * Write session data * * @param string $session_id The session id * @param string $session_data The encoded session data * * @return boolean True on success, false otherwise * * @since 2.0.0 */ public function write($session_id, $session_data) { return apcu_store($this->prefix . $session_id, $session_data, ini_get('session.gc_maxlifetime')); } }