當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。