| Current Path : /home/wuectly/www/03cbe/ |
| Current File : /home/wuectly/www/03cbe/Storage.zip |
PK V$]d� � Apcu.phpnu &1i� <?php
/**
* Part of the Joomla Framework Session Package
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*/
namespace Joomla\Session\Storage;
use Joomla\Session\Storage;
/**
* APCU session storage handler for PHP
*
* @link https://www.php.net/manual/en/function.session-set-save-handler.php
* @since 1.4.0
* @deprecated 2.0 The Storage class chain will be removed.
*/
class Apcu extends Storage
{
/**
* Constructor
*
* @param array $options Optional parameters
*
* @since 1.4.0
* @throws \RuntimeException
*/
public function __construct($options = array())
{
if (!self::isSupported())
{
throw new \RuntimeException('APCU Extension is not available', 404);
}
parent::__construct($options);
}
/**
* Read the data for a particular session identifier from the
* SessionHandler backend.
*
* @param string $id The session identifier.
*
* @return string The session data.
*
* @since 1.4.0
*/
public function read($id)
{
$sess_id = 'sess_' . $id;
return (string) apcu_fetch($sess_id);
}
/**
* Write session data to the SessionHandler backend.
*
* @param string $id The session identifier.
* @param string $sessionData The session data.
*
* @return boolean True on success, false otherwise.
*
* @since 1.4.0
*/
public function write($id, $sessionData)
{
$sess_id = 'sess_' . $id;
return apcu_store($sess_id, $sessionData, ini_get('session.gc_maxlifetime'));
}
/**
* Destroy the data for a particular session identifier in the SessionHandler backend.
*
* @param string $id The session identifier.
*
* @return boolean True on success, false otherwise.
*
* @since 1.4.0
*/
public function destroy($id)
{
$sess_id = 'sess_' . $id;
return apcu_delete($sess_id);
}
/**
* Test to see if the SessionHandler is available.
*
* @return boolean True on success, false otherwise.
*
* @since 1.4.0
*/
public static function isSupported()
{
return \extension_loaded('apcu');
}
}
PK V$]SC�� � None.phpnu &1i� <?php
/**
* Part of the Joomla Framework Session Package
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*/
namespace Joomla\Session\Storage;
use Joomla\Session\Storage;
/**
* Default PHP configured session handler for Joomla!
*
* @link https://www.php.net/manual/en/function.session-set-save-handler.php
* @since 1.0
* @deprecated 2.0 The Storage class chain will be removed
*/
class None extends Storage
{
/**
* Register the functions of this class with PHP's session handler
*
* @return void
*
* @since 1.0
* @deprecated 2.0
*/
public function register()
{
}
}
PK V$]�\�kl l Memcache.phpnu &1i� <?php
/**
* Part of the Joomla Framework Session Package
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*/
namespace Joomla\Session\Storage;
use Joomla\Session\Storage;
/**
* Memcache session storage handler for PHP
*
* @since 1.0
* @deprecated 2.0 The Storage class chain will be removed
*/
class Memcache extends Storage
{
/**
* Container for server data
*
* @var array
* @since 1.0
* @deprecated 2.0
*/
protected $_servers = array();
/**
* Constructor
*
* @param array $options Optional parameters.
*
* @since 1.0
* @throws \RuntimeException
* @deprecated 2.0
*/
public function __construct($options = array())
{
if (!self::isSupported())
{
throw new \RuntimeException('Memcache Extension is not available', 404);
}
// This will be an array of loveliness
// @todo: multiple servers
$this->_servers = array(
array(
'host' => isset($options['memcache_server_host']) ? $options['memcache_server_host'] : 'localhost',
'port' => isset($options['memcache_server_port']) ? $options['memcache_server_port'] : 11211,
),
);
parent::__construct($options);
}
/**
* Register the functions of this class with PHP's session handler
*
* @return void
*
* @since 1.0
* @deprecated 2.0
*/
public function register()
{
if (!headers_sent())
{
ini_set('session.save_path', $this->_servers[0]['host'] . ':' . $this->_servers[0]['port']);
ini_set('session.save_handler', 'memcache');
}
}
/**
* Test to see if the SessionHandler is available.
*
* @return boolean True on success, false otherwise.
*
* @since 1.0
* @deprecated 2.0
*/
public static function isSupported()
{
return \extension_loaded('memcache') && class_exists('Memcache');
}
}
PK V$]���r@ @ Database.phpnu &1i� <?php
/**
* Part of the Joomla Framework Session Package
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*/
namespace Joomla\Session\Storage;
use Joomla\Database\DatabaseDriver;
use Joomla\Session\Storage;
/**
* Database session storage handler for PHP
*
* @link https://www.php.net/manual/en/function.session-set-save-handler.php
* @since 1.0
* @deprecated 2.0 The Storage class chain will be removed
*/
class Database extends Storage
{
/**
* The DatabaseDriver to use when querying.
*
* @var DatabaseDriver
* @since 1.0
* @deprecated 2.0
*/
protected $db;
/**
* Constructor
*
* @param array $options Optional parameters. A `dbo` options is required.
*
* @since 1.0
* @throws \RuntimeException
* @deprecated 2.0
*/
public function __construct($options = array())
{
if (isset($options['db']) && ($options['db'] instanceof DatabaseDriver))
{
parent::__construct($options);
$this->db = $options['db'];
}
else
{
throw new \RuntimeException(
sprintf('The %s storage engine requires a `db` option that is an instance of Joomla\\Database\\DatabaseDriver.', __CLASS__)
);
}
}
/**
* Read the data for a particular session identifier from the SessionHandler backend.
*
* @param string $id The session identifier.
*
* @return string The session data.
*
* @since 1.0
* @deprecated 2.0
*/
public function read($id)
{
try
{
// Get the session data from the database table.
$query = $this->db->getQuery(true);
$query->select($this->db->quoteName('data'))
->from($this->db->quoteName('#__session'))
->where($this->db->quoteName('session_id') . ' = ' . $this->db->quote($id));
$this->db->setQuery($query);
return (string) $this->db->loadResult();
}
catch (\Exception $e)
{
return false;
}
}
/**
* Write session data to the SessionHandler backend.
*
* @param string $id The session identifier.
* @param string $data The session data.
*
* @return boolean True on success, false otherwise.
*
* @since 1.0
* @deprecated 2.0
*/
public function write($id, $data)
{
try
{
$query = $this->db->getQuery(true);
$query->update($this->db->quoteName('#__session'))
->set($this->db->quoteName('data') . ' = ' . $this->db->quote($data))
->set($this->db->quoteName('time') . ' = ' . $this->db->quote((int) time()))
->where($this->db->quoteName('session_id') . ' = ' . $this->db->quote($id));
// Try to update the session data in the database table.
$this->db->setQuery($query);
if (!$this->db->execute())
{
return false;
}
// Since $this->db->execute did not throw an exception the query was successful.
// Either the data changed, or the data was identical. In either case we are done.
return true;
}
catch (\Exception $e)
{
return false;
}
}
/**
* Destroy the data for a particular session identifier in the SessionHandler backend.
*
* @param string $id The session identifier.
*
* @return boolean True on success, false otherwise.
*
* @since 1.0
* @deprecated 2.0
*/
public function destroy($id)
{
try
{
$query = $this->db->getQuery(true);
$query->delete($this->db->quoteName('#__session'))
->where($this->db->quoteName('session_id') . ' = ' . $this->db->quote($id));
// Remove a session from the database.
$this->db->setQuery($query);
return (boolean) $this->db->execute();
}
catch (\Exception $e)
{
return false;
}
}
/**
* Garbage collect stale sessions from the SessionHandler backend.
*
* @param integer $lifetime The maximum age of a session.
*
* @return boolean True on success, false otherwise.
*
* @since 1.0
* @deprecated 2.0
*/
public function gc($lifetime = 1440)
{
// Determine the timestamp threshold with which to purge old sessions.
$past = time() - $lifetime;
try
{
$query = $this->db->getQuery(true);
$query->delete($this->db->quoteName('#__session'))
->where($this->db->quoteName('time') . ' < ' . $this->db->quote((int) $past));
// Remove expired sessions from the database.
$this->db->setQuery($query);
return (boolean) $this->db->execute();
}
catch (\Exception $e)
{
return false;
}
}
}
PK V$]�fy�
Xcache.phpnu &1i� <?php
/**
* Part of the Joomla Framework Session Package
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*/
namespace Joomla\Session\Storage;
use Joomla\Session\Storage;
/**
* XCache session storage handler
*
* @since 1.0
* @deprecated 2.0 The Storage class chain will be removed
*/
class Xcache extends Storage
{
/**
* Constructor
*
* @param array $options Optional parameters.
*
* @since 1.0
* @throws \RuntimeException
* @deprecated 2.0
*/
public function __construct($options = array())
{
if (!self::isSupported())
{
throw new \RuntimeException('XCache Extension is not available', 404);
}
parent::__construct($options);
}
/**
* Read the data for a particular session identifier from the SessionHandler backend.
*
* @param string $id The session identifier.
*
* @return string The session data.
*
* @since 1.0
* @deprecated 2.0
*/
public function read($id)
{
$sess_id = 'sess_' . $id;
// Check if id exists
if (!xcache_isset($sess_id))
{
return '';
}
return (string) xcache_get($sess_id);
}
/**
* Write session data to the SessionHandler backend.
*
* @param string $id The session identifier.
* @param string $sessionData The session data.
*
* @return boolean True on success, false otherwise.
*
* @since 1.0
* @deprecated 2.0
*/
public function write($id, $sessionData)
{
$sess_id = 'sess_' . $id;
return xcache_set($sess_id, $sessionData, ini_get('session.gc_maxlifetime'));
}
/**
* Destroy the data for a particular session identifier in the SessionHandler backend.
*
* @param string $id The session identifier.
*
* @return boolean True on success, false otherwise.
*
* @since 1.0
* @deprecated 2.0
*/
public function destroy($id)
{
$sess_id = 'sess_' . $id;
if (!xcache_isset($sess_id))
{
return true;
}
return xcache_unset($sess_id);
}
/**
* Test to see if the SessionHandler is available.
*
* @return boolean True on success, false otherwise.
*
* @since 1.0
* @deprecated 2.0
*/
public static function isSupported()
{
return \extension_loaded('xcache');
}
}
PK V$]��Z� � Apc.phpnu &1i� <?php
/**
* Part of the Joomla Framework Session Package
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*/
namespace Joomla\Session\Storage;
use Joomla\Session\Storage;
/**
* APC session storage handler for PHP
*
* @link https://www.php.net/manual/en/function.session-set-save-handler.php
* @since 1.0
* @deprecated 2.0 The Storage class chain will be removed.
*/
class Apc extends Storage
{
/**
* Constructor
*
* @param array $options Optional parameters
*
* @since 1.0
* @throws \RuntimeException
* @deprecated 2.0
*/
public function __construct($options = array())
{
if (!self::isSupported())
{
throw new \RuntimeException('APC Extension is not available', 404);
}
parent::__construct($options);
}
/**
* Read the data for a particular session identifier from the
* SessionHandler backend.
*
* @param string $id The session identifier.
*
* @return string The session data.
*
* @since 1.0
* @deprecated 2.0
*/
public function read($id)
{
$sess_id = 'sess_' . $id;
return (string) apc_fetch($sess_id);
}
/**
* Write session data to the SessionHandler backend.
*
* @param string $id The session identifier.
* @param string $sessionData The session data.
*
* @return boolean True on success, false otherwise.
*
* @since 1.0
* @deprecated 2.0
*/
public function write($id, $sessionData)
{
$sess_id = 'sess_' . $id;
return apc_store($sess_id, $sessionData, ini_get('session.gc_maxlifetime'));
}
/**
* Destroy the data for a particular session identifier in the SessionHandler backend.
*
* @param string $id The session identifier.
*
* @return boolean True on success, false otherwise.
*
* @since 1.0
* @deprecated 2.0
*/
public function destroy($id)
{
$sess_id = 'sess_' . $id;
return apc_delete($sess_id);
}
/**
* Test to see if the SessionHandler is available.
*
* @return boolean True on success, false otherwise.
*
* @since 1.0
* @deprecated 2.0
*/
public static function isSupported()
{
return \extension_loaded('apc');
}
}
PK V$]I�Eg g
Memcached.phpnu &1i� <?php
/**
* Part of the Joomla Framework Session Package
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*/
namespace Joomla\Session\Storage;
use Joomla\Session\Storage;
/**
* Memcached session storage handler for PHP
*
* @since 1.0
* @deprecated 2.0 The Storage class chain will be removed
*/
class Memcached extends Storage
{
/**
* Container for server data
*
* @var array
* @since 1.0
* @deprecated 2.0
*/
protected $_servers = array();
/**
* Constructor
*
* @param array $options Optional parameters.
*
* @since 1.0
* @throws \RuntimeException
* @deprecated 2.0
*/
public function __construct($options = array())
{
if (!self::isSupported())
{
throw new \RuntimeException('Memcached Extension is not available', 404);
}
// This will be an array of loveliness
// @todo: multiple servers
$this->_servers = array(
array(
'host' => isset($options['memcache_server_host']) ? $options['memcache_server_host'] : 'localhost',
'port' => isset($options['memcache_server_port']) ? $options['memcache_server_port'] : 11211,
),
);
// Only construct parent AFTER host and port are sent, otherwise when register is called this will fail.
parent::__construct($options);
}
/**
* Register the functions of this class with PHP's session handler
*
* @return void
*
* @since 1.0
* @deprecated 2.0
*/
public function register()
{
if (!headers_sent())
{
ini_set('session.save_path', $this->_servers[0]['host'] . ':' . $this->_servers[0]['port']);
ini_set('session.save_handler', 'memcached');
}
}
/**
* Test to see if the SessionHandler is available.
*
* @return boolean True on success, false otherwise.
*
* @since 1.0
* @deprecated 2.0
*/
public static function isSupported()
{
/*
* GAE and HHVM have both had instances where Memcached the class was defined but no extension was loaded.
* If the class is there, we can assume it works.
*/
return class_exists('Memcached');
}
}
PK V$]��� � Wincache.phpnu &1i� <?php
/**
* Part of the Joomla Framework Session Package
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*/
namespace Joomla\Session\Storage;
use Joomla\Session\Storage;
/**
* WINCACHE session storage handler for PHP
*
* @since 1.0
* @deprecated 2.0 The Storage class chain will be removed
*/
class Wincache extends Storage
{
/**
* Constructor
*
* @param array $options Optional parameters.
*
* @since 1.0
* @throws \RuntimeException
* @deprecated 2.0
*/
public function __construct($options = array())
{
if (!self::isSupported())
{
throw new \RuntimeException('Wincache Extension is not available', 404);
}
parent::__construct($options);
}
/**
* Register the functions of this class with PHP's session handler
*
* @return void
*
* @since 1.0
* @deprecated 2.0
*/
public function register()
{
if (!headers_sent())
{
ini_set('session.save_handler', 'wincache');
}
}
/**
* Test to see if the SessionHandler is available.
*
* @return boolean True on success, false otherwise.
*
* @since 1.0
* @deprecated 2.0
*/
public static function isSupported()
{
return \extension_loaded('wincache') && \function_exists('wincache_ucache_get') && !strcmp(ini_get('wincache.ucenabled'), '1');
}
}
PK V$]d� � Apcu.phpnu &1i� PK V$]SC�� � � None.phpnu &1i� PK V$]�\�kl l � Memcache.phpnu &1i� PK V$]���r@ @ r Database.phpnu &1i� PK V$]�fy�
�$ Xcache.phpnu &1i� PK V$]��Z� � 5. Apc.phpnu &1i� PK V$]I�Eg g
B7 Memcached.phpnu &1i� PK V$]��� � �? Wincache.phpnu &1i� PK R �E