Commit fb6fd073 authored by Fabien Potencier's avatar Fabien Potencier

merged branch davedevelopment/remove-native-file-session-handler (PR #338)

Commits
-------

f9837f85 Switch to FileSessionHandler, NativeFileSessionHandler remove upstream
e9af894a Added simple smoke test for default session provider setup
a34077d8 Updated vendors

Discussion
----------

Switch NativeFileSessionHandler to FileSessionHandler

Looks like it's been removed upstream...
parents 8b2d3a2b f9837f85
{ {
"hash": "142455bfe45755d318953c04880d43f2", "hash": "f7193a3cd703d32a4f245ce9c03c3a7f",
"packages": [ "packages": [
{ {
"package": "pimple/pimple", "package": "pimple/pimple",
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
{ {
"package": "symfony/dom-crawler", "package": "symfony/dom-crawler",
"version": "dev-master", "version": "dev-master",
"source-reference": "e3c4c8426881e7fae02cc3024bc0b4c75c952b63" "source-reference": "2e27527036c4cd608692718414835173c40f52bd"
}, },
{ {
"package": "symfony/event-dispatcher", "package": "symfony/event-dispatcher",
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
{ {
"package": "symfony/http-foundation", "package": "symfony/http-foundation",
"version": "dev-master", "version": "dev-master",
"source-reference": "d86fa9abba0f66fda231b9d47c004c84be792bf2" "source-reference": "d9ef2afd0218415a8c04ea48a2c83bb5b8f0f51c"
}, },
{ {
"package": "symfony/http-foundation", "package": "symfony/http-foundation",
...@@ -87,7 +87,7 @@ ...@@ -87,7 +87,7 @@
{ {
"package": "symfony/http-kernel", "package": "symfony/http-kernel",
"version": "dev-master", "version": "dev-master",
"source-reference": "07babe5e04be9af637dc661eaa6ba1fd0ab44e42" "source-reference": "a9dbd268659d19eabcc8285ca4622b232f55aa91"
}, },
{ {
"package": "symfony/process", "package": "symfony/process",
...@@ -98,7 +98,7 @@ ...@@ -98,7 +98,7 @@
{ {
"package": "symfony/process", "package": "symfony/process",
"version": "dev-master", "version": "dev-master",
"source-reference": "fc536cce9e41251135595a8fa21635800199b51b" "source-reference": "f4f101fc7c1adb8b157058dcc1715f28f1d53208"
}, },
{ {
"package": "symfony/routing", "package": "symfony/routing",
...@@ -109,7 +109,7 @@ ...@@ -109,7 +109,7 @@
{ {
"package": "symfony/routing", "package": "symfony/routing",
"version": "dev-master", "version": "dev-master",
"source-reference": "17018b5a3d6b80f872d05330270e1d828456c183" "source-reference": "1d5a64f26588d63e3a1235a6ade0d54ae4ab3381"
} }
], ],
"packages-dev": null, "packages-dev": null,
......
...@@ -8,7 +8,7 @@ Parameters ...@@ -8,7 +8,7 @@ Parameters
---------- ----------
* **session.storage.save_path** (optional): The path for the * **session.storage.save_path** (optional): The path for the
``NativeFileSessionHandler``, defaults to the value of ``FileSessionHandler``, defaults to the value of
``sys_get_temp_dir()``. ``sys_get_temp_dir()``.
* **session.storage.options**: An array of options that is passed to the * **session.storage.options**: An array of options that is passed to the
...@@ -38,7 +38,7 @@ Services ...@@ -38,7 +38,7 @@ Services
* **session.storage.handler**: A service that is used by the * **session.storage.handler**: A service that is used by the
``session.storage`` for data access. Defaults to a ``session.storage`` for data access. Defaults to a
``NativeFileSessionHandler`` storage handler. ``FileSessionHandler`` storage handler.
Registering Registering
----------- -----------
......
...@@ -14,7 +14,7 @@ namespace Silex\Provider; ...@@ -14,7 +14,7 @@ namespace Silex\Provider;
use Silex\Application; use Silex\Application;
use Silex\ServiceProviderInterface; use Silex\ServiceProviderInterface;
use Symfony\Component\HttpFoundation\Session\Storage\Handler\NativeFileSessionHandler; use Symfony\Component\HttpFoundation\Session\Storage\Handler\FileSessionHandler;
use Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage; use Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage;
use Symfony\Component\HttpFoundation\Session\Session; use Symfony\Component\HttpFoundation\Session\Session;
use Symfony\Component\HttpKernel\KernelEvents; use Symfony\Component\HttpKernel\KernelEvents;
...@@ -37,7 +37,7 @@ class SessionServiceProvider implements ServiceProviderInterface ...@@ -37,7 +37,7 @@ class SessionServiceProvider implements ServiceProviderInterface
}); });
$app['session.storage.handler'] = $app->share(function () use ($app) { $app['session.storage.handler'] = $app->share(function () use ($app) {
return new NativeFileSessionHandler( return new FileSessionHandler(
isset($app['session.storage.save_path']) ? $app['session.storage.save_path'] : null isset($app['session.storage.save_path']) ? $app['session.storage.save_path'] : null
); );
}); });
......
...@@ -30,6 +30,11 @@ class SessionServiceProviderTest extends \PHPUnit_Framework_TestCase ...@@ -30,6 +30,11 @@ class SessionServiceProviderTest extends \PHPUnit_Framework_TestCase
$app->register(new SessionServiceProvider()); $app->register(new SessionServiceProvider());
/**
* Smoke test
*/
$defaultStorage = $app['session.storage'];
$app['session.storage'] = $app->share(function () use ($app) { $app['session.storage'] = $app->share(function () use ($app) {
return new MockArraySessionStorage(); return new MockArraySessionStorage();
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment