Skip to content

Commit a5b3833

Browse files
committed
check for PHP files to exist before requiring them
1 parent 4442ff3 commit a5b3833

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

symfony/framework-bundle/5.1/src/Kernel.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ protected function configureContainer(ContainerConfigurator $container): void
2121
$container->import('../config/{services}_'.$this->environment.'.yaml');
2222
} else {
2323
$path = \dirname(__DIR__).'/config/services.php';
24-
(require $path)($container->withPath($path), $this);
24+
25+
if (is_file($path)) {
26+
(require $path)($container->withPath($path), $this);
27+
}
2528
}
2629
}
2730

@@ -34,7 +37,10 @@ protected function configureRoutes(RoutingConfigurator $routes): void
3437
$routes->import('../config/{routes}.yaml');
3538
} else {
3639
$path = \dirname(__DIR__).'/config/routes.php';
37-
(require $path)($routes->withPath($path), $this);
40+
41+
if (is_file($path)) {
42+
(require $path)($routes->withPath($path), $this);
43+
}
3844
}
3945
}
4046
}

0 commit comments

Comments
 (0)