Skip to content

Instantly share code, notes, and snippets.

@alcohol
Last active June 4, 2018 17:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alcohol/ec4bac4495ef586d635a37a95f33932f to your computer and use it in GitHub Desktop.
Save alcohol/ec4bac4495ef586d635a37a95f33932f to your computer and use it in GitHub Desktop.
<?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');
}
}
parameters:
secret: 'not-so-secret'
framework:
#esi: ~
secret: '%secret%'
trusted_hosts: ~
fragments: ~
http_method_override: true
php_errors:
log: true
#!/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);
{
"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