Permalink
Browse files

[HttpFoundation] Fixed typos and incorrect php extension test method

session_module_name() also sets session.save_handler, so must use extension_loaded() to check if module exist
or not.
  • Loading branch information...
1 parent 97b94b0 commit d3fe874025e561da77107d28510bb6e3e816c774 Drak committed Jan 2, 2012
View
@@ -108,7 +108,7 @@ UPGRADE FROM 2.0 to 2.1
.. note::
- You can access optionally use constants in Twig templates using `constant()` e.g.
+ You can optionally use constants in Twig templates using `constant()` e.g.
`constant('Symfony\Component\HttpFoundation\FlashBag::NOTICE')`.
* Session object
@@ -124,7 +124,7 @@ UPGRADE FROM 2.0 to 2.1
and no longer should implement `read()`, `write()`, `remove()` which were removed from the
`SessionStorageInterface`.
- Any session storage drive that wants to use custom save handlers should
+ Any session storage driver that wants to use custom save handlers should
implement `Symfony\Component\HttpFoundation\SessionStorage\SessionSaveHandlerInterface`
### [FrameworkBundle]
@@ -58,7 +58,7 @@ public function __construct($savePath = null, array $options = array(), Attribut
*/
protected function registerSaveHandlers()
{
- ini_set('session.save_handlers', 'files');
+ ini_set('session.save_handler', 'files');
ini_set('session.save_path', $this->savePath);
}
}
@@ -40,7 +40,7 @@ class NativeMemcacheSessionStorage extends AbstractSessionStorage
*/
public function __construct($savePath = 'tcp://127.0.0.1:11211?persistent=0', array $options = array(), AttributeBagInterface $attributes = null, FlashBagInterface $flashes = null)
{
- if (!session_module_name('memcache')) {
+ if (!extension_loaded('memcache')) {
throw new \RuntimeException('PHP does not have "memcache" session module registered');
}
@@ -53,7 +53,7 @@ public function __construct($savePath = 'tcp://127.0.0.1:11211?persistent=0', ar
*/
protected function registerSaveHandlers()
{
- ini_set('session.save_handlers', 'memcache');
+ ini_set('session.save_handler', 'memcache');
ini_set('session.save_path', $this->savePath);
}
@@ -40,7 +40,7 @@ class NativeMemcachedSessionStorage extends AbstractSessionStorage
*/
public function __construct($savePath = '127.0.0.1:11211', array $options = array(), AttributeBagInterface $attributes = null, FlashBagInterface $flashes = null)
{
- if (!session_module_name('memcached')) {
+ if (!extension_loaded('memcached')) {
throw new \RuntimeException('PHP does not have "memcached" session module registered');
}
@@ -53,7 +53,7 @@ public function __construct($savePath = '127.0.0.1:11211', array $options = arra
*/
protected function registerSaveHandlers()
{
- ini_set('session.save_handlers', 'memcached');
+ ini_set('session.save_handler', 'memcached');
ini_set('session.save_path', $this->savePath);
}
@@ -40,7 +40,7 @@ class NativeSqliteSessionStorage extends AbstractSessionStorage
*/
public function __construct($dbPath, array $options = array(), AttributeBagInterface $attributes = null, FlashBagInterface $flashes = null)
{
- if (!session_module_name('sqlite')) {
+ if (!extension_loaded('sqlite')) {
throw new \RuntimeException('PHP does not have "sqlite" session module registered');
}
@@ -53,7 +53,7 @@ public function __construct($dbPath, array $options = array(), AttributeBagInter
*/
protected function registerSaveHandlers()
{
- ini_set('session.save_handlers', 'sqlite');
+ ini_set('session.save_handler', 'sqlite');
ini_set('session.save_path', $this->dbPath);
}
}

0 comments on commit d3fe874

Please sign in to comment.