|
26 | 26 | use Doctrine\Bundle\DoctrineBundle\DoctrineBundle; |
27 | 27 | use Doctrine\Bundle\MongoDBBundle\Command\TailCursorDoctrineODMCommand; |
28 | 28 | use Doctrine\Bundle\MongoDBBundle\DoctrineMongoDBBundle; |
| 29 | +use Doctrine\Bundle\DoctrineBundle\Command\Proxy\ValidateSchemaCommand; |
29 | 30 | use FriendsOfBehat\SymfonyExtension\Bundle\FriendsOfBehatSymfonyExtensionBundle; |
30 | 31 | use Symfony\Bundle\FrameworkBundle\FrameworkBundle; |
31 | 32 | use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait; |
|
44 | 45 | use Symfony\Component\Security\Core\Authorization\Strategy\AccessDecisionStrategyInterface; |
45 | 46 | use Symfony\Component\Security\Core\User\User as SymfonyCoreUser; |
46 | 47 | use Symfony\Component\Security\Core\User\UserInterface; |
| 48 | +use Symfony\Component\PropertyInfo\Type; |
47 | 49 |
|
48 | 50 | /** |
49 | 51 | * AppKernel for tests. |
@@ -160,6 +162,12 @@ protected function configureContainer(ContainerBuilder $c, LoaderInterface $load |
160 | 162 | ]; |
161 | 163 | } |
162 | 164 |
|
| 165 | + // SF 8.1 removed configuration |
| 166 | + if (!class_exists(Type::class)) { |
| 167 | + unset($config['annotations']); |
| 168 | + $c->setParameter('.json_streamer.lazy_ghosts_dir', __DIR__ . '/cache/json_streamer_lazy_ghost'); |
| 169 | + } |
| 170 | + |
163 | 171 | $c->prependExtensionConfig('framework', $config); |
164 | 172 |
|
165 | 173 | $alg = class_exists(NativePasswordHasher::class, false) || class_exists('Symfony\Component\Security\Core\Encoder\NativePasswordEncoder') ? 'auto' : 'bcrypt'; |
@@ -281,11 +289,19 @@ class_exists(NativePasswordHasher::class) ? 'password_hashers' : 'encoders' => [ |
281 | 289 | if (defined(ConnectionFactory::class.'::DEFAULT_SCHEME_MAP')) { |
282 | 290 | $c->prependExtensionConfig('doctrine', [ |
283 | 291 | 'orm' => [ |
284 | | - 'report_fields_where_declared' => true, |
285 | 292 | 'controller_resolver' => ['auto_mapping' => false], |
286 | | - 'enable_lazy_ghost_objects' => true, |
287 | 293 | ], |
288 | 294 | ]); |
| 295 | + |
| 296 | + if (class_exists(ValidateSchemaCommand::class)) { |
| 297 | + $c->prependExtensionConfig('doctrine', [ |
| 298 | + 'orm' => [ |
| 299 | + 'auto_generate_proxy_classes' => '%kernel.debug%', |
| 300 | + 'report_fields_where_declared' => true, |
| 301 | + 'enable_lazy_ghost_objects' => true, |
| 302 | + ], |
| 303 | + ]); |
| 304 | + } |
289 | 305 | } |
290 | 306 |
|
291 | 307 | $loader->load(__DIR__.'/config/config_swagger.php'); |
|
0 commit comments