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


PHP Shineisp_Registry::set方法代码示例

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


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

示例1: init

 public function init()
 {
     // Get all settings
     Shineisp_Registry::set('Settings', Settings::getAll());
     // Statuses are used everywhere in system, so we need to make just one query
     Shineisp_Registry::set('Status', Statuses::getAll());
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:7,代码来源:Common.php

示例2: preStmtExecute

 public function preStmtExecute(Doctrine_Event $event)
 {
     // Check if the administrator has enabled the query logging feature
     if (Settings::findbyParam('debug_queries')) {
         $breadcrumps = array();
         $query = $event->getQuery();
         $params = $event->getParams();
         $callers = array_reverse(debug_backtrace(), true);
         $callers = array_slice($callers, 4, count($callers) - 10);
         foreach ($callers as $caller) {
             $class = !empty($caller['class']) ? $caller['class'] : null;
             $breadcrumps[] = $class . "->" . $caller['function'];
         }
         $strBreadcrump = "System: " . implode(" / ", $breadcrumps);
         //the below makes some naive assumptions about the queries being logged
         while (sizeof($params) > 0) {
             $param = array_shift($params);
             if (!is_numeric($param)) {
                 $param = sprintf("'%s'", $param);
             }
             $query = substr_replace($query, $param, strpos($query, '?'), 1);
         }
         Shineisp_Commons_Utilities::log($query, "queries.log");
         Shineisp_Commons_Utilities::log($strBreadcrump, "debug.log", Zend_Log::DEBUG);
         // Increase query counter
         $queryCount = Shineisp_Registry::isRegistered('querycount') ? Shineisp_Registry::get('querycount') : 0;
         $queryCount = $queryCount + 1;
         Shineisp_Registry::set('querycount', $queryCount);
     }
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:30,代码来源:QueriesLogger.php

示例3: id

 /**
  * Get the Status ID
  * 
  * @param string $status 
  * @param string $section
  */
 public static function id($status, $section = "generic")
 {
     $statuses = Shineisp_Registry::get('Status');
     if (empty($statuses)) {
         Shineisp_Registry::set('Status', self::getAll());
     }
     if (!empty($status)) {
         $status = strtolower($status);
     }
     $section = strtolower($section);
     return intval(Shineisp_Registry::get('Status')->{$section}->{$status}->status_id) ? intval(Shineisp_Registry::get('Status')->{$section}->{$status}->status_id) : null;
     return null;
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:19,代码来源:Statuses.php

示例4: init

 public function init()
 {
     // Get authenticated user
     $auth = Zend_Auth::getInstance()->getIdentity();
     // Store logged ISP. I'm inside admin, se we use only the logged user
     if (isset($auth['isp_id'])) {
         $isp_id = intval($auth['isp_id']);
         $ISP = new Isp();
         Shineisp_Registry::set('ISP', $ISP->find($isp_id));
     }
     // Load all the status in the registry
     $statusreg = Shineisp_Registry::get('Status');
     if (empty($statusreg)) {
         $status = Statuses::getAll();
         Shineisp_Registry::set('Status', $status);
     }
     parent::init();
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:18,代码来源:Admin.php

示例5: init

 public function init()
 {
     try {
         // Store logged ISP. I'm in the public area, se we use only the URL
         $ISP = Isp::findByUrl($_SERVER['HTTP_HOST']);
         if (!empty($ISP)) {
             Shineisp_Registry::set('ISP', $ISP);
         }
         // Load all the status in the registry
         $statusreg = Shineisp_Registry::get('Status');
         if (empty($statusreg)) {
             $status = Statuses::getAll();
             Shineisp_Registry::set('Status', $status);
         }
     } catch (Exception $e) {
         Shineisp_Commons_Utilities::log(__METHOD__ . " " . $e->getMessage());
     }
     parent::init();
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:19,代码来源:Default.php

示例6: setDefaultLanguage

 /**
  * Set the language object variable
  * @param $locale
  */
 public static function setDefaultLanguage($path, $locale)
 {
     $zl = new Zend_Locale();
     if (!empty($locale)) {
         $zl->setLocale($locale);
         Shineisp_Registry::set('Zend_Locale', $zl);
     }
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:12,代码来源:Languages.php

示例7: loadConfig

 /**
  * Load of the configuration file
  * @return SimpleXMLElement
  */
 public static function loadConfig()
 {
     $confFile = APPLICATION_PATH . "/configs/config.xml";
     try {
         if (file_exists($confFile) && is_readable($confFile)) {
             $config = Shineisp_Commons_Utilities::readfile($confFile);
             if (!empty($config)) {
                 $config = new Zend_Config_Xml($confFile);
                 if (simplexml_load_file($confFile)) {
                     Shineisp_Registry::set('config', $config);
                     return simplexml_load_file($confFile);
                 } else {
                     throw new Exception("XML Config file is not readable or not well-formed");
                 }
             }
         }
     } catch (Exception $e) {
         echo $e->getMessage();
         echo "<xmp>";
         echo $e->getTraceAsString();
         echo "</xmp>";
         exit;
     }
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:28,代码来源:Main.php


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