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


PHP Mage_Core_Model_App::useCache方法代码示例

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


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

示例1: build

 /**
  * @return Configuration
  */
 public function build()
 {
     $servicesFormat = 'xml';
     $cachedContainer = $this->_baseDir . '/' . self::CACHED_CONTAINER;
     $configuration = Configuration::fromParameters($cachedContainer, $this->_collectConfigFolders(), !$this->_mageApp->useCache(self::MODEL_ALIAS), $servicesFormat);
     $configuration->setTestEnvironment($this->_isTestEnvironment());
     return $configuration;
 }
开发者ID:inviqa,项目名称:magento-symfony-container,代码行数:11,代码来源:ConfigurationBuilder.php

示例2: crawl

 /**
  * Crawl all system urls
  *
  * @return Enterprise_PageCache_Model_Crawler
  */
 public function crawl()
 {
     if (!$this->_app->useCache('full_page')) {
         return $this;
     }
     $adapter = $this->_adapterFactory->getHttpCurlAdapter();
     foreach ($this->getStoresInfo() as $storeInfo) {
         if (!$this->_isCrawlerEnabled($storeInfo['store_id'])) {
             continue;
         }
         $this->_executeRequests($storeInfo, $adapter);
     }
     return $this;
 }
开发者ID:hientruong90,项目名称:ee_14_installer,代码行数:19,代码来源:Crawler.php

示例3: __construct

 /**
  * Load config from merged adminhtml.xml files
  * @param array $arguments
  */
 public function __construct(array $arguments = array())
 {
     $this->_app = isset($arguments['app']) ? $arguments['app'] : Mage::app();
     $this->_appConfig = isset($arguments['appConfig']) ? $arguments['appConfig'] : Mage::getConfig();
     if (isset($arguments['helpers'])) {
         $this->_helpers = $arguments['helpers'];
     }
     parent::__construct();
     $this->setCacheId('adminhtml_acl_menu_config');
     /* @var $adminhtmlConfig Varien_Simplexml_Config */
     $adminhtmlConfig = $this->_app->loadCache($this->getCacheId());
     if ($adminhtmlConfig) {
         $this->_adminhtmlConfig = new Varien_Simplexml_Config($adminhtmlConfig);
     } else {
         $adminhtmlConfig = new Varien_Simplexml_Config();
         $adminhtmlConfig->loadString('<?xml version="1.0"?><config></config>');
         $this->_appConfig->loadModulesConfiguration('adminhtml.xml', $adminhtmlConfig);
         $this->_adminhtmlConfig = $adminhtmlConfig;
         if ($this->_app->useCache('config')) {
             $this->_app->saveCache($adminhtmlConfig->getXmlString(), $this->getCacheId(), array(Mage_Core_Model_Config::CACHE_TAG));
         }
     }
 }
开发者ID:nemphys,项目名称:magento2,代码行数:27,代码来源:Config.php

示例4: testUseCache

 public function testUseCache()
 {
     $this->assertTrue($this->_mageModel->useCache('config'));
     $this->assertFalse($this->_mageModel->useCache('not_existing_type'));
 }
开发者ID:nemphys,项目名称:magento2,代码行数:5,代码来源:AppTest.php

示例5: getRegionJsonByStore

 /**
  * Retrieve regions data json
  *
  * @param int|null $storeId
  * @return array()
  */
 public function getRegionJsonByStore($storeId = null)
 {
     Varien_Profiler::start('TEST: ' . __METHOD__);
     if (!$this->_regionJson) {
         $store = $this->_app->getStore($storeId);
         $cacheKey = 'DIRECTORY_REGIONS_JSON_STORE' . (string) $store->getId();
         if ($this->_app->useCache('config')) {
             $json = $this->_app->loadCache($cacheKey);
         }
         if (empty($json)) {
             $regions = $this->_getRegions($storeId);
             $helper = $this->_factory->getHelper('core');
             $json = $helper->jsonEncode($regions);
             if ($this->_app->useCache('config')) {
                 $this->_app->saveCache($json, $cacheKey, array('config'));
             }
         }
         $this->_regionJson = $json;
     }
     Varien_Profiler::stop('TEST: ' . __METHOD__);
     return $this->_regionJson;
 }
开发者ID:monkviper,项目名称:magento-lite,代码行数:28,代码来源:Data.php


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