Do you really need this to be initialized at every request? If so, you
could grab the service in your module's onBootstrap.
On 16 May 2013 16:06, "jas [via Zend Framework Community]" <
[email protected]> wrote:

> I have created a custom session 
> handler<https://github.com/jas-/myTFH-ZF2/blob/master/vendor/MyTFH/src/MyTFH/Sessions/SessionsService.php>
>  to
> query database stored 
> procedures<https://github.com/jas-/myTFH-ZF2/blob/master/vendor/MyTFH/src/MyTFH/Storage/StorageService.php>
>  using
> some stored 
> procedures<https://github.com/jas-/myTFH-ZF2/blob/master/vendor/MyTFH/data/sp-sessions.sql>
>  which
> provide transparent AES encryption for the session data with or without the
> need for the suhosin <http://www.hardened-php.net/suhosin/> patch
> installed.
>
> Currently I have the *Module.php* using the above *
> MyTFH\Storage\StorageService* & *MyTFH\Session\SessionService* loaded
> within the factory directive to auto-load configuration settings defined in
> *config\module.config.php* like so...
>
> public function getServiceConfig() {
>     return array(
>         'factories' => array(
>             'MyTFH\Sessions\SessionsService' => function ($sm) {
>                 $config = $sm->get('config');
>                 return new
> \MyTFH\Sessions\SessionsService($config['MyTFH']);
>             },
>             'MyTFH\Storage\StorageService' => function ($sm) {
>                 $config = $sm->get('config');
>                 return new
> \MyTFH\Storage\StorageService($config['MyTFH']);
>             },
>         )
>     );
> }
>
> What I would like to do is have this loaded upon application start vs.
> specific controller startup (as seen in
> MyTFH\Controllers\RegisterController<https://github.com/jas-/myTFH-ZF2/blob/master/vendor/MyTFH/src/MyTFH/Controller/RegisterController.php>).
> The documentation regarding zf2 custom session handling is sparse. Any
> tips? I am fairly new to the zf2 framework so if something can be done
> better please let me know. Thanks in advance.
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://zend-framework-community.634137.n4.nabble.com/Custom-session-handler-global-initialization-tp4660037.html
>  To start a new topic under Zend Framework, email
> [email protected]
> To unsubscribe from Zend Framework Community, click 
> here<http://zend-framework-community.634137.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=634137&code=b2NyYW1pdXNAZ21haWwuY29tfDYzNDEzN3wxNzE0OTI1MTk4>
> .
> NAML<http://zend-framework-community.634137.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: 
http://zend-framework-community.634137.n4.nabble.com/Custom-session-handler-global-initialization-tp4660037p4660044.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to