From 2888d00ee0a0fa19156a19162589498d001f59fc Mon Sep 17 00:00:00 2001 From: Luis Cordova Date: Sat, 4 Jan 2014 14:38:03 -0500 Subject: [PATCH 1/2] answer some questions and clarify the best chapter imo from the symfony documentation --- .../http_foundation/session_configuration.rst | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/components/http_foundation/session_configuration.rst b/components/http_foundation/session_configuration.rst index 6425ea323cc..c2927e071f8 100644 --- a/components/http_foundation/session_configuration.rst +++ b/components/http_foundation/session_configuration.rst @@ -28,11 +28,13 @@ PHP or provided by PHP extensions, such as PHP-Sqlite, PHP-Memcached and so on. All native save handlers are internal to PHP and as such, have no public facing API. They must be configured by ``php.ini`` directives, usually ``session.save_path`` and potentially other driver specific directives. Specific details can be found in -docblock of the ``setOptions()`` method of each class. +the docblock of the ``setOptions()`` method of each class. For an example of this for +a save handler provided via the Memcached extension is +`php.net/manual/en/memcached.setoption`_ While native save handlers can be activated by directly using ``ini_set('session.save_handler', $name);``, Symfony2 provides a convenient way to -activate these in the same way as custom handlers. +activate these in the same way as it does for custom handlers. Symfony2 provides drivers for the following native save handler as an example: @@ -61,7 +63,7 @@ Example usage:: Custom Save Handlers -------------------- -Custom handlers are those which completely replace PHP's built in session save +Custom handlers are those which completely replace PHP's built-in session save handlers by providing six callback functions which PHP calls internally at various points in the session workflow. @@ -234,6 +236,11 @@ PHP 5.4 functionality if it is available. Save Handler Proxy ~~~~~~~~~~~~~~~~~~ +A Save Handler Proxy is basically a wrapper around a Save Handler that was +introduced to support seamlessly the migration from PHP 5.3 to PHP 5.4+. It +further creates an extension point from where custom logic can be added that +works independently of which handler is being wrapped inside. + There are two kinds of save handler class proxies which inherit from :class:`Symfony\\Component\\HttpFoundation\\Session\\Storage\\Handler\\AbstractProxy`: they are :class:`Symfony\\Component\\HttpFoundation\\Session\\Storage\\Handler\\NativeProxy` @@ -263,3 +270,4 @@ without knowledge of the specific save handler. .. _`php.net/session.customhandler`: http://php.net/session.customhandler .. _`php.net/session.configuration`: http://php.net/session.configuration +.. _`php.net/manual/en/memcached.setoption`: http://php.net/manual/en/memcached.setoption \ No newline at end of file From 771b8629a6217dd7b3404fedd1a647dd8a8e598f Mon Sep 17 00:00:00 2001 From: Luis Cordova Date: Sat, 4 Jan 2014 20:03:00 -0500 Subject: [PATCH 2/2] address comments from @WouterJ --- components/http_foundation/session_configuration.rst | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/components/http_foundation/session_configuration.rst b/components/http_foundation/session_configuration.rst index c2927e071f8..5f9687e37c1 100644 --- a/components/http_foundation/session_configuration.rst +++ b/components/http_foundation/session_configuration.rst @@ -28,9 +28,8 @@ PHP or provided by PHP extensions, such as PHP-Sqlite, PHP-Memcached and so on. All native save handlers are internal to PHP and as such, have no public facing API. They must be configured by ``php.ini`` directives, usually ``session.save_path`` and potentially other driver specific directives. Specific details can be found in -the docblock of the ``setOptions()`` method of each class. For an example of this for -a save handler provided via the Memcached extension is -`php.net/manual/en/memcached.setoption`_ +the docblock of the ``setOptions()`` method of each class. For instance, the one +provided by the Memcached extension can be found on `php.net/memcached.setoption`_ While native save handlers can be activated by directly using ``ini_set('session.save_handler', $name);``, Symfony2 provides a convenient way to @@ -270,4 +269,4 @@ without knowledge of the specific save handler. .. _`php.net/session.customhandler`: http://php.net/session.customhandler .. _`php.net/session.configuration`: http://php.net/session.configuration -.. _`php.net/manual/en/memcached.setoption`: http://php.net/manual/en/memcached.setoption \ No newline at end of file +.. _`php.net/memcached.setoption`: http://php.net/memcached.setoption