...
eZ Publish 5 still relies on the legacy kernel (from 4.x) and runs it when needed inside an isolated PHP closure, making it sandboxed. This This is available for your use as well making it possible to run some PHP code inside that sandbox through the runCallback()
methodthrough the runCallback()
method.
Warning |
---|
All calls from Platform/Symfony stack to legacy stack should be run inside a |
Code Block | ||||
---|---|---|---|---|
| ||||
<?php // Declare use statements for the classes you may need use eZINI; // Inside a controller extending eZ\Bundle\EzPublishCoreBundle\Controller $settingName = 'MySetting'; $test = array( 'oneValue', 'anotherValue' ); $myLegacySetting = $this->getLegacyKernel()->runCallback( function () use ( $settingName, $test ) { // Here you can reuse $settingName and $test variables inside the legacy context $ini = eZINI::instance( 'someconfig.ini' ); return $ini->variable( 'SomeSection', $settingName ); } ); |
...