本文整理汇总了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);
}
示例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;
}
示例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);
}
示例4: __construct
public function __construct($environment, $debug)
{
parent::__construct($environment, $debug);
if (in_array($environment, array('dev', 'test'))) {
date_default_timezone_set('Europe/Copenhagen');
}
}
示例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;
}
示例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);
}
示例7: __construct
/**
* {@inheritdoc}
*/
public function __construct($environment, $debug, $projectDir = null)
{
if (null !== $projectDir) {
$this->projectDir = $projectDir;
$this->rootDir = $projectDir . '/app';
}
parent::__construct($environment, $debug);
}
示例8: __construct
public function __construct($environment, $debug)
{
parent::__construct($environment, $debug);
if ($debug) {
Debug::enable();
}
$this->initPropel();
}
示例9: __construct
public function __construct($environment, $debug)
{
parent::__construct($environment, $debug);
$this->dumplieKernel = new DumplieKernel();
foreach ($this->registerDumplieExtensions() as $extension) {
$this->dumplieKernel->register($extension);
}
}
示例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);
}
示例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);
}
示例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();
}
示例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);
}
示例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);
}
示例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;
}
}
}