eZPublishCommunityProject  2013.5
eZ\Publish\Core\MVC\Legacy\Kernel Class Reference

Class wrapping the legacy kernel. More...

+ Inheritance diagram for eZ\Publish\Core\MVC\Legacy\Kernel:
+ Collaboration diagram for eZ\Publish\Core\MVC\Legacy\Kernel:

Public Member Functions

 __construct (ezpKernelHandler $kernelHandler, $legacyRootDir, $webRootDir)
 
 enterLegacyRootDir ()
 Changes the current working directory to the legacy root dir. More...
 
 leaveLegacyRootDir ()
 Leaves the legacy root dir and switches back to the initial webroot dir. More...
 
 run ()
 Runs current request through legacy kernel. More...
 
 runCallback (\Closure $callback, $postReinitialize=true)
 Runs a callback function in the legacy kernel environment. More...
 

Private Attributes

 $legacyRootDir
 
 $runningCallback = false
 
 $webRootDir
 

Detailed Description

Class wrapping the legacy kernel.

Constructor & Destructor Documentation

eZ\Publish\Core\MVC\Legacy\Kernel::__construct ( ezpKernelHandler  $kernelHandler,
  $legacyRootDir,
  $webRootDir 
)
Parameters
\ezpKernelHandler$kernelHandler
string$legacyRootDirMust be a absolute dir
string$webRootDirMust be a absolute dir

Member Function Documentation

eZ\Publish\Core\MVC\Legacy\Kernel::enterLegacyRootDir ( )

Changes the current working directory to the legacy root dir.

Calling this method is mandatory to use legacy kernel since a lot of resources in eZ Publish 4.x relatively defined.

Referenced by eZ\Publish\Core\MVC\Legacy\Kernel\__construct(), eZ\Publish\Core\MVC\Legacy\Kernel\run(), and eZ\Publish\Core\MVC\Legacy\Kernel\runCallback().

eZ\Publish\Core\MVC\Legacy\Kernel::leaveLegacyRootDir ( )

Leaves the legacy root dir and switches back to the initial webroot dir.

Referenced by eZ\Publish\Core\MVC\Legacy\Kernel\__construct(), eZ\Publish\Core\MVC\Legacy\Kernel\run(), and eZ\Publish\Core\MVC\Legacy\Kernel\runCallback().

eZ\Publish\Core\MVC\Legacy\Kernel::run ( )

Runs current request through legacy kernel.

Returns
array
eZ\Publish\Core\MVC\Legacy\Kernel::runCallback ( \Closure  $callback,
  $postReinitialize = true 
)

Runs a callback function in the legacy kernel environment.

This is useful to run eZ Publish 4.x code from a non-related context (like eZ Publish 5). Will throw a if trying to run a callback inside a callback.

Parameters
\Closure$callback
boolean$postReinitializeDefault is true. If set to false, the kernel environment will not be reinitialized. This can be useful to optimize several calls to the kernel within the same context.
Exceptions
\RuntimeException
Returns
mixed The result of the callback

Member Data Documentation

eZ\Publish\Core\MVC\Legacy\Kernel::$legacyRootDir
private
eZ\Publish\Core\MVC\Legacy\Kernel::$runningCallback = false
private
eZ\Publish\Core\MVC\Legacy\Kernel::$webRootDir
private

The documentation for this class was generated from the following file: