本文整理汇总了PHP中sfApplicationConfiguration::coreLoaded方法的典型用法代码示例。如果您正苦于以下问题:PHP sfApplicationConfiguration::coreLoaded方法的具体用法?PHP sfApplicationConfiguration::coreLoaded怎么用?PHP sfApplicationConfiguration::coreLoaded使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sfApplicationConfiguration
的用法示例。
在下文中一共展示了sfApplicationConfiguration::coreLoaded方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initConfiguration
/**
* @see sfProjectConfiguration
*/
public function initConfiguration()
{
// in debug mode, start global timer
if ($this->isDebug() && !sfConfig::get('sf_timer_start')) {
sfConfig::set('sf_timer_start', microtime(true));
}
$configCache = $this->getConfigCache();
// required core classes for the framework
if (!sfConfig::get('sf_debug') && !sfConfig::get('sf_test') && !self::$coreLoaded) {
$configCache->import('config/core_compile.yml', false);
self::$coreLoaded = true;
}
sfAutoload::getInstance()->register();
// load base settings
include $configCache->checkConfig('config/settings.yml');
if ($file = $configCache->checkConfig('config/app.yml', true)) {
include $file;
}
if (false !== sfConfig::get('sf_csrf_secret')) {
sfForm::enableCSRFProtection(sfConfig::get('sf_csrf_secret'));
}
// force setting default timezone if not set
if ($default_timezone = sfConfig::get('sf_default_timezone')) {
date_default_timezone_set($default_timezone);
} else {
if (sfConfig::get('sf_force_default_timezone', true)) {
date_default_timezone_set(@date_default_timezone_get());
}
}
// error settings
ini_set('display_errors', $this->isDebug() ? 'on' : 'off');
error_reporting(sfConfig::get('sf_error_reporting'));
// include all config.php from plugins
$this->loadPluginConfig();
// Disabled by default in symfony 1.1 because it causes problems with Doctrine.
// If you want to enable it in your application, just copy the spl_autoload_register() line
// in your configuration class.
if (0 && $this->isDebug()) {
spl_autoload_register(array(sfAutoload::getInstance(), 'autoloadAgain'));
}
// compress output
ob_start(sfConfig::get('sf_compressed') ? 'ob_gzhandler' : '');
}
示例2: initConfiguration
/**
* Various initializations.
*/
public function initConfiguration()
{
$configCache = $this->getConfigCache();
// in debug mode, start global timer
if ($this->isDebug() && !sfConfig::get('sf_cli') && !sfWebDebugPanelTimer::isStarted()) {
sfWebDebugPanelTimer::startTime();
}
// required core classes for the framework
if (!$this->isDebug() && !sfConfig::get('sf_test') && !sfConfig::get('sf_cli') && !self::$coreLoaded) {
$configCache->import('config/core_compile.yml', false);
}
// autoloader(s)
$this->dispatcher->connect('autoload.filter_config', array($this, 'filterAutoloadConfig'));
sfAutoload::getInstance()->register();
if ($this->isDebug()) {
sfAutoloadAgain::getInstance()->register();
}
// load base settings
include $configCache->checkConfig('config/settings.yml');
if ($file = $configCache->checkConfig('config/app.yml', true)) {
include $file;
}
if (!sfConfig::get('sf_cli') && false !== sfConfig::get('sf_csrf_secret')) {
sfForm::enableCSRFProtection(sfConfig::get('sf_csrf_secret'));
}
sfWidget::setCharset(sfConfig::get('sf_charset'));
sfValidatorBase::setCharset(sfConfig::get('sf_charset'));
// force setting default timezone if not set
if ($default_timezone = sfConfig::get('sf_default_timezone')) {
date_default_timezone_set($default_timezone);
} else {
if (sfConfig::get('sf_force_default_timezone', true)) {
date_default_timezone_set(@date_default_timezone_get());
}
}
// error settings
ini_set('display_errors', $this->isDebug() ? 'on' : 'off');
error_reporting(sfConfig::get('sf_error_reporting'));
// initialize plugin configuration objects
$this->initializePlugins();
// compress output
if (!self::$coreLoaded && sfConfig::get('sf_compressed')) {
ob_start('ob_gzhandler');
}
self::$coreLoaded = true;
}
示例3: initConfiguration
/**
* @see sfProjectConfiguration
*/
public function initConfiguration()
{
$configCache = $this->getConfigCache();
// in debug mode, start global timer
if ($this->isDebug() && !sfWebDebugPanelTimer::isStarted()) {
sfWebDebugPanelTimer::startTime();
}
// required core classes for the framework
if (!sfConfig::get('sf_debug') && !sfConfig::get('sf_test') && !self::$coreLoaded) {
$configCache->import('config/core_compile.yml', false);
}
$this->dispatcher->connect('autoload.filter_config', array($this, 'filterAutoloadConfig'));
sfAutoload::getInstance()->register();
// load base settings
include $configCache->checkConfig('config/settings.yml');
if ($file = $configCache->checkConfig('config/app.yml', true)) {
include $file;
}
if (false !== sfConfig::get('sf_csrf_secret')) {
sfForm::enableCSRFProtection(sfConfig::get('sf_csrf_secret'));
}
sfWidget::setCharset(sfConfig::get('sf_charset'));
sfValidatorBase::setCharset(sfConfig::get('sf_charset'));
// force setting default timezone if not set
if ($default_timezone = sfConfig::get('sf_default_timezone')) {
date_default_timezone_set($default_timezone);
} else {
if (sfConfig::get('sf_force_default_timezone', true)) {
date_default_timezone_set(@date_default_timezone_get());
}
}
// error settings
ini_set('display_errors', $this->isDebug() ? 'on' : 'off');
error_reporting(sfConfig::get('sf_error_reporting'));
// initialize plugin configuration objects
$this->initializePlugins();
// Disabled by default in symfony 1.1 because it causes problems with Doctrine.
// If you want to enable it in your application, just copy the spl_autoload_register() line
// in your configuration class.
if (0 && $this->isDebug()) {
spl_autoload_register(array(sfAutoload::getInstance(), 'autoloadAgain'));
}
// compress output
if (!self::$coreLoaded) {
if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION < 4) {
ob_start(sfConfig::get('sf_compressed') ? 'ob_gzhandler' : '');
}
}
self::$coreLoaded = true;
}