Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Kernel.php

function Kernel::getKernelParameters

Returns the kernel parameters.

Return value

array<string, array|bool|string|int|float|\UnitEnum|null>

1 call to Kernel::getKernelParameters()
Kernel::getContainerBuilder in vendor/symfony/http-kernel/Kernel.php
Gets a new ContainerBuilder instance used to build the service container.

File

vendor/symfony/http-kernel/Kernel.php, line 558

Class

Kernel
The Kernel is the heart of the Symfony system.

Namespace

Symfony\Component\HttpKernel

Code

protected function getKernelParameters() : array {
    $bundles = [];
    $bundlesMetadata = [];
    foreach ($this->bundles as $name => $bundle) {
        $bundles[$name] = $bundle::class;
        $bundlesMetadata[$name] = [
            'path' => $bundle->getPath(),
            'namespace' => $bundle->getNamespace(),
        ];
    }
    return [
        'kernel.project_dir' => realpath($this->getProjectDir()) ?: $this->getProjectDir(),
        'kernel.environment' => $this->environment,
        'kernel.runtime_environment' => '%env(default:kernel.environment:APP_RUNTIME_ENV)%',
        'kernel.runtime_mode' => '%env(query_string:default:container.runtime_mode:APP_RUNTIME_MODE)%',
        'kernel.runtime_mode.web' => '%env(bool:default::key:web:default:kernel.runtime_mode:)%',
        'kernel.runtime_mode.cli' => '%env(not:default:kernel.runtime_mode.web:)%',
        'kernel.runtime_mode.worker' => '%env(bool:default::key:worker:default:kernel.runtime_mode:)%',
        'kernel.debug' => $this->debug,
        'kernel.build_dir' => realpath($buildDir = $this->warmupDir ?: $this->getBuildDir()) ?: $buildDir,
        'kernel.cache_dir' => realpath($cacheDir = $this->getCacheDir() === $this->getBuildDir() ? $this->warmupDir ?: $this->getCacheDir() : $this->getCacheDir()) ?: $cacheDir,
        'kernel.logs_dir' => realpath($this->getLogDir()) ?: $this->getLogDir(),
        'kernel.bundles' => $bundles,
        'kernel.bundles_metadata' => $bundlesMetadata,
        'kernel.charset' => $this->getCharset(),
        'kernel.container_class' => $this->getContainerClass(),
    ];
}
RSS feed
Powered by Drupal