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


PHP AgaviToolkit::clearCache方法代码示例

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


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

示例1: bootstrap

 /**
  * Startup the Agavi core
  *
  * @param      string environment the environment to use for this session.
  *
  * @author     David Zülke <dz@bitxtender.com>
  * @since      0.11.0
  */
 public static function bootstrap($environment = null)
 {
     // set up our __autoload
     spl_autoload_register(array('AgaviAutoloader', 'loadClass'));
     try {
         if ($environment === null) {
             // no env given? let's read one from core.environment
             $environment = AgaviConfig::get('core.environment');
         } elseif (AgaviConfig::has('core.environment') && AgaviConfig::isReadonly('core.environment')) {
             // env given, but core.environment is read-only? then we must use that instead and ignore the given setting
             $environment = AgaviConfig::get('core.environment');
         }
         if ($environment === null) {
             // still no env? oh man...
             throw new AgaviException('You must supply an environment name to Agavi::bootstrap() or set the name of the default environment to be used in the configuration directive "core.environment".');
         }
         // finally set the env to what we're really using now.
         AgaviConfig::set('core.environment', $environment, true, true);
         AgaviConfig::set('core.debug', false, false);
         if (!AgaviConfig::has('core.app_dir')) {
             throw new AgaviException('Configuration directive "core.app_dir" not defined, terminating...');
         }
         // define a few filesystem paths
         AgaviConfig::set('core.cache_dir', AgaviConfig::get('core.app_dir') . '/cache', false, true);
         AgaviConfig::set('core.config_dir', AgaviConfig::get('core.app_dir') . '/config', false, true);
         AgaviConfig::set('core.system_config_dir', AgaviConfig::get('core.agavi_dir') . '/config/defaults', false, true);
         AgaviConfig::set('core.lib_dir', AgaviConfig::get('core.app_dir') . '/lib', false, true);
         AgaviConfig::set('core.model_dir', AgaviConfig::get('core.app_dir') . '/models', false, true);
         AgaviConfig::set('core.module_dir', AgaviConfig::get('core.app_dir') . '/modules', false, true);
         AgaviConfig::set('core.template_dir', AgaviConfig::get('core.app_dir') . '/templates', false, true);
         AgaviConfig::set('core.cldr_dir', AgaviConfig::get('core.agavi_dir') . '/translation/data', false, true);
         // autoloads first (will trigger the compilation of config_handlers.xml)
         $autoload = AgaviConfig::get('core.config_dir') . '/autoload.xml';
         if (!is_readable($autoload)) {
             $autoload = AgaviConfig::get('core.system_config_dir') . '/autoload.xml';
         }
         AgaviConfigCache::load($autoload);
         // load base settings
         AgaviConfigCache::load(AgaviConfig::get('core.config_dir') . '/settings.xml');
         // clear our cache if the conditions are right
         if (AgaviConfig::get('core.debug')) {
             AgaviToolkit::clearCache();
             // load base settings
             AgaviConfigCache::load(AgaviConfig::get('core.config_dir') . '/settings.xml');
         }
         $compile = AgaviConfig::get('core.config_dir') . '/compile.xml';
         if (!is_readable($compile)) {
             $compile = AgaviConfig::get('core.system_config_dir') . '/compile.xml';
         }
         // required classes for the framework
         AgaviConfigCache::load($compile);
     } catch (Exception $e) {
         AgaviException::render($e);
     }
 }
开发者ID:horros,项目名称:agavi,代码行数:63,代码来源:Agavi.class.php

示例2: clearCache

 /**
  * Flushes the cache for a group
  *
  * @param      array An array of cache groups
  *
  * @author     David Zülke <dz@bitxtender.com>
  * @since      0.11.0
  */
 public static function clearCache(array $groups = array())
 {
     foreach ($groups as &$group) {
         $group = base64_encode($group);
     }
     $path = self::CACHE_SUBDIR . DIRECTORY_SEPARATOR . implode(DIRECTORY_SEPARATOR, $groups);
     if (is_file(AgaviConfig::get('core.cache_dir') . DIRECTORY_SEPARATOR . $path . '.cefcache')) {
         AgaviToolkit::clearCache($path . '.cefcache');
     } else {
         AgaviToolkit::clearCache($path);
     }
 }
开发者ID:philippjenni,项目名称:icinga-web,代码行数:20,代码来源:AgaviExecutionFilter.class.php

示例3: clearAgaviCache

 private function clearAgaviCache()
 {
     AgaviToolkit::clearCache();
     $this->log('Agavi cache cleared through webinterface', AgaviLogger::INFO);
 }
开发者ID:philippjenni,项目名称:icinga-web,代码行数:5,代码来源:ClearCacheModel.class.php

示例4: main

 public function main()
 {
     parent::main();
     AgaviToolkit::clearCache();
 }
开发者ID:philippjenni,项目名称:icinga-web,代码行数:5,代码来源:agaviClearCache.php

示例5: unset

<?php

$agaviTestSettings = $GLOBALS['AGAVI_TESTING_ISOLATED_TEST_SETTINGS'];
unset($GLOBALS['AGAVI_TESTING_ISOLATED_TEST_SETTINGS']);
if ($agaviTestSettings['bootstrap'] || $agaviTestSettings['clearCache']) {
    require __DIR__ . '/../../testing.php';
}
if ($agaviTestSettings['bootstrap']) {
    // when agavi is not bootstrapped we don't want / need to load the agavi config
    // values from outside the isolation
    AgaviConfig::fromArray($GLOBALS['AGAVI_TESTING_CONFIG']);
}
unset($GLOBALS['AGAVI_TESTING_CONFIG']);
if ($agaviTestSettings['clearCache']) {
    AgaviToolkit::clearCache();
}
$env = null;
if ($agaviTestSettings['environment']) {
    $env = $agaviTestSettings['environment'];
}
if ($agaviTestSettings['bootstrap']) {
    AgaviTesting::bootstrap($env);
}
if ($agaviTestSettings['defaultContext']) {
    AgaviConfig::set('core.default_context', $agaviTestSettings['defaultContext']);
}
if (!defined('AGAVI_TESTING_BOOTSTRAPPED')) {
    // when PHPUnit runs with preserve global state enabled, AGAVI_TESTING_BOOTSTRAPPED will already be defined
    define('AGAVI_TESTING_BOOTSTRAPPED', true);
}
if (AGAVI_TESTING_ORIGINAL_PHPUNIT_BOOTSTRAP) {
开发者ID:horros,项目名称:agavi,代码行数:31,代码来源:IsolatedBootstrap.php

示例6: clear

 /**
  * Clear all configuration cache files.
  *
  * @author     Sean Kerr <skerr@mojavi.org>
  * @since      0.9.0
  */
 public static function clear()
 {
     AgaviToolkit::clearCache(self::CACHE_SUBDIR);
 }
开发者ID:philippjenni,项目名称:icinga-web,代码行数:10,代码来源:AgaviConfigCache.class.php

示例7: handleCustomTestSuite

 /**
  * Custom callback for test suite discovery.
  * This is called by PHPUnit in the setup process, right after all command line 
  * arguments have been parsed.
  *
  * @author     Dominik del Bondio <dominik.del.bondio@bitextender.com>
  * @since      1.1.0
  */
 protected function handleCustomTestSuite()
 {
     // ensure the bootstrap script doesn't run and bootstraps agavi another time
     define('AGAVI_TESTING_BOOTSTRAPPED', true);
     AgaviToolkit::clearCache();
     $this->bootstrap($this->arguments['agaviEnvironment']);
     // use the default configuration only if another configuration was not given as command line argument
     $defaultConfigPath = AgaviConfig::get('core.testing_dir') . '/config/phpunit.xml';
     if (empty($this->arguments['configuration']) && is_file($defaultConfigPath)) {
         $this->arguments['configuration'] = $defaultConfigPath;
     }
     $this->arguments['configuration'] = $this->expandConfiguration($this->arguments['configuration']);
     if (count($this->options[1]) > 0) {
         // positional args were given, so the user specified a test or folder on the command line
         return;
     }
     $suites = (require AgaviConfigCache::checkConfig(AgaviConfig::get('core.testing_dir') . '/config/suites.xml'));
     $masterSuite = new AgaviTestSuite('Master');
     if ($this->arguments['agaviIncludeSuites']) {
         foreach ($this->arguments['agaviIncludeSuites'] as $name) {
             if (empty($suites[$name])) {
                 throw new InvalidArgumentException(sprintf('Invalid suite name %1$s.', $name));
             }
             $masterSuite->addTest(self::createSuite($name, $suites[$name]));
         }
     } else {
         foreach ($suites as $name => $suite) {
             if (!in_array($name, $this->arguments['agaviExcludeSuites'])) {
                 $masterSuite->addTest(self::createSuite($name, $suite));
             }
         }
     }
     $this->arguments['test'] = $masterSuite;
 }
开发者ID:horros,项目名称:agavi,代码行数:42,代码来源:AgaviPhpUnitCli.class.php


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