zend-server-extensions / Z-Ray-ZF2

Zend Framework 2 Extension for Zend Server Z-Ray
BSD 3-Clause "New" or "Revised" License
4 stars 5 forks source link

Serialization of closure bug #9

Open adamculp opened 9 years ago

adamculp commented 9 years ago

If codebase contains a closure in a module.config.php file it causes Z-Ray ZF2 extension to error with:

Uncaught exception 'Exception' with message 'Serialization of 'Closure' is not allowed' in /var/www/html/vendor/zendframework/zendframework/library/Zend/Mvc/Application.php:0 Stack trace: #0 /var/www/html/public/index.php(28): Zend\Mvc\Application->run() #1 {main} thrown

Example from module.config.php:

'service_manager' = array(
    'factories' => array(
          'CronManager' => function ($sm)
          { 
            return new \Application\Utility\Cron($sm->get('doctrine.cache.memcache'));
          },
    )
)

Maybe look at makeArraySerializable()

adamculp commented 9 years ago

Also, as a sidenote, when Z-Ray was disabled it appears that Zend Server is still loading the extension even though Z-Ray is not loaded.

amitdar commented 9 years ago

In the next release of Zend Server we will have a fix for the closure issue. We will investigate the second issue you mentioned,

adamculp commented 9 years ago

OK, great. I downloaded the latest code for this extension and it was still an issue.