-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
3,916 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
CREATE TABLE IF NOT EXISTS `#__session` ( | ||
`session_id` VARBINARY(128) NOT NULL, | ||
`time` INTEGER UNSIGNED NOT NULL, | ||
`data` BLOB NOT NULL, | ||
PRIMARY KEY (`session_id`) | ||
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
CREATE TABLE "#__session" ( | ||
"session_id" VARCHAR(128) NOT NULL, | ||
"time" INTEGER NOT NULL, | ||
"data" BYTEA NOT NULL, | ||
PRIMARY KEY ("session_id") | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
CREATE TABLE `#__session` ( | ||
`session_id` TEXT NOT NULL, | ||
`time` INTEGER NOT NULL, | ||
`data` BLOB NOT NULL, | ||
CONSTRAINT `idx_session` PRIMARY KEY (`session_id`) | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
CREATE TABLE [#__session] ( | ||
[session_id] VARCHAR(128) NOT NULL, | ||
[time] INTEGER NOT NULL, | ||
[data] VARBINARY(MAX) NOT NULL, | ||
CONSTRAINT [PK_#__session_session_id] PRIMARY KEY CLUSTERED | ||
( | ||
[session_id] ASC | ||
) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] | ||
) ON [PRIMARY]; |
18 changes: 18 additions & 0 deletions
18
libraries/vendor/joomla/session/src/Exception/InvalidSessionException.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
/** | ||
* Part of the Joomla Framework Session Package | ||
* | ||
* @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. | ||
* @license GNU General Public License version 2 or later; see LICENSE | ||
*/ | ||
|
||
namespace Joomla\Session\Exception; | ||
|
||
/** | ||
* Exception thrown when a session validator fails | ||
* | ||
* @since __DEPLOY_VERSION__ | ||
*/ | ||
class InvalidSessionException extends \RuntimeException | ||
{ | ||
} |
144 changes: 144 additions & 0 deletions
144
libraries/vendor/joomla/session/src/Handler/ApcHandler.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,144 @@ | ||
<?php | ||
/** | ||
* Part of the Joomla Framework Session Package | ||
* | ||
* @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. | ||
* @license GNU General Public License version 2 or later; see LICENSE | ||
*/ | ||
|
||
namespace Joomla\Session\Handler; | ||
|
||
use Joomla\Session\HandlerInterface; | ||
|
||
/** | ||
* APC session storage handler | ||
* | ||
* @since __DEPLOY_VERSION__ | ||
*/ | ||
class ApcHandler implements HandlerInterface | ||
{ | ||
/** | ||
* Session ID prefix to avoid naming conflicts | ||
* | ||
* @var string | ||
* @since __DEPLOY_VERSION__ | ||
*/ | ||
private $prefix; | ||
|
||
/** | ||
* Constructor | ||
* | ||
* @param array $options Associative array of options to configure the handler | ||
* | ||
* @since __DEPLOY_VERSION__ | ||
*/ | ||
public function __construct(array $options = []) | ||
{ | ||
// Namespace our session IDs to avoid potential conflicts | ||
$this->prefix = isset($options['prefix']) ? $options['prefix'] : 'jfw'; | ||
} | ||
|
||
/** | ||
* Close the session | ||
* | ||
* @return boolean True on success, false otherwise | ||
* | ||
* @since __DEPLOY_VERSION__ | ||
*/ | ||
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 __DEPLOY_VERSION__ | ||
*/ | ||
public function destroy($session_id) | ||
{ | ||
return apc_delete($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 __DEPLOY_VERSION__ | ||
*/ | ||
public function gc($maxlifetime) | ||
{ | ||
return true; | ||
} | ||
|
||
/** | ||
* Test to see if the HandlerInterface is available | ||
* | ||
* @return boolean True on success, false otherwise | ||
* | ||
* @since __DEPLOY_VERSION__ | ||
*/ | ||
public static function isSupported() | ||
{ | ||
$supported = extension_loaded('apc') && ini_get('apc.enabled'); | ||
|
||
// If on the CLI interface, the `apc.enable_cli` option must also be enabled | ||
if ($supported && php_sapi_name() === '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 __DEPLOY_VERSION__ | ||
*/ | ||
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 __DEPLOY_VERSION__ | ||
*/ | ||
public function read($session_id) | ||
{ | ||
return (string) apc_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 __DEPLOY_VERSION__ | ||
*/ | ||
public function write($session_id, $session_data) | ||
{ | ||
return apc_store($this->prefix . $session_id, $session_data, ini_get('session.gc_maxlifetime')); | ||
} | ||
} |
145 changes: 145 additions & 0 deletions
145
libraries/vendor/joomla/session/src/Handler/ApcuHandler.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,145 @@ | ||
<?php | ||
/** | ||
* Part of the Joomla Framework Session Package | ||
* | ||
* @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. | ||
* @license GNU General Public License version 2 or later; see LICENSE | ||
*/ | ||
|
||
namespace Joomla\Session\Handler; | ||
|
||
use Joomla\Session\HandlerInterface; | ||
|
||
/** | ||
* APCu session storage handler | ||
* | ||
* @since __DEPLOY_VERSION__ | ||
*/ | ||
class ApcuHandler implements HandlerInterface | ||
{ | ||
/** | ||
* Session ID prefix to avoid naming conflicts | ||
* | ||
* @var string | ||
* @since __DEPLOY_VERSION__ | ||
*/ | ||
private $prefix; | ||
|
||
/** | ||
* Constructor | ||
* | ||
* @param array $options Associative array of options to configure the handler | ||
* | ||
* @since __DEPLOY_VERSION__ | ||
*/ | ||
public function __construct(array $options = []) | ||
{ | ||
// Namespace our session IDs to avoid potential conflicts | ||
$this->prefix = isset($options['prefix']) ? $options['prefix'] : 'jfw'; | ||
} | ||
|
||
/** | ||
* Close the session | ||
* | ||
* @return boolean True on success, false otherwise | ||
* | ||
* @since __DEPLOY_VERSION__ | ||
*/ | ||
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 __DEPLOY_VERSION__ | ||
*/ | ||
public function destroy($session_id) | ||
{ | ||
// 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 __DEPLOY_VERSION__ | ||
*/ | ||
public function gc($maxlifetime) | ||
{ | ||
return true; | ||
} | ||
|
||
/** | ||
* Test to see if the HandlerInterface is available | ||
* | ||
* @return boolean True on success, false otherwise | ||
* | ||
* @since __DEPLOY_VERSION__ | ||
*/ | ||
public static function isSupported() | ||
{ | ||
$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_name() === '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 __DEPLOY_VERSION__ | ||
*/ | ||
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 __DEPLOY_VERSION__ | ||
*/ | ||
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 __DEPLOY_VERSION__ | ||
*/ | ||
public function write($session_id, $session_data) | ||
{ | ||
return apcu_store($this->prefix . $session_id, $session_data, ini_get('session.gc_maxlifetime')); | ||
} | ||
} |
Oops, something went wrong.