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


PHP XenForo_Application::setDefaultsFromOptions方法代码示例

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


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

示例1: preLoadData

 /**
  * Pre-loads globally required data for the system.
  */
 public function preLoadData()
 {
     $required = array_merge(array('options', 'languages', 'contentTypes', 'codeEventListeners', 'cron', 'simpleCache'), $this->_dataPreLoadFromRegistry);
     $data = XenForo_Model::create('XenForo_Model_DataRegistry')->getMulti($required);
     if (XenForo_Application::get('config')->enableListeners) {
         if (!is_array($data['codeEventListeners'])) {
             $data['codeEventListeners'] = XenForo_Model::create('XenForo_Model_CodeEvent')->rebuildEventListenerCache();
         }
         XenForo_CodeEvent::setListeners($data['codeEventListeners']);
     }
     if (!is_array($data['options'])) {
         $data['options'] = XenForo_Model::create('XenForo_Model_Option')->rebuildOptionCache();
     }
     $options = new XenForo_Options($data['options']);
     XenForo_Application::setDefaultsFromOptions($options);
     XenForo_Application::set('options', $options);
     if (!is_array($data['languages'])) {
         $data['languages'] = XenForo_Model::create('XenForo_Model_Language')->rebuildLanguageCache();
     }
     XenForo_Application::set('languages', $data['languages']);
     if (!is_array($data['contentTypes'])) {
         $data['contentTypes'] = XenForo_Model::create('XenForo_Model_ContentType')->rebuildContentTypeCache();
     }
     XenForo_Application::set('contentTypes', $data['contentTypes']);
     if (!is_int($data['cron'])) {
         $data['cron'] = XenForo_Model::create('XenForo_Model_Cron')->updateMinimumNextRunTime();
     }
     XenForo_Application::set('cron', $data['cron']);
     if (!is_array($data['simpleCache'])) {
         $data['simpleCache'] = array();
         XenForo_Model::create('XenForo_Model_DataRegistry')->set('simpleCache', $data['simpleCache']);
     }
     XenForo_Application::set('simpleCache', $data['simpleCache']);
     $this->_handleCustomPreloadedData($data);
     XenForo_CodeEvent::fire('init_dependencies', array($this, $data));
 }
开发者ID:hahuunguyen,项目名称:DTUI_201105,代码行数:39,代码来源:Abstract.php

示例2: preLoadData

 /**
  * Pre-loads globally required data for the system.
  */
 public function preLoadData()
 {
     $required = array_merge(array('options', 'languages', 'contentTypes', 'codeEventListeners', 'deferredRun', 'simpleCache', 'addOns', 'defaultStyleProperties', 'routeFiltersIn', 'routeFiltersOut'), $this->_dataPreLoadFromRegistry);
     $dr = new XenForo_Model_DataRegistry();
     // this is a slight hack to prevent the class from being cached
     $data = $dr->getMulti($required);
     if (XenForo_Application::get('config')->enableListeners) {
         if (!is_array($data['codeEventListeners'])) {
             $data['codeEventListeners'] = XenForo_Model::create('XenForo_Model_CodeEvent')->rebuildEventListenerCache();
         }
         XenForo_CodeEvent::setListeners($data['codeEventListeners']);
     }
     if (!is_array($data['options'])) {
         $data['options'] = XenForo_Model::create('XenForo_Model_Option')->rebuildOptionCache();
     }
     $options = new XenForo_Options($data['options']);
     XenForo_Application::setDefaultsFromOptions($options);
     XenForo_Application::set('options', $options);
     if (!is_array($data['languages'])) {
         $data['languages'] = XenForo_Model::create('XenForo_Model_Language')->rebuildLanguageCache();
     }
     XenForo_Application::set('languages', $data['languages']);
     if (!is_array($data['defaultStyleProperties'])) {
         $data['defaultStyleProperties'] = XenForo_Model::create('XenForo_Model_StyleProperty')->rebuildPropertyCacheInStyleAndChildren(0, true);
     }
     XenForo_Application::set('defaultStyleProperties', $data['defaultStyleProperties']);
     if (!is_array($data['contentTypes'])) {
         $data['contentTypes'] = XenForo_Model::create('XenForo_Model_ContentType')->rebuildContentTypeCache();
     }
     XenForo_Application::set('contentTypes', $data['contentTypes']);
     if (!is_int($data['deferredRun'])) {
         $data['deferredRun'] = XenForo_Model::create('XenForo_Model_Deferred')->updateNextDeferredTime();
     }
     XenForo_Application::set('deferredRun', $data['deferredRun']);
     if (!is_array($data['addOns'])) {
         $data['addOns'] = XenForo_Model::create('XenForo_Model_AddOn')->rebuildActiveAddOnCache();
     }
     XenForo_Application::set('addOns', $data['addOns']);
     if (!is_array($data['simpleCache'])) {
         $data['simpleCache'] = array();
         XenForo_Model::create('XenForo_Model_DataRegistry')->set('simpleCache', $data['simpleCache']);
     }
     XenForo_Application::set('simpleCache', $data['simpleCache']);
     if (!is_array($data['routeFiltersIn']) || !is_array($data['routeFiltersOut'])) {
         $filterCache = XenForo_Model::create('XenForo_Model_RouteFilter')->rebuildRouteFilterCache();
         $data['routeFiltersIn'] = $filterCache['in'];
         $data['routeFiltersOut'] = $filterCache['out'];
     }
     XenForo_Application::set('routeFiltersIn', $data['routeFiltersIn']);
     XenForo_Application::set('routeFiltersOut', $data['routeFiltersOut']);
     XenForo_Link::setRouteFiltersOut($data['routeFiltersOut']);
     $this->_handleCustomPreloadedData($data);
     XenForo_CodeEvent::fire('init_dependencies', array($this, $data));
 }
开发者ID:VoDongMy,项目名称:xenforo-laravel5.1,代码行数:57,代码来源:Abstract.php

示例3: _prepareForOutput

 /**
  * Does any preperations necessary for outputting to be done.
  */
 protected function _prepareForOutput()
 {
     $cacheData = XenForo_Model::create('XenForo_Model_DataRegistry')->getMulti(array('styles', 'displayStyles', 'options'));
     if (is_array($cacheData['displayStyles'])) {
         $this->_displayStyles = $cacheData['displayStyles'];
     }
     $styles = $cacheData['styles'];
     if (!is_array($styles)) {
         $styles = XenForo_Model::create('XenForo_Model_Style')->rebuildStyleCache();
     }
     if (!is_array($cacheData['options'])) {
         $cacheData['options'] = XenForo_Model::create('XenForo_Model_Option')->rebuildOptionCache();
     }
     $options = new XenForo_Options($cacheData['options']);
     XenForo_Application::setDefaultsFromOptions($options);
     XenForo_Application::set('options', $options);
     if ($this->_styleId && isset($styles[$this->_styleId])) {
         $style = $styles[$this->_styleId];
     } else {
         $style = reset($styles);
     }
     if ($style) {
         $properties = unserialize($style['properties']);
         $this->_styleId = $style['style_id'];
         $this->_styleModifiedDate = $style['last_modified_date'];
     } else {
         $properties = array();
         $this->_styleId = 0;
     }
     XenForo_Template_Helper_Core::setStyleProperties($properties, false);
     XenForo_Template_Public::setStyleId($this->_styleId);
     XenForo_Template_Abstract::setLanguageId(0);
 }
开发者ID:hahuunguyen,项目名称:DTUI_201105,代码行数:36,代码来源:CssOutput.php


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