public function registerBundles(): iterable
{
$contents = require $this->getProjectDir().'/config/bundles.php';
foreach ($contents as $class => $envs) {
if ($envs[$this->environment] ?? $envs['all'] ?? false) {
yield new $class();
}
}
}
public function getProjectDir(): string
*/
protected function initializeBundles()
{
// init bundles
$this->bundles = [];
foreach ($this->registerBundles() as $bundle) {
$name = $bundle->getName();
if (isset($this->bundles[$name])) {
throw new \LogicException(sprintf('Trying to register two bundles with the same name "%s".', $name));
}
$this->bundles[$name] = $bundle;
putenv('SHELL_VERBOSITY=3');
$_ENV['SHELL_VERBOSITY'] = 3;
$_SERVER['SHELL_VERBOSITY'] = 3;
}
$this->initializeBundles();
$this->initializeContainer();
$container = $this->container;
if ($container->hasParameter('kernel.trusted_hosts') && $trustedHosts = $container->getParameter('kernel.trusted_hosts')) {
* {@inheritdoc}
*/
public function handle(Request $request, int $type = HttpKernelInterface::MAIN_REQUEST, bool $catch = true)
{
if (!$this->booted) {
$container = $this->container ?? $this->preBoot();
if ($container->has('http_cache')) {
return $container->get('http_cache')->handle($request, $type, $catch);
}
}
Request::setTrustedHosts([$trustedHosts]);
}
$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);
ClassNotFoundError
|
---|
Symfony\Component\ErrorHandler\Error\ClassNotFoundError: Attempted to load class "WebProfilerBundle" from namespace "Symfony\Bundle\WebProfilerBundle". Did you forget a "use" statement for another namespace? at /var/www/vhosts/accenthotels.com/httpdocs/releases/162/src/Kernel.php:24 at App\Kernel->registerBundles() (/var/www/vhosts/accenthotels.com/httpdocs/releases/162/vendor/symfony/http-kernel/Kernel.php:386) at Symfony\Component\HttpKernel\Kernel->initializeBundles() (/var/www/vhosts/accenthotels.com/httpdocs/releases/162/vendor/symfony/http-kernel/Kernel.php:786) at Symfony\Component\HttpKernel\Kernel->preBoot() (/var/www/vhosts/accenthotels.com/httpdocs/releases/162/vendor/symfony/http-kernel/Kernel.php:190) at Symfony\Component\HttpKernel\Kernel->handle() (/var/www/vhosts/accenthotels.com/httpdocs/releases/162/public/index.php:26) |