当前位置: 首页>>代码示例>>PHP>>正文


PHP eZScript::initialize方法代码示例

本文整理汇总了PHP中eZScript::initialize方法的典型用法代码示例。如果您正苦于以下问题:PHP eZScript::initialize方法的具体用法?PHP eZScript::initialize怎么用?PHP eZScript::initialize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在eZScript的用法示例。


在下文中一共展示了eZScript::initialize方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 public function __construct($theClass = '', $name = '')
 {
     parent::__construct($theClass, $name);
     if (!self::$script instanceof eZScript) {
         self::$script = eZScript::instance(array('description' => "eZ Publish Test Runner\n\nsets up an eZ Publish testing environment\n", 'use-session' => false, 'use-modules' => true, 'use-extensions' => true));
         // Override INI override folder from settings/override to
         // tests/settings to not read local override settings
         $ini = eZINI::instance();
         $ini->setOverrideDirs(array(array('tests/settings', true)), 'override');
         $ini->loadCache();
         // Be sure to have clean content language data
         eZContentLanguage::expireCache();
         self::$script->startup();
         self::$script->initialize();
         // Avoids Fatal error: eZ Publish did not finish its request if die() is used.
         eZExecution::setCleanExit();
     }
 }
开发者ID:brookinsconsulting,项目名称:ezecosystem,代码行数:18,代码来源:ezptestsuite.php

示例2: runCallback

 /**
  * 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)
  *
  * @param \Closure $callback
  * @param boolean $postReinitialize Default 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.
  * @return mixed The result of the callback
  */
 public function runCallback(\Closure $callback, $postReinitialize = true)
 {
     if (!$this->script->isInitialized()) {
         $this->script->initialize();
     }
     $return = $callback();
     $this->script->shutdown();
     if (!$postReinitialize) {
         $this->script->setIsInitialized(true);
     }
     return $return;
 }
开发者ID:masev,项目名称:ezpublish-kernel,代码行数:22,代码来源:CLIHandler.php


注:本文中的eZScript::initialize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。