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


PHP Kernel::__construct方法代码示例

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


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

示例1: __construct

 public function __construct($environment, $debug)
 {
     // Two is better than one...
     //ini_set("date.timezone", "UTC");
     date_default_timezone_set('UTC');
     parent::__construct($environment, $debug);
 }
开发者ID:julianstricker,项目名称:xxam,代码行数:7,代码来源:AppKernel.php

示例2: __construct

 /**
  * @param \sfApplicationConfiguration $configuration
  */
 public function __construct(\sfApplicationConfiguration $configuration)
 {
     $environment = \sfConfig::get('sf_environment');
     $debug = in_array($environment, array('dev', 'ontw', 'test'));
     parent::__construct($environment, $debug);
     $this->configuration = $configuration;
 }
开发者ID:eddypouw,项目名称:hnDependencyInjectionPlugin,代码行数:10,代码来源:Symfony1Kernel.php

示例3: __construct

 public function __construct($environment, $debug)
 {
     if (!ini_get('date.timezone') || !date_default_timezone_get()) {
         $timezone = "Europe/Berlin";
         if (is_link('/etc/localtime')) {
             // Mac OS X (and older Linuxes)
             // /etc/localtime is a symlink to the
             // timezone in /usr/share/zoneinfo.
             $filename = readlink('/etc/localtime');
             if (strpos($filename, '/usr/share/zoneinfo/') === 0) {
                 $timezone = substr($filename, 20);
             }
         } elseif (file_exists('/etc/timezone')) {
             // Ubuntu / Debian.
             $data = file_get_contents('/etc/timezone');
             if ($data) {
                 $timezone = $data;
             }
         } elseif (file_exists('/etc/sysconfig/clock')) {
             // RHEL / CentOS
             $data = parse_ini_file('/etc/sysconfig/clock');
             if (!empty($data['ZONE'])) {
                 $timezone = $data['ZONE'];
             }
         }
         $timezone = preg_replace("/[\\n\\r]+/", "", $timezone);
         date_default_timezone_set($timezone);
     }
     parent::__construct($environment, $debug);
 }
开发者ID:slashworks,项目名称:control,代码行数:30,代码来源:AppKernel.php

示例4: __construct

 public function __construct($environment, $debug)
 {
     parent::__construct($environment, $debug);
     if (in_array($environment, array('dev', 'test'))) {
         date_default_timezone_set('Europe/Copenhagen');
     }
 }
开发者ID:armandomeeuwenoord,项目名称:icup,代码行数:7,代码来源:AppKernel.php

示例5: __construct

 public function __construct(array $configuration, array $enabledBundles, $uniqueIdentifier, $cacheDir, $logsDir)
 {
     parent::__construct('test' . $uniqueIdentifier, true);
     $this->configuration = $configuration;
     $this->enabledBundles = $enabledBundles;
     $this->cacheDir = $cacheDir;
     $this->logsDir = $logsDir;
 }
开发者ID:Spomky,项目名称:symfony-bundle-plugins,代码行数:8,代码来源:AppKernel.php

示例6: __construct

 /**
  * {@inheritDoc}
  *
  * @param string $environment The environment
  * @param bool   $debug       Whether to enable debugging or not
  *
  * @return AppKernel
  */
 public function __construct($environment, $debug)
 {
     $configuredTimeZone = ini_get('date.timezone');
     if (empty($configuredTimeZone)) {
         date_default_timezone_set('UTC');
     }
     parent::__construct($environment, $debug);
 }
开发者ID:alebon,项目名称:graviton,代码行数:16,代码来源:AppKernel.php

示例7: __construct

 /**
  * {@inheritdoc}
  */
 public function __construct($environment, $debug, $projectDir = null)
 {
     if (null !== $projectDir) {
         $this->projectDir = $projectDir;
         $this->rootDir = $projectDir . '/app';
     }
     parent::__construct($environment, $debug);
 }
开发者ID:georgjaehnig,项目名称:sculpin,代码行数:11,代码来源:AbstractKernel.php

示例8: __construct

 public function __construct($environment, $debug)
 {
     parent::__construct($environment, $debug);
     if ($debug) {
         Debug::enable();
     }
     $this->initPropel();
 }
开发者ID:puterakahfi,项目名称:thelia,代码行数:8,代码来源:Thelia.php

示例9: __construct

 public function __construct($environment, $debug)
 {
     parent::__construct($environment, $debug);
     $this->dumplieKernel = new DumplieKernel();
     foreach ($this->registerDumplieExtensions() as $extension) {
         $this->dumplieKernel->register($extension);
     }
 }
开发者ID:dumplie,项目名称:dumplie,代码行数:8,代码来源:Kernel.php

示例10: __construct

 public function __construct($testCase, $environment, $debug)
 {
     if (!is_dir(__DIR__ . '/' . $testCase)) {
         throw new \InvalidArgumentException(sprintf('The test case "%s" does not exist.', $testCase));
     }
     $this->testCase = $testCase;
     parent::__construct($environment, $debug);
 }
开发者ID:rfc1483,项目名称:blog,代码行数:8,代码来源:AppKernel.php

示例11: __construct

 /**
  * Create new application
  *
  * @param string  environment The environment
  * @param boolean debug Whether to enable debugging or not
  * @param array config Optional config settings.
  */
 public function __construct($environment = 'prod', $debug = false, $context = null)
 {
     $this->context = $context;
     // @todo FIXME: Only save it the first time. this gets called again via ConfigCache
     if (null === Runtime::getContext()) {
         Runtime::setContext($context);
     }
     parent::__construct($environment, $debug);
 }
开发者ID:zenmagick,项目名称:zenmagick,代码行数:16,代码来源:AppKernel.php

示例12: __construct

 /**
  * {@inheritdoc}
  */
 public function __construct($environment, $debug)
 {
     if ('Knp\\Bundle\\RadBundle\\HttpKernel\\RadKernel' === get_class($this)) {
         throw new \RuntimeException("You can not use Knp\\Bundle\\RadBundle\\HttpKernel\\RadKernel as your application kernel.\n" . "Call RadKernel::createAppKernel(\$loader, '{$environment}', {$debug}) to create specific application kernel.");
     }
     parent::__construct($environment, $debug);
     $this->configuration = $this->initConfiguration();
     $this->configuration->load();
 }
开发者ID:ruian,项目名称:KnpRadBundle,代码行数:12,代码来源:RadKernel.php

示例13: __construct

 /**
  * @param string $rootConfig
  * @param bool   $environment
  * @param        $debug
  */
 public function __construct($rootConfig, $environment, $debug)
 {
     $fs = new Filesystem();
     if (!$fs->isAbsolutePath($rootConfig) && !is_file($rootConfig = __DIR__ . '/' . $rootConfig)) {
         throw new \InvalidArgumentException(sprintf('The root config "%s" does not exist.', $rootConfig));
     }
     $this->rootConfig = $rootConfig;
     parent::__construct($environment, $debug);
 }
开发者ID:ibrows,项目名称:rest-bundle,代码行数:14,代码来源:AppKernel.php

示例14: __construct

 public function __construct($environment, $debug)
 {
     if (!static::$runned) {
         $fileSystem = new Symfony\Component\Filesystem\Filesystem();
         $fileSystem->remove($this->getCacheDir());
         $fileSystem->remove($this->getLogDir());
         static::$runned = true;
     }
     parent::__construct($environment, $debug);
 }
开发者ID:mpoiriert,项目名称:nucleus-bundle,代码行数:10,代码来源:AppKernel.php

示例15: __construct

 public function __construct($env, $debug)
 {
     parent::__construct($env, $debug);
     // this is all to be deprecated (todo drak)
     $paths = array($this->rootDir . '/../config/config.php', $this->rootDir . '/../config/personal_config.php', $this->rootDir . '/../config/multisites_config.php');
     foreach ($paths as $path) {
         if (is_readable($path)) {
             include $path;
         }
     }
 }
开发者ID:rmaiwald,项目名称:core,代码行数:11,代码来源:ZikulaKernel.php


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