Created
March 24, 2017 19:57
-
-
Save kabdessamad1/8345c938de56728471be44e8380507eb to your computer and use it in GitHub Desktop.
This file contains 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 | |
use Symfony\Component\Config\Loader\LoaderInterface; | |
use Symfony\Component\DependencyInjection\ContainerBuilder; | |
use Symfony\Component\HttpKernel\Kernel; | |
class AppKernel extends Kernel | |
{ | |
public function registerBundles() | |
{ | |
$bundles = [ | |
new \Symfony\Bundle\FrameworkBundle\FrameworkBundle(), | |
new \Symfony\Bundle\TwigBundle\TwigBundle(), | |
new \Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(), | |
new AppBundle\AppBundle(), | |
]; | |
if($this->getEnvironment() == 'dev') { | |
$bundles[] = new \Symfony\Bundle\WebProfilerBundle\WebProfilerBundle(); | |
} | |
return $bundles; | |
} | |
public function registerContainerConfiguration(LoaderInterface $loader) | |
{ | |
$loader->load(__DIR__.'/config/config.yml'); | |
$isDevEnv = $this->getEnvironment() == 'dev'; | |
$loader->load(function (ContainerBuilder $container) use($isDevEnv) { | |
if($isDevEnv) { | |
$container->loadFromExtension('web_profiler', [ | |
'toolbar' => true, | |
]); | |
} | |
if ($isDevEnv) { | |
$container->loadFromExtension('framework', array( | |
'router' => array( | |
'resource' => '%kernel.root_dir%/config/routing_dev.yml', | |
) | |
)); | |
} | |
}); | |
} | |
} |
This file contains 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
framework: | |
secret: AJSZDLW)992372 | |
router: | |
resource: '%kernel.root_dir%/config/routing.yml' | |
templating: | |
engines: [twig] | |
profiler: | |
enabled: "%kernel.debug%" |
This file contains 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 | |
use Symfony\Component\HttpFoundation\Request; | |
use Symfony\Component\Debug\Debug; | |
umask(0000); | |
$loader = require_once __DIR__.'/../config/autoload.php'; | |
$dotenv = new \Dotenv\Dotenv(__DIR__.'/../'); | |
$dotenv->load(); | |
$env = $_SERVER['SYMFONY_ENV']; | |
$debug = $_SERVER['SYMFONY_DEBUG']; | |
if ($debug) { | |
Debug::enable(); | |
} | |
require_once __DIR__.'/../AppKernel.php'; | |
$kernel = new AppKernel($env, $debug); | |
$request = Request::createFromGlobals(); | |
$response = $kernel->handle($request); | |
$response->send(); | |
$kernel->terminate($request, $response); |
This file contains 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
app_annotations: | |
resource: '@AppBundle/Controller' | |
type: annotation |
This file contains 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
_wdt: | |
resource: '@WebProfilerBundle/Resources/config/routing/wdt.xml' | |
prefix: /_wdt | |
_profiler: | |
resource: '@WebProfilerBundle/Resources/config/routing/profiler.xml' | |
prefix: /_profiler | |
_main: | |
resource: routing.yml |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment