Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Symfony2 predefined parameters

I find some predefined parameters in Symfony2 configuration files, ie. %kernel.root_dir%, %kernel.debug%.

  • Is there a comprehensive list of these somewhere?
like image 526
Okiu Avatar asked Oct 12 '13 12:10

Okiu


1 Answers

They're under Symfony\Component\HttpKernel\Kernel.php;

/**
 * Returns the kernel parameters.
 *
 * @return array An array of kernel parameters
 */
protected function getKernelParameters()
{
    $bundles = array();
    foreach ($this->bundles as $name => $bundle) {
        $bundles[$name] = get_class($bundle);
    }

    return array_merge(
        array(
            'kernel.root_dir'        => $this->rootDir,
            'kernel.environment'     => $this->environment,
            'kernel.debug'           => $this->debug,
            'kernel.name'            => $this->name,
            'kernel.cache_dir'       => $this->getCacheDir(),
            'kernel.logs_dir'        => $this->getLogDir(),
            'kernel.bundles'         => $bundles,
            'kernel.charset'         => $this->getCharset(),
            'kernel.container_class' => $this->getContainerClass(),
        ),
        $this->getEnvParameters()
    );
}
like image 106
seferov Avatar answered Jan 13 '23 14:01

seferov