Last active
June 4, 2018 17:36
-
-
Save alcohol/ec4bac4495ef586d635a37a95f33932f to your computer and use it in GitHub Desktop.
reproduce symfony/symfony#27493
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php declare(strict_types=1); | |
use Symfony\Component\Config\Loader\LoaderInterface; | |
use Symfony\Component\HttpKernel\Kernel; | |
class AppKernel extends Kernel | |
{ | |
public function registerBundles() | |
{ | |
$bundles = [ | |
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), | |
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(), | |
]; | |
if (in_array($this->getEnvironment(), ['dev', 'test'], true)) { | |
$bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle(); | |
} | |
return $bundles; | |
} | |
public function registerContainerConfiguration(LoaderInterface $loader) | |
{ | |
$loader->load($this->getRootDir() . '/config.yml'); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
parameters: | |
secret: 'not-so-secret' | |
framework: | |
#esi: ~ | |
secret: '%secret%' | |
trusted_hosts: ~ | |
fragments: ~ | |
http_method_override: true | |
php_errors: | |
log: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env php | |
<?php | |
use Symfony\Bundle\FrameworkBundle\Console\Application; | |
use Symfony\Component\Console\Input\ArgvInput; | |
use Symfony\Component\Debug\Debug; | |
// if you don't want to setup permissions the proper way, just uncomment the following PHP line | |
// read https://symfony.com/doc/current/setup.html#checking-symfony-application-configuration-and-setup | |
// for more information | |
//umask(0000); | |
set_time_limit(0); | |
require __DIR__.'/../vendor/autoload.php'; | |
$input = new ArgvInput(); | |
$env = $input->getParameterOption(['--env', '-e'], getenv('SYMFONY_ENV') ?: 'dev'); | |
$debug = getenv('SYMFONY_DEBUG') !== '0' && !$input->hasParameterOption(['--no-debug', '']) && $env !== 'prod'; | |
if ($debug) { | |
Debug::enable(); | |
} | |
$kernel = new AppKernel($env, $debug); | |
$application = new Application($kernel); | |
$application->run($input); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"autoload": { | |
"classmap": [ | |
"app/AppKernel.php" | |
] | |
}, | |
"require": { | |
"symfony/yaml": "^4.0", | |
"sensio/distribution-bundle": "^5.0", | |
"sensio/framework-extra-bundle": "^5.1" | |
}, | |
"require-dev": { | |
"symfony/debug-bundle": "^4.0" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment