From 3390af578ba76568056f893dd0b13e6546ae3777 Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Thu, 18 Jun 2020 22:41:01 +0100 Subject: [PATCH 1/2] #948 - Remove Session component --- Library/Phalcon/Session/Adapter/Aerospike.php | 256 ------------- Library/Phalcon/Session/Adapter/Database.php | 245 ------------- .../Phalcon/Session/Adapter/HandlerSocket.php | 335 ------------------ Library/Phalcon/Session/Adapter/Mongo.php | 187 ---------- Library/Phalcon/Session/Adapter/README.md | 199 ----------- .../Session/Adapter/AerospikeTest.php | 186 ---------- tests/unit/Session/Adapter/DatabaseTest.php | 219 ------------ 7 files changed, 1627 deletions(-) delete mode 100644 Library/Phalcon/Session/Adapter/Aerospike.php delete mode 100644 Library/Phalcon/Session/Adapter/Database.php delete mode 100644 Library/Phalcon/Session/Adapter/HandlerSocket.php delete mode 100644 Library/Phalcon/Session/Adapter/Mongo.php delete mode 100644 Library/Phalcon/Session/Adapter/README.md delete mode 100644 tests/aerospike/Session/Adapter/AerospikeTest.php delete mode 100644 tests/unit/Session/Adapter/DatabaseTest.php diff --git a/Library/Phalcon/Session/Adapter/Aerospike.php b/Library/Phalcon/Session/Adapter/Aerospike.php deleted file mode 100644 index 8b2561a58..000000000 --- a/Library/Phalcon/Session/Adapter/Aerospike.php +++ /dev/null @@ -1,256 +0,0 @@ - | - +------------------------------------------------------------------------+ -*/ - -namespace Phalcon\Session\Adapter; - -use Phalcon\Session\Adapter; -use Phalcon\Session\Exception; -use Phalcon\Session\AdapterInterface; -use Phalcon\Cache\Frontend\Data as FrontendData; -use Phalcon\Cache\Backend\Aerospike as AerospikeDb; - -/** - * Phalcon\Session\Adapter\Aerospike - * - * This adapter store sessions in Aerospike - * - * - * use Phalcon\Session\Adapter\Aerospike as AerospikeSession; - * - * $session = new AerospikeSession( - * [ - * 'hosts' => [ - * [ - * 'addr' => '127.0.0.1', - * 'port' => 3000, - * ], - * ], - * 'persistent' => true, - * 'namespace' => 'test', - * 'prefix' => 'session_', - * 'lifetime' => 8600, - * 'uniqueId' => '3Hf90KdjQ18', - * 'options' => [ - * \Aerospike::OPT_CONNECT_TIMEOUT => 1250, - * \Aerospike::OPT_WRITE_TIMEOUT => 1500, - * ], - * ] - * ); - * - * $session->start(); - * - * $session->set('var', 'some-value'); - * - * echo $session->get('var'); - * - */ -class Aerospike extends Adapter implements AdapterInterface -{ - /** - * The Aerospike DB - * - * @var AerospikeDb - */ - protected $db; - - /** - * Default Aerospike namespace - * - * @var string - */ - protected $namespace = 'test'; - - /** - * The Aerospike Set for store sessions - * - * @var string - */ - protected $set = 'session'; - - /** - * Key prefix - * - * @var string - */ - protected $prefix = ''; - - /** - * Session lifetime - * - * @var int - */ - protected $lifetime = 8600; - - /** - * Phalcon\Session\Adapter\Aerospike constructor - * - * @param array $options Constructor options - * - * @throws \Phalcon\Session\Exception - * @throws \Phalcon\Cache\Exception - */ - public function __construct(array $options) - { - if (!isset($options['hosts']) || !is_array($options['hosts'])) { - throw new Exception('No hosts given in options'); - } - - if (isset($options['namespace'])) { - $this->namespace = $options['namespace']; - - unset($options['namespace']); - } - - if (isset($options['prefix'])) { - $this->prefix = $options['prefix']; - } - - if (isset($options['set']) && !empty($options['set'])) { - $this->set = $options['set']; - - unset($options['set']); - } - - if (isset($options['lifetime'])) { - $this->lifetime = $options['lifetime']; - } - - $persistent = false; - if (isset($options['persistent'])) { - $persistent = (bool) $options['persistent']; - } - - $opts = []; - if (isset($options['options']) && is_array($options['options'])) { - $opts = $options['options']; - } - - $this->db = new AerospikeDb( - new FrontendData( - [ - 'lifetime' => $this->lifetime, - ] - ), - [ - 'hosts' => $options['hosts'], - 'namespace' => $this->namespace, - 'set' => $this->set, - 'prefix' => $this->prefix, - 'persistent' => $persistent, - 'options' => $opts, - ] - ); - - parent::__construct($options); - - session_set_save_handler( - [$this, 'open'], - [$this, 'close'], - [$this, 'read'], - [$this, 'write'], - [$this, 'destroy'], - [$this, 'gc'] - ); - } - - /** - * Gets the Aerospike instance. - * - * @return \Aerospike - */ - public function getDb() - { - return $this->db->getDb(); - } - - /** - * {@inheritdoc} - * - * @return bool - */ - public function open() - { - return true; - } - - /** - * {@inheritdoc} - * - * @return bool - */ - public function close() - { - return true; - } - - /** - * {@inheritdoc} - * - * @param string $sessionId Session variable name - * @return string - */ - public function read($sessionId) - { - return $this->db->get($sessionId, $this->lifetime); - } - - /** - * {@inheritdoc} - * - * @param string $sessionId Session variable name - * @param string $data Session data - */ - public function write($sessionId, $data) - { - return $this->db->save($sessionId, $data, $this->lifetime); - } - - /** - * {@inheritdoc} - * - * @param string $sessionId Session variable name [Optional] - * @return bool - */ - public function destroy($sessionId = null) - { - if (null === $sessionId) { - $sessionId = $this->getId(); - } - - if (!isset($_SESSION) || !is_array($_SESSION)) { - $_SESSION = []; - } - - foreach ($_SESSION as $id => $key) { - unset($_SESSION[$id]); - } - - return $this->db->delete($sessionId); - } - - /** - * {@inheritdoc} - * - * @return bool - */ - public function gc() - { - return true; - } -} diff --git a/Library/Phalcon/Session/Adapter/Database.php b/Library/Phalcon/Session/Adapter/Database.php deleted file mode 100644 index efe7b8d01..000000000 --- a/Library/Phalcon/Session/Adapter/Database.php +++ /dev/null @@ -1,245 +0,0 @@ - | - | Eduar Carvajal | - | Nikita Vershinin | - +------------------------------------------------------------------------+ -*/ - -namespace Phalcon\Session\Adapter; - -use Phalcon\Db; -use Phalcon\Session\Adapter; -use Phalcon\Session\AdapterInterface; -use Phalcon\Session\Exception; -use Phalcon\Db\AdapterInterface as DbAdapter; -use Phalcon\Db\Column; - -/** - * Phalcon\Session\Adapter\Database - * Database adapter for Phalcon\Session - */ -class Database extends Adapter implements AdapterInterface -{ - /** - * @var DbAdapter - */ - protected $connection; - - /** - * {@inheritdoc} - * - * @param array $options - * @throws Exception - */ - public function __construct($options = null) - { - if (!isset($options['db']) || !$options['db'] instanceof DbAdapter) { - throw new Exception( - 'Parameter "db" is required and it must be an instance of Phalcon\Db\AdapterInterface' - ); - } - - $this->connection = $options['db']; - unset($options['db']); - - if (!isset($options['table']) || empty($options['table']) || !is_string($options['table'])) { - throw new Exception( - "Parameter 'table' is required and it must be a non empty string" - ); - } - - $columns = ['session_id', 'data', 'created_at', 'modified_at']; - foreach ($columns as $column) { - $oColumn = "column_$column"; - if (!isset($options[$oColumn]) || !is_string($options[$oColumn]) || empty($options[$oColumn])) { - $options[$oColumn] = $column; - } - } - - parent::__construct($options); - - session_set_save_handler( - [$this, 'open'], - [$this, 'close'], - [$this, 'read'], - [$this, 'write'], - [$this, 'destroy'], - [$this, 'gc'] - ); - } - - /** - * {@inheritdoc} - * - * @return boolean - */ - public function open() - { - $this->_started = true; - return $this->isStarted(); - } - - /** - * {@inheritdoc} - * - * @return boolean - */ - public function close() - { - $this->_started = false; - - return $this->isStarted(); - } - - /** - * {@inheritdoc} - * - * @param string $sessionId - * @return string - */ - public function read($sessionId) - { - $maxLifetime = (int) ini_get('session.gc_maxlifetime'); - - if (!$this->isStarted()) { - return false; - } - - $options = $this->getOptions(); - $row = $this->connection->fetchOne( - sprintf( - 'SELECT %s FROM %s WHERE %s = ? AND COALESCE(%s, %s) + %d >= ?', - $this->connection->escapeIdentifier($options['column_data']), - $this->connection->escapeIdentifier($options['table']), - $this->connection->escapeIdentifier($options['column_session_id']), - $this->connection->escapeIdentifier($options['column_modified_at']), - $this->connection->escapeIdentifier($options['column_created_at']), - $maxLifetime - ), - Db::FETCH_NUM, - [$sessionId, time()], - [Column::BIND_PARAM_STR, Column::BIND_PARAM_INT] - ); - - if (empty($row)) { - return ''; - } - - return $row[0]; - } - - /** - * {@inheritdoc} - * - * @param string $sessionId - * @param string $data - * @return boolean - */ - public function write($sessionId, $data) - { - $options = $this->getOptions(); - $row = $this->connection->fetchOne( - sprintf( - 'SELECT COUNT(*) FROM %s WHERE %s = ?', - $this->connection->escapeIdentifier($options['table']), - $this->connection->escapeIdentifier($options['column_session_id']) - ), - Db::FETCH_NUM, - [$sessionId] - ); - - if ($row[0] > 0) { - return $this->connection->execute( - sprintf( - 'UPDATE %s SET %s = ?, %s = ? WHERE %s = ?', - $this->connection->escapeIdentifier($options['table']), - $this->connection->escapeIdentifier($options['column_data']), - $this->connection->escapeIdentifier($options['column_modified_at']), - $this->connection->escapeIdentifier($options['column_session_id']) - ), - [$data, time(), $sessionId] - ); - } - - if (!$this->isStarted()) { - return false; - } - - return $this->connection->execute( - sprintf( - 'INSERT INTO %s (%s, %s, %s, %s) VALUES (?, ?, ?, NULL)', - $this->connection->escapeIdentifier($options['table']), - $this->connection->escapeIdentifier($options['column_session_id']), - $this->connection->escapeIdentifier($options['column_data']), - $this->connection->escapeIdentifier($options['column_created_at']), - $this->connection->escapeIdentifier($options['column_modified_at']) - ), - [$sessionId, $data, time()] - ); - } - - /** - * {@inheritdoc} - * - * @return boolean - */ - public function destroy($session_id = null) - { - if (!$this->isStarted()) { - return true; - } - - if (is_null($session_id)) { - $session_id = $this->getId(); - } - - $this->_started = false; - $options = $this->getOptions(); - $result = $this->connection->execute( - sprintf( - 'DELETE FROM %s WHERE %s = ?', - $this->connection->escapeIdentifier($options['table']), - $this->connection->escapeIdentifier($options['column_session_id']) - ), - [$session_id] - ); - - return $result; - } - - /** - * {@inheritdoc} - * @param integer $maxlifetime - * - * @return boolean - */ - public function gc($maxlifetime) - { - $options = $this->getOptions(); - - return $this->connection->execute( - sprintf( - 'DELETE FROM %s WHERE COALESCE(%s, %s) + %d < ?', - $this->connection->escapeIdentifier($options['table']), - $this->connection->escapeIdentifier($options['column_modified_at']), - $this->connection->escapeIdentifier($options['column_created_at']), - $maxlifetime - ), - [time()] - ); - } -} diff --git a/Library/Phalcon/Session/Adapter/HandlerSocket.php b/Library/Phalcon/Session/Adapter/HandlerSocket.php deleted file mode 100644 index 769117629..000000000 --- a/Library/Phalcon/Session/Adapter/HandlerSocket.php +++ /dev/null @@ -1,335 +0,0 @@ - (string) cookie_path : - * the path for which the cookie is valid. - * =====> (string) cookie_domain : - * the domain for which the cookie is valid. - * =====> (int) lifetime : - * session lifetime in seconds - * =====> (array) server : - * an array of mysql handlersocket server : - * 'host' => (string) : the name of the mysql handlersocket server - * 'port' => (int) : the port of the mysql handlersocket server - * 'dbname' => (string) : the database name of the mysql handlersocket server - * 'dbtable' => (string) : the table name of the mysql handlersocket server - */ - protected $options = [ - 'cookie_path' => '/', - 'cookie_domain' => '', - 'lifetime' => 3600, - 'server' => [ - 'host' => self::DEFAULT_HOST, - 'port' => self::DEFAULT_PORT, - 'dbname' => self::DEFAULT_DBNAME, - 'dbtable' => self::DEFAULT_DBTABLE, - ], - ]; - - /** - * HandlerSocket object - * - * @var \HandlerSocket - */ - protected $hs; - - /** - * HandlerSocket index number - * - * @var integer - */ - protected $hsIndex = 1; - - /** - * Stores session data results - * - * @var array - */ - protected $fields = []; - - /** - * Class constructor. - * - * @param array $options associative array of options - * @throws \Phalcon\Session\Exception - */ - public function __construct($options = []) - { - // initialize the handlersocket database - if (empty($options)) { - $this->init($this->options); - } else { - $this->init($options); - } - - //set object as the save handler - session_set_save_handler( - [$this, 'open'], - [$this, 'close'], - [$this, 'read'], - [$this, 'write'], - [$this, 'destroy'], - [$this, 'gc'] - ); - } - - /** - * Destructor - * - * @return void - */ - public function __destruct() - { - session_write_close(); - } - - /** - * {@inheritdoc} - * - * @param array $options associative array of options - * @return void - */ - public function start($options = []) - { - $object = new self($options); - - //start it up - session_start(); - } - - /** - *{@inheritdoc} - * - * @param string $save_path - * @param string $name - * @return boolean - */ - public function open($save_path, $name) - { - return true; - } - - /** - * {@inheritdoc} - * - * @return boolean - */ - public function close() - { - return true; - } - - /** - * {@inheritdoc} - * - * @param string $id - * @return string - */ - public function read($id) - { - $retval = $this->hs->executeSingle( - $this->hsIndex, - '=', - [ - $id, - ], - 1, - 0 - ); - - if (!isset($retval[0], $retval[0][2])) { - return ''; - } - - $this->fields['id'] = $retval[0][0]; - $this->fields['modified'] = $retval[0][1]; - $this->fields['data'] = ''; - - return $retval[0][2]; - } - - /** - * {@inheritdoc} - * - * @param string $id - * @param string $data - * @return boolean - */ - public function write($id, $data) - { - if (isset($this->fields['id']) && $this->fields['id'] != $id) { - $this->fields = []; - } - - if (empty($this->fields)) { - $this->hs->executeInsert( - $this->hsIndex, - [ - $id, - date('Y-m-d H:i:s'), - $data, - ] - ); - } else { - $this->hs->executeUpdate( - $this->hsIndex, - '=', - [$id], - [ - $id, - date('Y-m-d H:i:s'), - $data, - ], - 1, - 0 - ); - } - - return true; - } - - /** - * {@inheritdoc} - * - * @param string $id - * @return boolean - */ - public function destroy($id) - { - $this->hs->executeDelete( - $this->hsIndex, - '=', - [$id], - 1, - 0 - ); - - return true; - } - - /** - * {@inheritdoc} - * - * @param integer $maxlifetime - * @return boolean - */ - public function gc($maxlifetime) - { - $time = date( - 'Y-m-d H:i:s', - strtotime("- $maxlifetime seconds") - ); - - $index = $this->hsIndex + 1; - - $this->hs->openIndex( - $index, - $this->options['server']['dbname'], - $this->options['server']['dbtable'], - self::DB_GC_INDEX, - '' - ); - - $this->hs->executeDelete( - $index, - '<', - [$time], - 1000, - 0 - ); - - return true; - } - - /** - * Initialize HandlerSocket. - * - * @param array $options associative array of options - * @throws \Phalcon\Session\Exception - */ - protected function init($options) - { - if (empty($options['server'])) { - $options['server'] = []; - } - - if (empty($options['server']['host'])) { - $options['server']['host'] = self::DEFAULT_HOST; - } - - if (empty($options['server']['port'])) { - $options['server']['port'] = self::DEFAULT_PORT; - } - - if (empty($options['server']['dbname'])) { - $options['server']['dbname'] = self::DEFAULT_DBNAME; - } - - if (empty($options['server']['dbtable'])) { - $options['server']['dbtable'] = self::DEFAULT_DBTABLE; - } - - //update options - $this->options = $options; - - if (!extension_loaded('handlersocket')) { - throw new Exception( - 'The handlersocket extension must be loaded for using session!' - ); - } - - // load handlersocket server - $this->hs = new \HandlerSocket( - $options['server']['host'], - $options['server']['port'] - ); - - // open handlersocket index - $result = $this->hs->openIndex( - $this->hsIndex, - $options['server']['dbname'], - $options['server']['dbtable'], - \HandlerSocket::PRIMARY, - self::DB_FIELDS - ); - - if (!$result) { - throw new Exception( - 'The HandlerSocket database specified in the options does not exist.' - ); - } - } -} diff --git a/Library/Phalcon/Session/Adapter/Mongo.php b/Library/Phalcon/Session/Adapter/Mongo.php deleted file mode 100644 index 5e3824019..000000000 --- a/Library/Phalcon/Session/Adapter/Mongo.php +++ /dev/null @@ -1,187 +0,0 @@ - | - | Eduar Carvajal | - +------------------------------------------------------------------------+ -*/ - -namespace Phalcon\Session\Adapter; - -use Phalcon\Session\Adapter; -use Phalcon\Session\AdapterInterface; -use Phalcon\Session\Exception; - -/** - * Phalcon\Session\Adapter\Mongo - * Mongo adapter for Phalcon\Session - */ -class Mongo extends Adapter implements AdapterInterface -{ - /** - * Current session data - * - * @var string - */ - protected $data; - - /** - * Class constructor. - * - * @param array $options - * @throws Exception - */ - public function __construct($options = null) - { - if (!isset($options['collection'])) { - throw new Exception("The parameter 'collection' is required"); - } - - session_set_save_handler( - [$this, 'open'], - [$this, 'close'], - [$this, 'read'], - [$this, 'write'], - [$this, 'destroy'], - [$this, 'gc'] - ); - - parent::__construct($options); - } - - /** - * {@inheritdoc} - * - * @return boolean - */ - public function open() - { - return true; - } - - /** - * {@inheritdoc} - */ - public function close() - { - return true; - } - - /** - * {@inheritdoc} - * - * @param string $sessionId - * @return string - */ - public function read($sessionId) - { - $sessionData = $this->getCollection()->findOne( - [ - '_id' => $sessionId, - ] - ); - - if (!isset($sessionData['data'])) { - return ''; - } - - $this->data = $sessionData['data']; - - return $sessionData['data']; - } - - /** - * {@inheritdoc} - * - * @param string $sessionId - * @param string $sessionData - * @return bool - */ - public function write($sessionId, $sessionData) - { - if ($this->data === $sessionData) { - return true; - } - - $sessionData = [ - '_id' => $sessionId, - 'modified' => new \MongoDate(), - 'data' => $sessionData, - ]; - - $this->getCollection()->save($sessionData); - - return true; - } - - /** - * {@inheritdoc} - */ - public function destroy($sessionId = null) - { - if (is_null($sessionId)) { - $sessionId =$this->getId(); - } - - $this->data = null; - - $remove = $this->getCollection()->remove( - [ - '_id' => $sessionId, - ] - ); - - return (bool) $remove['ok']; - } - - /** - * {@inheritdoc} - * @param string $maxLifetime - */ - public function gc($maxLifetime) - { - $minAge = new \DateTime(); - - $minAge->sub( - new \DateInterval( - 'PT' . $maxLifetime . 'S' - ) - ); - - $minAgeMongo = new \MongoDate( - $minAge->getTimestamp() - ); - - $query = [ - 'modified' => [ - '$lte' => $minAgeMongo, - ], - ]; - - $remove = $this->getCollection()->remove($query); - - return (bool) $remove['ok']; - } - - /** - * @return \MongoCollection - */ - protected function getCollection() - { - $options = $this->getOptions(); - - return $options['collection']; - } -} diff --git a/Library/Phalcon/Session/Adapter/README.md b/Library/Phalcon/Session/Adapter/README.md deleted file mode 100644 index cac887b59..000000000 --- a/Library/Phalcon/Session/Adapter/README.md +++ /dev/null @@ -1,199 +0,0 @@ -# Phalcon\Session\Adapter - -Usage examples of the adapters available here: - -## Aerospike - -This adapter uses an Aerospike Database to store session data. - -To use this adapter on your machine, you need at least: - -- [Aerospike Server][1] >= 3.5.3 -- [Aerospike PHP Extension][2] - -Usage: - -```php -use Phalcon\Session\Adapter\Aerospike as SessionHandler; - -$di->set( - 'session', - function () { - $session = new SessionHandler( - [ - 'hosts' => [ - [ - 'addr' => '127.0.0.1', - 'port' => 3000, - ] - ], - 'persistent' => true, - 'namespace' => 'test', - 'prefix' => 'session_', - 'lifetime' => 8600, - 'uniqueId' => '3Hf90KdjQ18', - 'options' => [ - \Aerospike::OPT_CONNECT_TIMEOUT => 1250, - \Aerospike::OPT_WRITE_TIMEOUT => 1500, - ], - ] - ); - - $session->start(); - - return $session; - } -); -``` - - -## Database - -This adapter uses a database backend to store session data: - -```php -use Phalcon\Db\Adapter\Pdo\Mysql; -use Phalcon\Session\Adapter\Database; - -$di->set( - 'session', - function () { - // Create a connection - $connection = new Mysql( - [ - 'host' => 'localhost', - 'username' => 'root', - 'password' => 'secret', - 'dbname' => 'test', - ] - ); - - $session = new Database( - [ - 'db' => $connection, - 'table' => 'session_data', - ] - ); - - $session->start(); - - return $session; - } -); - -``` - -This adapter uses the following table to store the data: - -```sql - CREATE TABLE `session_data` ( - `session_id` VARCHAR(35) NOT NULL, - `data` text NOT NULL, - `created_at` INT unsigned NOT NULL, - `modified_at` INT unsigned DEFAULT NULL, - PRIMARY KEY (`session_id`) -); -``` - -## Mongo - -This adapter uses a Mongo database backend to store session data: - -```php -use Phalcon\Session\Adapter\Mongo as MongoSession; - -$di->set( - 'session', - function () { - // Create a connection to mongo - $mongo = new \Mongo(); - - // Passing a collection to the adapter - $session = new MongoSession( - [ - 'collection' => $mongo->test->session_data, - ] - ); - - $session->start(); - - return $session; - } -); -``` - -## Redis - -This adapter uses a [Redis][2] backend to store session data. -You would need a [phpredis][4] extension installed to use it: - -```php -use Phalcon\Session\Adapter\Redis; - -$di->set( - 'session', - function () { - $session = new Redis( - [ - 'path' => 'tcp://127.0.0.1:6379?weight=1', - ] - ); - - $session->start(); - - return $session; - } -); - -``` - -## HandlerSocket - -This adapter uses the MySQL's plugin HandlerSocket. HandlerSocket is a NoSQL plugin for MySQL. It works as a daemon inside the -mysqld process, accept tcp connections, and execute requests from clients. HandlerSocket does not support SQL queries. -Instead, it supports simple CRUD operations on tables. - -```sql -CREATE TABLE `php_session` ( - `id` VARCHAR(32) NOT NULL DEFAULT '', - `modified` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', - `data` TEXT, - PRIMARY KEY (`id`), - KEY `modified` (`modified`) -) ENGINE=InnoDB DEFAULT CHARACTER SET utf8; -``` - -```php -use Phalcon\Session\Adapter\HandlerSocket; - -$di->set( - 'session', - function () { - $session = new HandlerSocket( - [ - 'cookie_path' => '/', - 'cookie_domain' => '', - 'lifetime' => 3600, - 'server' => [ - 'host' => 'localhost', - 'port' => 9999, - 'dbname' => 'session', - 'dbtable' => 'php_session', - ], - ] - ); - - $session->start(); - - return $session; - } -); -``` - -The extension [`handlersocket`][5] is required to use this adapter. - -[1]: http://www.aerospike.com/ -[2]: http://www.aerospike.com/docs/client/php/install/ -[3]: http://redis.io -[4]: https://github.com/nicolasff/phpredis -[5]: https://github.com/kjdev/php-ext-handlersocketi diff --git a/tests/aerospike/Session/Adapter/AerospikeTest.php b/tests/aerospike/Session/Adapter/AerospikeTest.php deleted file mode 100644 index bd9f8e898..000000000 --- a/tests/aerospike/Session/Adapter/AerospikeTest.php +++ /dev/null @@ -1,186 +0,0 @@ - - * @package Phalcon\Test\Session\Adapter - * @group aerospike - * - * The contents of this file are subject to the New BSD License that is - * bundled with this package in the file docs/LICENSE.txt - * - * If you did not receive a copy of the license and are unable to obtain it - * through the world-wide-web, please send an email to license@phalconphp.com - * so that we can send you a copy immediately. - */ -class AerospikeTest extends Test -{ - /** - * UnitTester Object - * @var UnitTester - */ - protected $tester; - - protected $ns = 'test'; - protected $set = 'session'; - protected $keys = []; - - /** - * executed before each test - */ - protected function _before() - { - if (!extension_loaded('aerospike')) { - $this->markTestSkipped('The Aerospike module is not available.'); - } - - $this->getModule('Aerospike')->_reconfigure( - [ - 'set' => $this->set, - 'addr' => env('TEST_AS_HOST', '127.0.0.1'), - 'port' => (int) env('TEST_AS_PORT', 3000), - ] - ); - } - - /** - * executed after each test - */ - protected function _after() - { - if (extension_loaded('aerospike')) { - $this->cleanup(); - } - } - - public function testShouldWriteSession() - { - $sessionId = 'abcdef123458'; - - $session = new SessionHandler( - $this->getConfig() - ); - - $data = [ - 321 => microtime(true), - 'def' => '678', - 'xyz' => 'zyx', - ]; - - $this->assertTrue( - $session->write($sessionId, $data) - ); - - $this->tester->seeInAerospike($sessionId, $data); - } - - public function testShouldReadSession() - { - $sessionId = 'some_session_key'; - - $session = new SessionHandler( - $this->getConfig() - ); - - $data = [ - 321 => microtime(true), - 'def' => '678', - 'xyz' => 'zyx' - ]; - - $this->tester->haveInAerospike($sessionId, $data); - - $this->keys[] = $sessionId; - - $this->assertEquals( - $data, - $session->read($sessionId) - ); - } - - public function testShouldDestroySession() - { - $sessionId = 'abcdef123457'; - - $session = new SessionHandler( - $this->getConfig() - ); - - $data = [ - 'abc' => 345, - 'def' => ['foo' => 'bar'], - 'zyx' => 'xyz', - ]; - - $this->tester->haveInAerospike($sessionId, $data); - - $session->destroy($sessionId); - - $this->tester->dontSeeInAerospike($sessionId); - } - - private function cleanup() - { - $aerospike = new Aerospike( - [ - 'hosts' => [ - [ - 'addr' => env('TEST_AS_HOST', '127.0.0.1'), - 'port' => (int) env('TEST_AS_PORT', 3000), - ], - ], - ], - false - ); - - foreach ($this->keys as $i => $key) { - $aerospike->remove( - $this->buildKey($aerospike, $key) - ); - - unset($this->keys[$i]); - } - } - - private function buildKey(Aerospike $aerospike, $key) - { - return $aerospike->initKey( - $this->ns, - $this->set, - $key - ); - } - - private function getConfig() - { - return [ - 'hosts' => [ - [ - 'addr' => env('TEST_AS_HOST', '127.0.0.1'), - 'port' => (int) env('TEST_AS_PORT', 3000), - ], - ], - 'persistent' => false, - 'namespace' => $this->ns, - 'set' => $this->set, - 'prefix' => '', - 'lifetime' => 10, - 'uniqueId' => 'some-unique-id', - 'options' => [ - \Aerospike::OPT_CONNECT_TIMEOUT => 1250, - \Aerospike::OPT_WRITE_TIMEOUT => 1500, - ], - ]; - } -} diff --git a/tests/unit/Session/Adapter/DatabaseTest.php b/tests/unit/Session/Adapter/DatabaseTest.php deleted file mode 100644 index 6a243d8c6..000000000 --- a/tests/unit/Session/Adapter/DatabaseTest.php +++ /dev/null @@ -1,219 +0,0 @@ - - * @package Phalcon\Test\Session\Adapter - * @group Db - * - * The contents of this file are subject to the New BSD License that is - * bundled with this package in the file LICENSE.txt - * - * If you did not receive a copy of the license and are unable to obtain it - * through the world-wide-web, please send an email to license@phalconphp.com - * so that we can send you a copy immediately. - */ -class DatabaseTest extends UnitTest -{ - use DatabaseTrait; - - /** - * @var DbAdapter - */ - protected $connection; - - /** - * @var SessionAdapter - */ - protected $session; - - /** - * executed before each test - */ - protected function _before() - { - $this->connection = new Mysql( - [ - 'host' => env('TEST_DB_HOST', '127.0.0.1'), - 'username' => env('TEST_DB_USER', 'incubator'), - 'password' => env('TEST_DB_PASSWD', 'secret'), - 'dbname' => env('TEST_DB_NAME', 'incubator'), - 'charset' => env('TEST_DB_CHARSET', 'utf8'), - 'port' => env('TEST_DB_PORT', 3306), - ] - ); - - $this->session = new Database( - [ - 'db' => $this->connection, - 'table' => 'sessions', - 'lifetime' => 3600, - ] - ); - } - - /** - * Tests Database::write - * - * @test - * @author Sergii Svyrydenko - * @since 2017-07-24 - */ - public function shouldWorkSessionAdapter() - { - $this->session->start(); - - $sessionID = $this->session->getId(); - - $this->session->set('customer_id', 'somekey'); - - $this->specify( - "Method set() hasn't worked", - function ($data, $expected) { - expect($data)->equals($expected); - }, - [ - 'examples' => [ - [ - $this->session->get('customer_id'), - 'somekey', - ], - ] - ] - ); - - session_start(); - - $this->session->write( - $sessionID, - session_encode() - ); - - $this->tester->seeInDatabase( - ModelSession::$table, - [ - 'session_id' => $sessionID, - ] - ); - - $this->tester->seeInDatabase( - ModelSession::$table, - [ - 'data' => 'customer_id|s:7:"somekey";', - ] - ); - - $this->session->remove('customer_id'); - - $sessionData = $this->session->read($sessionID); - - session_decode($sessionData); - - $this->specify( - "Method read() hasn't worked", - function ($data, $expected) { - expect($data)->equals($expected); - }, - [ - 'examples' => [ - [ - $this->session->get('customer_id'), - 'somekey', - ], - ] - ] - ); - - $this->session->set('customer_id', 'somekey'); - $this->session->set('customer_id2', 'somekey2'); - - $this->session->write( - $sessionID, - session_encode() - ); - - $this->tester->seeInDatabase( - ModelSession::$table, - [ - 'session_id' => $sessionID, - ] - ); - - $this->tester->seeInDatabase( - ModelSession::$table, - [ - 'data' => 'customer_id|s:7:"somekey";customer_id2|s:8:"somekey2";', - ] - ); - - $this->session->remove('customer_id'); - $this->session->remove('customer_id2'); - - $sessionData = $this->session->read($sessionID); - - session_start(); - - session_decode($sessionData); - - $session = $this->session; - $this->specify( - "Method read() hasn't worked", - function ($data, $expected) use ($session) { - expect($data)->equals($expected); - }, - [ - 'examples' => [ - [ - $this->session->get('customer_id'), - 'somekey', - ], - ], - ] - ); - - $this->specify( - "Method update() hasn't worked", - function ($data, $expected) { - expect($data)->equals($expected); - }, - [ - 'examples' => [ - [ - $this->session->get('customer_id'), - 'somekey', - ], - [ - $this->session->get('customer_id2'), - 'somekey2', - ], - ], - ] - ); - - $this->connection->execute( - $this->getWrittenSessionData($sessionID) - ); - - $this->tester->dontSeeInDatabase( - ModelSession::$table, - [ - 'session_id' => $sessionID, - ] - ); - } -} From 1fc2e44a0cb2534453169967bb8c10537a199608 Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Thu, 18 Jun 2020 22:41:30 +0100 Subject: [PATCH 2/2] #948 - Add phalcon/incubator-session package --- composer.json | 7 +- composer.lock | 451 +++++++++++++++++++++++++++++++++++++++++--------- 2 files changed, 376 insertions(+), 82 deletions(-) diff --git a/composer.json b/composer.json index 03a12a9b4..90a1dcfd1 100644 --- a/composer.json +++ b/composer.json @@ -32,7 +32,8 @@ "require": { "php": ">=7.2", "ext-phalcon": "^4.0", - "phalcon/incubator-acl": "^1.0.0-alpha.1" + "phalcon/incubator-acl": "^1.0.0-alpha.1", + "phalcon/incubator-session": "^1.0.0" }, "require-dev": { "phpdocumentor/reflection-docblock": "2.0.4", @@ -46,12 +47,10 @@ "vlucas/phpdotenv": "^2.4", "phalcon/dd": "^1.1", "doctrine/instantiator": "1.0.5", - "phalcon/ide-stubs": "4.x-dev" + "phalcon/ide-stubs": "^4.0" }, "suggest": { - "ext-aerospike": "*", "phalcon/ide-stubs": "Phalcon IDE Stubs", - "sergeyklay/aerospike-php-stubs": "The most complete Aerospike PHP stubs which allows autocomplete in modern IDEs", "duncan3dc/fork-helper": "To use extended class to access the beanstalk queue service", "swiftmailer/swiftmailer": "~5.2", "twig/twig": "~1.35|~2.0" diff --git a/composer.lock b/composer.lock index b45f31723..919857021 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "b6f69e31917ad3420c1f304cf35f1bf9", + "content-hash": "b81e634d1d0b4959b916c84339ac460b", "packages": [ { "name": "phalcon/incubator-acl", @@ -63,6 +63,64 @@ "phalcon" ], "time": "2020-04-13T22:00:37+00:00" + }, + { + "name": "phalcon/incubator-session", + "version": "v1.0.0", + "source": { + "type": "git", + "url": "https://github.com/phalcon/incubator-session.git", + "reference": "68e6543c91789b5f79ca7e2c1f8c9ae4689bef14" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phalcon/incubator-session/zipball/68e6543c91789b5f79ca7e2c1f8c9ae4689bef14", + "reference": "68e6543c91789b5f79ca7e2c1f8c9ae4689bef14", + "shasum": "" + }, + "require": { + "ext-phalcon": "^4.0", + "php": ">=7.2" + }, + "require-dev": { + "codeception/codeception": "^4.1", + "codeception/module-asserts": "^1.0.0", + "mongodb/mongodb": "^1.6", + "phalcon/ide-stubs": "^4.0", + "phpstan/phpstan": "^0.12.18", + "squizlabs/php_codesniffer": "^3.5", + "vimeo/psalm": "^3.6" + }, + "type": "library", + "autoload": { + "psr-4": { + "Phalcon\\Incubator\\Session\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Phalcon Team", + "email": "team@phalcon.io", + "homepage": "https://phalcon.io/en/team" + }, + { + "name": "Contributors", + "homepage": "https://github.com/phalcon/incubator-session/graphs/contributors" + } + ], + "description": "Phalcon Incubator Sessions Adapters", + "homepage": "https://phalcon.io", + "keywords": [ + "framework", + "incubator", + "phalcon", + "session" + ], + "time": "2020-06-18T15:04:50+00:00" } ], "packages-dev": [ @@ -573,23 +631,24 @@ }, { "name": "guzzlehttp/guzzle", - "version": "6.5.2", + "version": "6.5.5", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "43ece0e75098b7ecd8d13918293029e555a50f82" + "reference": "9d4290de1cfd701f38099ef7e183b64b4b7b0c5e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/43ece0e75098b7ecd8d13918293029e555a50f82", - "reference": "43ece0e75098b7ecd8d13918293029e555a50f82", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/9d4290de1cfd701f38099ef7e183b64b4b7b0c5e", + "reference": "9d4290de1cfd701f38099ef7e183b64b4b7b0c5e", "shasum": "" }, "require": { "ext-json": "*", "guzzlehttp/promises": "^1.0", "guzzlehttp/psr7": "^1.6.1", - "php": ">=5.5" + "php": ">=5.5", + "symfony/polyfill-intl-idn": "^1.17.0" }, "require-dev": { "ext-curl": "*", @@ -597,7 +656,6 @@ "psr/log": "^1.1" }, "suggest": { - "ext-intl": "Required for Internationalized Domain Name (IDN) support", "psr/log": "Required for using the Log middleware" }, "type": "library", @@ -636,7 +694,7 @@ "rest", "web service" ], - "time": "2019-12-23T11:57:10+00:00" + "time": "2020-06-16T21:01:06+00:00" }, { "name": "guzzlehttp/promises", @@ -969,6 +1027,58 @@ ], "time": "2019-07-26T05:29:31+00:00" }, + { + "name": "phalcon/ide-stubs", + "version": "v4.0.6", + "source": { + "type": "git", + "url": "https://github.com/phalcon/ide-stubs.git", + "reference": "d2adae3fba488ccba913a3f7fc310f23aa6de4a3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phalcon/ide-stubs/zipball/d2adae3fba488ccba913a3f7fc310f23aa6de4a3", + "reference": "d2adae3fba488ccba913a3f7fc310f23aa6de4a3", + "shasum": "" + }, + "require": { + "php": ">=7.2.0" + }, + "require-dev": { + "squizlabs/php_codesniffer": "3.*", + "vimeo/psalm": "^3.4" + }, + "type": "library", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Phalcon Team", + "email": "team@phalcon.io", + "homepage": "https://phalcon.io/en-us/team" + }, + { + "name": "Contributors", + "homepage": "https://github.com/phalcon/ide-stubs/graphs/contributors" + } + ], + "description": "The most complete Phalcon Framework IDE stubs library which enables autocompletion in modern IDEs.", + "homepage": "https://phalcon.io", + "keywords": [ + "Devtools", + "Eclipse", + "autocomplete", + "ide", + "netbeans", + "phalcon", + "phpstorm", + "stub", + "stubs" + ], + "time": "2020-05-18T20:16:38+00:00" + }, { "name": "phpdocumentor/reflection-docblock", "version": "2.0.4", @@ -2049,20 +2159,20 @@ }, { "name": "symfony/browser-kit", - "version": "v4.4.7", + "version": "v4.4.10", "source": { "type": "git", "url": "https://github.com/symfony/browser-kit.git", - "reference": "e4b0dc1b100bf75b5717c5b451397f230a618a42" + "reference": "f53310646af9901292488b2ff36e26ea10f545f5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/browser-kit/zipball/e4b0dc1b100bf75b5717c5b451397f230a618a42", - "reference": "e4b0dc1b100bf75b5717c5b451397f230a618a42", + "url": "https://api.github.com/repos/symfony/browser-kit/zipball/f53310646af9901292488b2ff36e26ea10f545f5", + "reference": "f53310646af9901292488b2ff36e26ea10f545f5", "shasum": "" }, "require": { - "php": "^7.1.3", + "php": ">=7.1.3", "symfony/dom-crawler": "^3.4|^4.0|^5.0" }, "require-dev": { @@ -2104,26 +2214,27 @@ ], "description": "Symfony BrowserKit Component", "homepage": "https://symfony.com", - "time": "2020-03-28T10:15:50+00:00" + "time": "2020-05-22T17:28:00+00:00" }, { "name": "symfony/console", - "version": "v4.4.7", + "version": "v4.4.10", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "10bb3ee3c97308869d53b3e3d03f6ac23ff985f7" + "reference": "326b064d804043005526f5a0494cfb49edb59bb0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/10bb3ee3c97308869d53b3e3d03f6ac23ff985f7", - "reference": "10bb3ee3c97308869d53b3e3d03f6ac23ff985f7", + "url": "https://api.github.com/repos/symfony/console/zipball/326b064d804043005526f5a0494cfb49edb59bb0", + "reference": "326b064d804043005526f5a0494cfb49edb59bb0", "shasum": "" }, "require": { - "php": "^7.1.3", + "php": ">=7.1.3", "symfony/polyfill-mbstring": "~1.0", "symfony/polyfill-php73": "^1.8", + "symfony/polyfill-php80": "^1.15", "symfony/service-contracts": "^1.1|^2" }, "conflict": { @@ -2180,11 +2291,11 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2020-03-30T11:41:10+00:00" + "time": "2020-05-30T20:06:45+00:00" }, { "name": "symfony/css-selector", - "version": "v4.4.7", + "version": "v4.4.10", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", @@ -2237,20 +2348,20 @@ }, { "name": "symfony/dom-crawler", - "version": "v4.4.7", + "version": "v4.4.10", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", - "reference": "4d0fb3374324071ecdd94898367a3fa4b5563162" + "reference": "c18354d5a0bb84c945f6257c51b971d52f10c614" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/4d0fb3374324071ecdd94898367a3fa4b5563162", - "reference": "4d0fb3374324071ecdd94898367a3fa4b5563162", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/c18354d5a0bb84c945f6257c51b971d52f10c614", + "reference": "c18354d5a0bb84c945f6257c51b971d52f10c614", "shasum": "" }, "require": { - "php": "^7.1.3", + "php": ">=7.1.3", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-mbstring": "~1.0" }, @@ -2294,24 +2405,24 @@ ], "description": "Symfony DomCrawler Component", "homepage": "https://symfony.com", - "time": "2020-03-29T19:12:22+00:00" + "time": "2020-05-23T00:03:06+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v4.4.7", + "version": "v4.4.10", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "abc8e3618bfdb55e44c8c6a00abd333f831bbfed" + "reference": "a5370aaa7807c7a439b21386661ffccf3dff2866" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/abc8e3618bfdb55e44c8c6a00abd333f831bbfed", - "reference": "abc8e3618bfdb55e44c8c6a00abd333f831bbfed", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/a5370aaa7807c7a439b21386661ffccf3dff2866", + "reference": "a5370aaa7807c7a439b21386661ffccf3dff2866", "shasum": "" }, "require": { - "php": "^7.1.3", + "php": ">=7.1.3", "symfony/event-dispatcher-contracts": "^1.1" }, "conflict": { @@ -2364,7 +2475,7 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2020-03-27T16:54:36+00:00" + "time": "2020-05-20T08:37:50+00:00" }, { "name": "symfony/event-dispatcher-contracts", @@ -2426,7 +2537,7 @@ }, { "name": "symfony/finder", - "version": "v4.4.7", + "version": "v4.4.10", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", @@ -2475,16 +2586,16 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.15.0", + "version": "v1.17.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "4719fa9c18b0464d399f1a63bf624b42b6fa8d14" + "reference": "e94c8b1bbe2bc77507a1056cdb06451c75b427f9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/4719fa9c18b0464d399f1a63bf624b42b6fa8d14", - "reference": "4719fa9c18b0464d399f1a63bf624b42b6fa8d14", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e94c8b1bbe2bc77507a1056cdb06451c75b427f9", + "reference": "e94c8b1bbe2bc77507a1056cdb06451c75b427f9", "shasum": "" }, "require": { @@ -2496,7 +2607,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.15-dev" + "dev-master": "1.17-dev" } }, "autoload": { @@ -2529,20 +2640,82 @@ "polyfill", "portable" ], - "time": "2020-02-27T09:26:54+00:00" + "time": "2020-05-12T16:14:59+00:00" + }, + { + "name": "symfony/polyfill-intl-idn", + "version": "v1.17.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-idn.git", + "reference": "3bff59ea7047e925be6b7f2059d60af31bb46d6a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/3bff59ea7047e925be6b7f2059d60af31bb46d6a", + "reference": "3bff59ea7047e925be6b7f2059d60af31bb46d6a", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "symfony/polyfill-mbstring": "^1.3", + "symfony/polyfill-php72": "^1.10" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.17-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Intl\\Idn\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Laurent Bassin", + "email": "laurent@bassin.info" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "idn", + "intl", + "polyfill", + "portable", + "shim" + ], + "time": "2020-05-12T16:47:27+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.15.0", + "version": "v1.17.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "81ffd3a9c6d707be22e3012b827de1c9775fc5ac" + "reference": "fa79b11539418b02fc5e1897267673ba2c19419c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/81ffd3a9c6d707be22e3012b827de1c9775fc5ac", - "reference": "81ffd3a9c6d707be22e3012b827de1c9775fc5ac", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/fa79b11539418b02fc5e1897267673ba2c19419c", + "reference": "fa79b11539418b02fc5e1897267673ba2c19419c", "shasum": "" }, "require": { @@ -2554,7 +2727,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.15-dev" + "dev-master": "1.17-dev" } }, "autoload": { @@ -2588,20 +2761,75 @@ "portable", "shim" ], - "time": "2020-03-09T19:04:49+00:00" + "time": "2020-05-12T16:47:27+00:00" + }, + { + "name": "symfony/polyfill-php72", + "version": "v1.17.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php72.git", + "reference": "f048e612a3905f34931127360bdd2def19a5e582" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/f048e612a3905f34931127360bdd2def19a5e582", + "reference": "f048e612a3905f34931127360bdd2def19a5e582", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.17-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php72\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "time": "2020-05-12T16:47:27+00:00" }, { "name": "symfony/polyfill-php73", - "version": "v1.15.0", + "version": "v1.17.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "0f27e9f464ea3da33cbe7ca3bdf4eb66def9d0f7" + "reference": "a760d8964ff79ab9bf057613a5808284ec852ccc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/0f27e9f464ea3da33cbe7ca3bdf4eb66def9d0f7", - "reference": "0f27e9f464ea3da33cbe7ca3bdf4eb66def9d0f7", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/a760d8964ff79ab9bf057613a5808284ec852ccc", + "reference": "a760d8964ff79ab9bf057613a5808284ec852ccc", "shasum": "" }, "require": { @@ -2610,7 +2838,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.15-dev" + "dev-master": "1.17-dev" } }, "autoload": { @@ -2646,20 +2874,82 @@ "portable", "shim" ], - "time": "2020-02-27T09:26:54+00:00" + "time": "2020-05-12T16:47:27+00:00" + }, + { + "name": "symfony/polyfill-php80", + "version": "v1.17.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "5e30b2799bc1ad68f7feb62b60a73743589438dd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/5e30b2799bc1ad68f7feb62b60a73743589438dd", + "reference": "5e30b2799bc1ad68f7feb62b60a73743589438dd", + "shasum": "" + }, + "require": { + "php": ">=7.0.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.17-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "time": "2020-05-12T16:47:27+00:00" }, { "name": "symfony/process", - "version": "v4.4.7", + "version": "v4.4.10", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "3e40e87a20eaf83a1db825e1fa5097ae89042db3" + "reference": "c714958428a85c86ab97e3a0c96db4c4f381b7f5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/3e40e87a20eaf83a1db825e1fa5097ae89042db3", - "reference": "3e40e87a20eaf83a1db825e1fa5097ae89042db3", + "url": "https://api.github.com/repos/symfony/process/zipball/c714958428a85c86ab97e3a0c96db4c4f381b7f5", + "reference": "c714958428a85c86ab97e3a0c96db4c4f381b7f5", "shasum": "" }, "require": { @@ -2695,24 +2985,24 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2020-03-27T16:54:36+00:00" + "time": "2020-05-30T20:06:45+00:00" }, { "name": "symfony/service-contracts", - "version": "v2.0.1", + "version": "v2.1.2", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "144c5e51266b281231e947b51223ba14acf1a749" + "reference": "66a8f0957a3ca54e4f724e49028ab19d75a8918b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/144c5e51266b281231e947b51223ba14acf1a749", - "reference": "144c5e51266b281231e947b51223ba14acf1a749", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/66a8f0957a3ca54e4f724e49028ab19d75a8918b", + "reference": "66a8f0957a3ca54e4f724e49028ab19d75a8918b", "shasum": "" }, "require": { - "php": "^7.2.5", + "php": ">=7.2.5", "psr/container": "^1.0" }, "suggest": { @@ -2721,7 +3011,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-master": "2.1-dev" } }, "autoload": { @@ -2753,20 +3043,20 @@ "interoperability", "standards" ], - "time": "2019-11-18T17:27:11+00:00" + "time": "2020-05-20T17:43:50+00:00" }, { "name": "symfony/yaml", - "version": "v3.4.39", + "version": "v3.4.42", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "e701b47e11749970f63803879c4febb520f07b6c" + "reference": "7233ac2bfdde24d672f5305f2b3f6b5d741ef8eb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/e701b47e11749970f63803879c4febb520f07b6c", - "reference": "e701b47e11749970f63803879c4febb520f07b6c", + "url": "https://api.github.com/repos/symfony/yaml/zipball/7233ac2bfdde24d672f5305f2b3f6b5d741ef8eb", + "reference": "7233ac2bfdde24d672f5305f2b3f6b5d741ef8eb", "shasum": "" }, "require": { @@ -2812,30 +3102,30 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2020-03-25T12:02:26+00:00" + "time": "2020-05-11T07:51:54+00:00" }, { "name": "vlucas/phpdotenv", - "version": "v2.6.3", + "version": "v2.6.5", "source": { "type": "git", "url": "https://github.com/vlucas/phpdotenv.git", - "reference": "df4c4d08a639be4ef5d6d1322868f9e477553679" + "reference": "2e977311ffb17b2f82028a9c36824647789c6365" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/df4c4d08a639be4ef5d6d1322868f9e477553679", - "reference": "df4c4d08a639be4ef5d6d1322868f9e477553679", + "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/2e977311ffb17b2f82028a9c36824647789c6365", + "reference": "2e977311ffb17b2f82028a9c36824647789c6365", "shasum": "" }, "require": { - "php": ">=5.3.9", - "symfony/polyfill-ctype": "^1.9" + "php": "^5.3.9 || ^7.0 || ^8.0", + "symfony/polyfill-ctype": "^1.16" }, "require-dev": { "ext-filter": "*", "ext-pcre": "*", - "phpunit/phpunit": "^4.8.35 || ^5.0" + "phpunit/phpunit": "^4.8.35 || ^5.7.27" }, "suggest": { "ext-filter": "Required to use the boolean validator.", @@ -2857,10 +3147,15 @@ "BSD-3-Clause" ], "authors": [ + { + "name": "Graham Campbell", + "email": "graham@alt-three.com", + "homepage": "https://gjcampbell.co.uk/" + }, { "name": "Vance Lucas", "email": "vance@vancelucas.com", - "homepage": "http://www.vancelucas.com" + "homepage": "https://vancelucas.com/" } ], "description": "Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.", @@ -2869,7 +3164,7 @@ "env", "environment" ], - "time": "2020-04-12T15:11:38+00:00" + "time": "2020-06-02T14:06:52+00:00" } ], "aliases": [],