diff --git a/CHANGELOG.md b/CHANGELOG.md index d174921..eb6659f 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # CHANGELOG +## 3.2.0 (2019-07-10) + +- Adds built-in token regeneration to LightMVC Sessions. + +- Adds new session configuration options to allow for domain configuration of session cookies. + +- Adds a new controller-based pre-dispatch event for all controllers. + +- Adds the possibility to configure multiple listeners on a same event when using an AggregateRootController. + +- Updates the project's dependencies. + +- Updates the user documentation. + ## 3.1.2 (2019-05-13) - Removes some dead code (Skeleton Application). diff --git a/composer.json b/composer.json index 718ee67..408e7c2 100755 --- a/composer.json +++ b/composer.json @@ -20,7 +20,7 @@ ], "require": { "php": "^7.2", - "lightmvc/ascmvc": "3.1.2" + "lightmvc/ascmvc": "3.2.0" }, "require-dev": { "phpunit/phpunit": "^4.8", diff --git a/composer.lock b/composer.lock index f0e803d..7dd7aa0 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": "c242835c467cd4ee25d979b474e03d52", + "content-hash": "a0f2baea310f6c69693186a762012597", "packages": [ { "name": "atlas/mapper", @@ -449,16 +449,16 @@ }, { "name": "doctrine/collections", - "version": "v1.6.1", + "version": "v1.6.2", "source": { "type": "git", "url": "https://github.com/doctrine/collections.git", - "reference": "d2ae4ef05e25197343b6a39bae1d3c427a2f6956" + "reference": "c5e0bc17b1620e97c968ac409acbff28b8b850be" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/collections/zipball/d2ae4ef05e25197343b6a39bae1d3c427a2f6956", - "reference": "d2ae4ef05e25197343b6a39bae1d3c427a2f6956", + "url": "https://api.github.com/repos/doctrine/collections/zipball/c5e0bc17b1620e97c968ac409acbff28b8b850be", + "reference": "c5e0bc17b1620e97c968ac409acbff28b8b850be", "shasum": "" }, "require": { @@ -515,7 +515,7 @@ "iterators", "php" ], - "time": "2019-03-25T19:03:48+00:00" + "time": "2019-06-09T13:48:14+00:00" }, { "name": "doctrine/common", @@ -784,21 +784,24 @@ }, { "name": "doctrine/lexer", - "version": "v1.0.1", + "version": "1.0.2", "source": { "type": "git", "url": "https://github.com/doctrine/lexer.git", - "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c" + "reference": "1febd6c3ef84253d7c815bed85fc622ad207a9f8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/83893c552fd2045dd78aef794c31e694c37c0b8c", - "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/1febd6c3ef84253d7c815bed85fc622ad207a9f8", + "reference": "1febd6c3ef84253d7c815bed85fc622ad207a9f8", "shasum": "" }, "require": { "php": ">=5.3.2" }, + "require-dev": { + "phpunit/phpunit": "^4.5" + }, "type": "library", "extra": { "branch-alias": { @@ -806,8 +809,8 @@ } }, "autoload": { - "psr-0": { - "Doctrine\\Common\\Lexer\\": "lib/" + "psr-4": { + "Doctrine\\Common\\Lexer\\": "lib/Doctrine/Common/Lexer" } }, "notification-url": "https://packagist.org/downloads/", @@ -828,13 +831,16 @@ "email": "schmittjoh@gmail.com" } ], - "description": "Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.", - "homepage": "http://www.doctrine-project.org", + "description": "PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.", + "homepage": "https://www.doctrine-project.org/projects/lexer.html", "keywords": [ + "annotations", + "docblock", "lexer", - "parser" + "parser", + "php" ], - "time": "2014-09-09T13:34:57+00:00" + "time": "2019-06-08T11:03:04+00:00" }, { "name": "doctrine/orm", @@ -1081,16 +1087,16 @@ }, { "name": "lightmvc/ascmvc", - "version": "3.1.2", + "version": "3.2.0", "source": { "type": "git", "url": "https://github.com/lightmvc/ascmvc.git", - "reference": "aefe012eec6426a1a4539c9ed9b205c301672635" + "reference": "32598af3ba452df15efd796eb9e2c06d24a838cb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/lightmvc/ascmvc/zipball/aefe012eec6426a1a4539c9ed9b205c301672635", - "reference": "aefe012eec6426a1a4539c9ed9b205c301672635", + "url": "https://api.github.com/repos/lightmvc/ascmvc/zipball/32598af3ba452df15efd796eb9e2c06d24a838cb", + "reference": "32598af3ba452df15efd796eb9e2c06d24a838cb", "shasum": "" }, "require": { @@ -1150,7 +1156,7 @@ "mvc", "swoole" ], - "time": "2019-05-13T21:02:08+00:00" + "time": "2019-07-10T23:04:01+00:00" }, { "name": "nikic/fast-route", @@ -1699,16 +1705,16 @@ }, { "name": "symfony/console", - "version": "v3.4.27", + "version": "v3.4.29", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "15a9104356436cb26e08adab97706654799d31d8" + "reference": "c4d2f3529755ffc0be9fb823583b28d8744eeb3d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/15a9104356436cb26e08adab97706654799d31d8", - "reference": "15a9104356436cb26e08adab97706654799d31d8", + "url": "https://api.github.com/repos/symfony/console/zipball/c4d2f3529755ffc0be9fb823583b28d8744eeb3d", + "reference": "c4d2f3529755ffc0be9fb823583b28d8744eeb3d", "shasum": "" }, "require": { @@ -1767,20 +1773,20 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2019-04-08T09:29:13+00:00" + "time": "2019-06-05T11:33:52+00:00" }, { "name": "symfony/debug", - "version": "v4.2.8", + "version": "v4.3.2", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "2d279b6bb1d582dd5740d4d3251ae8c18812ed37" + "reference": "d8f4fb38152e0eb6a433705e5f661d25b32c5fcd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/2d279b6bb1d582dd5740d4d3251ae8c18812ed37", - "reference": "2d279b6bb1d582dd5740d4d3251ae8c18812ed37", + "url": "https://api.github.com/repos/symfony/debug/zipball/d8f4fb38152e0eb6a433705e5f661d25b32c5fcd", + "reference": "d8f4fb38152e0eb6a433705e5f661d25b32c5fcd", "shasum": "" }, "require": { @@ -1796,7 +1802,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.2-dev" + "dev-master": "4.3-dev" } }, "autoload": { @@ -1823,7 +1829,7 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2019-04-11T11:27:41+00:00" + "time": "2019-06-19T15:27:09+00:00" }, { "name": "symfony/polyfill-ctype", @@ -1944,16 +1950,16 @@ }, { "name": "symfony/process", - "version": "v4.2.8", + "version": "v4.3.2", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "8cf39fb4ccff793340c258ee7760fd40bfe745fe" + "reference": "856d35814cf287480465bb7a6c413bb7f5f5e69c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/8cf39fb4ccff793340c258ee7760fd40bfe745fe", - "reference": "8cf39fb4ccff793340c258ee7760fd40bfe745fe", + "url": "https://api.github.com/repos/symfony/process/zipball/856d35814cf287480465bb7a6c413bb7f5f5e69c", + "reference": "856d35814cf287480465bb7a6c413bb7f5f5e69c", "shasum": "" }, "require": { @@ -1962,7 +1968,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.2-dev" + "dev-master": "4.3-dev" } }, "autoload": { @@ -1989,7 +1995,7 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2019-04-10T16:20:36+00:00" + "time": "2019-05-30T16:10:05+00:00" }, { "name": "twig/twig", @@ -2533,16 +2539,16 @@ }, { "name": "phpspec/prophecy", - "version": "1.8.0", + "version": "1.8.1", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06" + "reference": "1927e75f4ed19131ec9bcc3b002e07fb1173ee76" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4ba436b55987b4bf311cb7c6ba82aa528aac0a06", - "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/1927e75f4ed19131ec9bcc3b002e07fb1173ee76", + "reference": "1927e75f4ed19131ec9bcc3b002e07fb1173ee76", "shasum": "" }, "require": { @@ -2563,8 +2569,8 @@ } }, "autoload": { - "psr-0": { - "Prophecy\\": "src/" + "psr-4": { + "Prophecy\\": "src/Prophecy" } }, "notification-url": "https://packagist.org/downloads/", @@ -2592,7 +2598,7 @@ "spy", "stub" ], - "time": "2018-08-05T17:53:17+00:00" + "time": "2019-06-13T12:50:23+00:00" }, { "name": "phpunit/php-code-coverage", @@ -3423,7 +3429,7 @@ }, { "name": "symfony/yaml", - "version": "v3.4.27", + "version": "v3.4.29", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", diff --git a/config/session.config.php b/config/session.config.php index 30b8f97..03b5ce5 100644 --- a/config/session.config.php +++ b/config/session.config.php @@ -16,8 +16,12 @@ ], 'session_name' => 'PHPSESSION', 'session_path' => '/', + 'session_domain' => '', + 'session_secure' => false, + 'session_httponly' => false, 'session_id_length' => 32, 'session_id_type' => 1, 'session_storage_prefix' => 'ascmvc', - 'session_expire' => 60 * 30, // 30 minutes + 'session_token_regeneration' => 60 * 30, // 30 minutes + 'session_expire' => 60 * 60, // 60 minutes ]; \ No newline at end of file diff --git a/config/session.config.php.dist b/config/session.config.php.dist index ad1ad5f..03b5ce5 100644 --- a/config/session.config.php.dist +++ b/config/session.config.php.dist @@ -1,7 +1,7 @@ false, + 'enabled' => true, 'psr6_cache_pool' => \Ascmvc\Session\Cache\DoctrineCacheItemPool::class, 'doctrine_cache_driver' => \Doctrine\Common\Cache\FilesystemCache::class, //'doctrine_cache_driver' => \Doctrine\Common\Cache\XcacheCache::class, @@ -16,8 +16,12 @@ $baseConfig['session'] = [ ], 'session_name' => 'PHPSESSION', 'session_path' => '/', + 'session_domain' => '', + 'session_secure' => false, + 'session_httponly' => false, 'session_id_length' => 32, 'session_id_type' => 1, 'session_storage_prefix' => 'ascmvc', - 'session_expire' => 60 * 30, // 30 minutes + 'session_token_regeneration' => 60 * 30, // 30 minutes + 'session_expire' => 60 * 60, // 60 minutes ]; \ No newline at end of file diff --git a/controllers/Application/Commands/WriteProductsCommand.php b/controllers/Application/Commands/WriteProductsCommand.php index 831d306..e224977 100644 --- a/controllers/Application/Commands/WriteProductsCommand.php +++ b/controllers/Application/Commands/WriteProductsCommand.php @@ -53,7 +53,7 @@ protected function execute(InputInterface $input, OutputInterface $output) $values = []; try { - if ($name === 'create') { + if ($name === 'create') { $productsRepository->save($args); } elseif ($name === 'update') { $products = $entityManager->find(Products::class, $args['id']);