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


PHP AgaviConfig::isReadonly方法代码示例

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


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

 /**
  * Startup the Agavi core
  *
  * @param      string environment the environment to use for this session.
  *
  * @author     Felix Gilcher <felix.gilcher@exozet.com>
  * @since      1.0.0
  */
 public static function bootstrap($environment = null)
 {
     if ($environment === null) {
         // no env given? let's read one from testing.environment
         $environment = AgaviConfig::get('testing.environment');
     } elseif (AgaviConfig::has('testing.environment') && AgaviConfig::isReadonly('testing.environment')) {
         // env given, but testing.environment is read-only? then we must use that instead and ignore the given setting
         $environment = AgaviConfig::get('testing.environment');
     }
     if ($environment === null) {
         // still no env? oh man...
         throw new Exception('You must supply an environment name to AgaviTesting::bootstrap() or set the name of the default environment to be used for testing in the configuration directive "testing.environment".');
     }
     // finally set the env to what we're really using now.
     AgaviConfig::set('testing.environment', $environment, true, true);
     // bootstrap the framework for autoload, config handlers etc.
     Agavi::bootstrap($environment);
     ini_set('include_path', get_include_path() . PATH_SEPARATOR . dirname(dirname(__FILE__)));
     $GLOBALS['AGAVI_CONFIG'] = AgaviConfig::toArray();
 }
开发者ID:philippjenni,项目名称:icinga-web,代码行数:28,代码来源:AgaviTesting.class.php

示例3: testIsReadonly

 public function testIsReadonly()
 {
     AgaviConfig::set('WORM', 'yay', true, true);
     AgaviConfig::set('WMRM', 'yay');
     $this->assertTrue(AgaviConfig::isReadonly('WORM'));
     $this->assertFalse(AgaviConfig::isReadonly('WMRM'));
 }
开发者ID:horros,项目名称:agavi,代码行数:7,代码来源:AgaviConfigTest.php


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