當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。