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


PHP ipsRegistry::_loadCoreVariables方法代碼示例

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


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

示例1: buildFurlTemplates

 /**
  * Build furl templates from FURL extensions
  *
  * @access	public
  * @return  array
  */
 public static function buildFurlTemplates()
 {
     /* INIT */
     $apps = array();
     /* Done this already? */
     if (self::$_furlTemplates) {
         return self::$_furlTemplates;
     }
     /* Because this is called before the cache is unpacked, we need to expensively grab all app dirs */
     foreach (array('applications', 'applications_addon/ips', 'applications_addon/other') as $folder) {
         try {
             foreach (new DirectoryIterator(IPS_ROOT_PATH . $folder) as $file) {
                 if (!$file->isDot() and $file->isDir()) {
                     $_name = $file->getFileName();
                     if (substr($_name, 0, 1) != '.') {
                         $apps[$folder . '/' . $_name] = $_name;
                     }
                 }
             }
         } catch (Exception $e) {
         }
     }
     /* First, add in core stuffs */
     ipsRegistry::_loadCoreVariables();
     $templates = ipsRegistry::_fetchCoreVariables('templates');
     if (is_array($templates)) {
         foreach ($templates as $key => $data) {
             self::$_furlTemplates[$key] = $data;
         }
     }
     /* Loop over the applications and build */
     foreach ($apps as $path => $app_dir) {
         $appSphinxTemplate = '';
         if (file_exists(IPS_ROOT_PATH . $path . '/extensions/furlTemplates.php')) {
             unset($_SEOTEMPLATES);
             require IPS_ROOT_PATH . $path . '/extensions/furlTemplates.php';
             if (is_array($_SEOTEMPLATES)) {
                 foreach ($_SEOTEMPLATES as $key => $data) {
                     self::$_furlTemplates[$key] = $data;
                 }
             }
         }
     }
     /* Return for anyone else */
     return self::$_furlTemplates;
 }
開發者ID:dalandis,項目名稱:Visualization-of-Cell-Phone-Locations,代碼行數:52,代碼來源:core.php

示例2: buildFurlTemplates

 /**
  * Build furl templates from FURL extensions
  *
  * @return  array
  */
 public static function buildFurlTemplates()
 {
     /* INIT */
     $apps = array();
     $_SEOTEMPLATES = array();
     static $_apps = array();
     /* Done this already? */
     if (self::$_furlTemplates) {
         return self::$_furlTemplates;
     }
     /**
      * Get app data and cache - 1 query is better than 1 per app
      */
     ipsRegistry::DB()->build(array('select' => 'app_directory, app_public_title, app_enabled', 'from' => 'core_applications'));
     ipsRegistry::DB()->execute();
     while ($_r = ipsRegistry::DB()->fetch()) {
         $_apps[$_r['app_directory']] = $_r;
     }
     /* Because this is called before the cache is unpacked, we need to expensively grab all app dirs */
     foreach (array('applications', 'applications_addon/ips', 'applications_addon/other') as $folder) {
         try {
             foreach (new DirectoryIterator(IPS_ROOT_PATH . $folder) as $file) {
                 if (!$file->isDot() and $file->isDir()) {
                     $_name = $file->getFileName();
                     if (substr($_name, 0, 1) != '.') {
                         /* Check if this app is enabled before including the templates.. */
                         $_check = isset($_apps[$_name]) ? $_apps[$_name] : array('app_public_title' => '', 'app_enabled' => 0);
                         if ($_check['app_public_title'] && $_check['app_enabled']) {
                             $apps[$folder . '/' . $_name] = $_name;
                         }
                     }
                 }
             }
         } catch (Exception $e) {
         }
     }
     /* First, add in core stuffs */
     ipsRegistry::_loadCoreVariables();
     $templates = ipsRegistry::_fetchCoreVariables('templates');
     if (is_array($templates)) {
         foreach ($templates as $key => $data) {
             self::$_furlTemplates[$key] = $data;
         }
     }
     /* Loop over the applications and build */
     foreach ($apps as $path => $app_dir) {
         if (is_file(IPS_ROOT_PATH . $path . '/extensions/furlTemplates.php')) {
             $_SEOTEMPLATES = array();
             require IPS_ROOT_PATH . $path . '/extensions/furlTemplates.php';
             /*noLibHook*/
             if (is_array($_SEOTEMPLATES) && count($_SEOTEMPLATES)) {
                 foreach ($_SEOTEMPLATES as $key => $data) {
                     self::$_furlTemplates[$key] = $data;
                 }
             }
         }
     }
     /* Return for anyone else */
     return self::$_furlTemplates;
 }
開發者ID:ConnorChristie,項目名稱:GrabViews,代碼行數:65,代碼來源:core.php


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