Created
May 19, 2017 08:16
-
-
Save max3uc3/b8e02d34d292b28d225002dff39bdcad to your computer and use it in GitHub Desktop.
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 | |
use Symfony\Component\HttpKernel\Kernel; | |
use Symfony\Component\Config\Loader\LoaderInterface; | |
class AppKernel extends Kernel | |
{ | |
public function registerBundles() | |
{ | |
$bundles = [ | |
new FOS\RestBundle\FOSRestBundle(), | |
new Snc\RedisBundle\SncRedisBundle(), | |
new Lexik\Bundle\JWTAuthenticationBundle\LexikJWTAuthenticationBundle(), | |
new FOS\UserBundle\FOSUserBundle(), | |
new Gos\Bundle\WebSocketBundle\GosWebSocketBundle(), | |
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), | |
new Symfony\Bundle\SecurityBundle\SecurityBundle(), | |
new Symfony\Bundle\TwigBundle\TwigBundle(), | |
new Symfony\Bundle\MonologBundle\MonologBundle(), | |
new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(), | |
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(), | |
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(), | |
new Taxi\TaxiBundle\AppBundle(), | |
new Nelmio\CorsBundle\NelmioCorsBundle(), | |
]; | |
if (in_array($this->getEnvironment(), ['dev', 'test'], true)) { | |
$bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle(); | |
$bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle(); | |
$bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle(); | |
$bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle(); | |
} | |
return $bundles; | |
} | |
public function getRootDir() | |
{ | |
return __DIR__; | |
} | |
public function getCacheDir() | |
{ | |
if(in_array($this->getEnvironment(), ['test', 'dev']) === true){ | |
return '/dev/shm/app/cache/'.$this->getEnvironment(); | |
} | |
return dirname(__DIR__).'/var/cache/'.$this->getEnvironment(); | |
} | |
public function getLogDir() | |
{ | |
if(in_array($this->getEnvironment(), ['test', 'dev']) === true){ | |
return '/dev/shm/app/logs/'.$this->getEnvironment(); | |
} | |
return dirname(__DIR__).'/var/logs'; | |
} | |
public function registerContainerConfiguration(LoaderInterface $loader) | |
{ | |
$loader->load($this->getRootDir().'/config/config_'.$this->getEnvironment().'.yml'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment