當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Zibo::runEvent方法代碼示例

本文整理匯總了PHP中zibo\core\Zibo::runEvent方法的典型用法代碼示例。如果您正苦於以下問題:PHP Zibo::runEvent方法的具體用法?PHP Zibo::runEvent怎麽用?PHP Zibo::runEvent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在zibo\core\Zibo的用法示例。


在下文中一共展示了Zibo::runEvent方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: loadConnectionsFromConfig

 /**
  * Loads the database connections from the Zibo configuration
  * @param zibo\core\Zibo $zibo Instance of Zibo
  * @return null
  * @throws zibo\library\database\exception\DatabaseException when the configuration contains an invalid connection
  * @throws zibo\library\database\exception\DatabaseException when the default connection does not exist
  */
 private function loadConnectionsFromConfig(Zibo $zibo)
 {
     $zibo->runEvent(Zibo::EVENT_LOG, 'Loading database connections', '', 0, self::LOG_NAME);
     $connections = $zibo->getConfigValue(self::CONFIG_CONNECTION, array());
     if (!is_array($connections)) {
         $connections = array(self::NAME_DEFAULT => $connections);
     }
     $defaultConnectionName = null;
     foreach ($connections as $name => $dsn) {
         if ($name == self::NAME_DEFAULT) {
             $defaultConnectionName = $name;
         }
         try {
             $dsn = new Dsn($dsn);
             $this->registerConnection($name, $dsn);
         } catch (DatabaseException $e) {
             if ($name == self::NAME_DEFAULT) {
                 $defaultConnectionName = $dsn;
             } else {
                 throw $e;
             }
         }
     }
     if ($defaultConnectionName != null) {
         $this->setDefaultConnectionName($defaultConnectionName);
     }
 }
開發者ID:BGCX261,項目名稱:zibo-svn-to-git,代碼行數:34,代碼來源:DatabaseManager.php

示例2: initializeSecurityModel

 /**
  * Initializes the security model from the Zibo configuration
  * @param zibo\core\Zibo $zibo The Zibo instance
  * @param zibo\library\ObjectFactory $objectFactory Instance of an object factory
  * @return null
  */
 private function initializeSecurityModel(Zibo $zibo, ObjectFactory $objectFactory)
 {
     $modelClass = $zibo->getConfigValue(self::CONFIG_SECURITY_MODEL);
     if (!$modelClass) {
         return;
     }
     try {
         $this->model = $objectFactory->create($modelClass, self::INTERFACE_SECURITY_MODEL);
         $zibo->runEvent(Zibo::EVENT_LOG, 'Using security model ' . $modelClass, '', 0, self::LOG_NAME);
     } catch (Exception $e) {
         $zibo->runEvent(Zibo::EVENT_LOG, 'Could not create security model ' . $modelClass, $e, 1, self::LOG_NAME);
     }
 }
開發者ID:BGCX261,項目名稱:zibo-svn-to-git,代碼行數:19,代碼來源:SecurityManager.php


注:本文中的zibo\core\Zibo::runEvent方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。