Revert "Merge pull request #721"

This reverts commit ed25f50bef, reversing
changes made to 9880918fbf.
This commit is contained in:
Nicolas Grekas
2020-04-03 15:45:57 +02:00
parent 937bca6a54
commit b341fbe67c
6 changed files with 4 additions and 93 deletions
@@ -1,12 +0,0 @@
<?php
use App\Kernel;
use Symfony\Bundle\FrameworkBundle\Routing\Loader\Configurator\RoutingConfigurator;
return static function (RoutingConfigurator $routes, Kernel $kernel): void {
// $routes->add('index', '/')
// ->controller([App\Controller\DefaultController::class, 'index'])
// ;
};
@@ -1,59 +0,0 @@
<?php
use App\Kernel;
use Symfony\Component\DependencyInjection\Loader\Configurator as di;
// This file is the entry point to configure your own services.
// Files in the packages/ subdirectory configure your dependencies.
return static function (di\ContainerConfigurator $container, Kernel $kernel): void {
// Parameters are configuration that don't need to change depending on the machine where the app is deployed.
// see https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration
$container->parameters()
// ->set(...)
;
$services = $container->services()
->defaults()
->autowire()
->autoconfigure()
;
// Makes classes in src/ available to be used as services
$src = dirname(__DIR__).'/src';
$services
->load('App\\', $src)
->exclude([
$src.'/DependencyInjection',
$src.'/Entity',
$src.'/Migrations',
$src.'/Tests',
$src.'/Kernel.php',
])
;
// Controllers are imported separately to make sure services can be injected
// as action arguments even if you don't extend any base controller class
$services
->load('App\\Controller\\', $src.'/Controller')
->tag('controller.service_arguments')
;
// Add more service definitions when explicit configuration is needed.
// Please note that last definitions *replace* previous ones when using $services->set().
// It is possible to alter a previously declared definition by using $services->get() instead.
$services
// ->set(App\MyService::class)
// ->args([di\ref(App\AnotherService::class)])
;
if ('test' === $kernel->getEnvironment()) {
// When a test case needs access to a service, getting it via
// a public alias with the "test." prefix is recommended.
$services->public()
// ->alias('test.App\MyService', App\MyService::class)
;
}
};
+1
View File
@@ -0,0 +1 @@
../../4.2/config/services.yaml
+3 -15
View File
@@ -15,26 +15,14 @@ class Kernel extends BaseKernel
{
$container->import('../config/{packages}/*.yaml');
$container->import('../config/{packages}/'.$this->environment.'/*.yaml');
if (file_exists(\dirname(__DIR__).'/config/services.yaml')) {
$container->import('../config/{services}.yaml');
$container->import('../config/{services}_'.$this->environment.'.yaml');
} else {
$path = \dirname(__DIR__).'/config/services.php';
(require $path)($container->withPath($path), $this);
}
$container->import('../config/{services}.yaml');
$container->import('../config/{services}_'.$this->environment.'.yaml');
}
protected function configureRoutes(RoutingConfigurator $routes): void
{
$routes->import('../config/{routes}/'.$this->environment.'/*.yaml');
$routes->import('../config/{routes}/*.yaml');
if (file_exists(\dirname(__DIR__).'/config/routes.yaml')) {
$routes->import('../config/{routes}.yaml');
} else {
$path = \dirname(__DIR__).'/config/routes.php';
(require $path)($routes->withPath($path), $this);
}
$routes->import('../config/{routes}.yaml');
}
}