public function createKernel($kernelName, $environment = 'dev')
    {
        if (!class_exists($kernelName)) {
            $appDir = $this->projectRoot . DIRECTORY_SEPARATOR . $this->appDir;
            $kernelFile = $appDir . DIRECTORY_SEPARATOR . $kernelName . '.php';
            if (!file_exists($kernelFile)) {
                throw new \InvalidArgumentException(sprintf('Kernel %s not found in %s', $kernelName, $appDir));
            }

            require $kernelFile;

            if (!class_exists($kernelName)) {
                throw new \RuntimeException(sprintf('Kernel %s not found in file %s', $kernelName, $kernelFile));
            }
        }

        $kernel = new $kernelName($environment, false);

        return $kernel;
    }
public function createKernel($kernelName, $environment = 'dev')
    {
        if (!class_exists($kernelName)) {
            $appDir = $this->projectRoot . DIRECTORY_SEPARATOR . $this->appDir;
            $kernelFile = $appDir . DIRECTORY_SEPARATOR . $kernelName . '.php';
            if (!file_exists($kernelFile)) {
                throw new \InvalidArgumentException(sprintf('Kernel %s not found in %s', $kernelName, $appDir));
            }

            require $kernelFile;

            if (!class_exists($kernelName)) {
                throw new \RuntimeException(sprintf('Kernel %s not found in file %s', $kernelName, $kernelFile));
            }
        }

        $kernel = new $kernelName($environment, false);

        return $kernel;
    }
public function createKernel ( $ kernelName , $ environment = 'dev' ) { if ( ! class_exists ( $ kernelName ) ) { $ appDir = $ this -> projectRoot . DIRECTORY_SEPARATOR . $ this -> appDir ; $ kernelFile = $ appDir . DIRECTORY_SEPARATOR . $ kernelName . '.php' ; if ( ! file_exists ( $ kernelFile ) ) { throw new \ InvalidArgumentException ( sprintf ( 'Kernel %s not found in %s' , $ kernelName , $ appDir ) ) ; } require $ kernelFile ; if ( ! class_exists ( $ kernelName ) ) { throw new \ RuntimeException ( sprintf ( 'Kernel %s not found in file %s' , $ kernelName , $ kernelFile ) ) ; } } $ kernel = new $ kernelName ( $ environment , false ) ; return $ kernel ; }
Creates a given kernel

@param  string                               $kernelName
@param  string                               $environment
@throws \InvalidArgumentException
@throws \RuntimeException
@return \Symfony\Component\HttpKernel\Kernel
Creates a given kernel