Ray Kootstra Ray Kootstra - 1 year ago
516 0

Script to check environment by kernel / container.

PHP

Symfony2 check environment by container

$kernel = $this->container->get('kernel');
// if dev environment
if (in_array($kernel->getEnvironment(), ['dev'])) {
    // Do something
}
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download