Symfony2预定义参数

Oki*_*kiu 11 configuration symfony

我在Symfony2配置文件中找到了一些预定义的参数,即.%kernel.root_dir%,%kernel.debug%.

  • 这些地方有完整的清单吗?

sef*_*rov 16

他们在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()
    );
}
Run Code Online (Sandbox Code Playgroud)