Skip to content

Commit

Permalink
Remove tests
Browse files Browse the repository at this point in the history
  • Loading branch information
laoneo committed Jun 4, 2017
1 parent 3d57bfb commit c71812a
Show file tree
Hide file tree
Showing 25 changed files with 3,916 additions and 0 deletions.
340 changes: 340 additions & 0 deletions libraries/vendor/joomla/session/LICENSE

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions libraries/vendor/joomla/session/meta/sql/mysql.sql
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;
6 changes: 6 additions & 0 deletions libraries/vendor/joomla/session/meta/sql/pgsql.sql
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")
);
6 changes: 6 additions & 0 deletions libraries/vendor/joomla/session/meta/sql/sqlite.sql
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`)
);
9 changes: 9 additions & 0 deletions libraries/vendor/joomla/session/meta/sql/sqlsrv.sql
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];
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 libraries/vendor/joomla/session/src/Handler/ApcHandler.php
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 libraries/vendor/joomla/session/src/Handler/ApcuHandler.php
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'));
}
}

0 comments on commit c71812a

Please sign in to comment.