-
-
Notifications
You must be signed in to change notification settings - Fork 46
/
bootstrap.php
51 lines (41 loc) · 1.71 KB
/
bootstrap.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Doctrine\Common\Annotations\AnnotationRegistry;
use Doctrine\Deprecations\Deprecation;
use Symfony\Bridge\PhpUnit\DeprecationErrorHandler;
// Detect if we need to serialize deprecations to a file.
if (in_array(\PHP_SAPI, ['cli', 'phpdbg'], true) && $file = getenv('SYMFONY_DEPRECATIONS_SERIALIZE')) {
DeprecationErrorHandler::collectDeprecations($file);
return;
}
// Detect if we're loaded by an actual run of phpunit
if (!defined('PHPUNIT_COMPOSER_INSTALL') && !class_exists(\PHPUnit\TextUI\Command::class, false)) {
return;
}
if (isset($fileIdentifier)) {
unset($GLOBALS['__composer_autoload_files'][$fileIdentifier]);
}
if (class_exists(Deprecation::class)) {
Deprecation::withoutDeduplication();
if (\PHP_VERSION_ID < 80000) {
// Ignore deprecations about the annotation mapping driver when it's not possible to move to the attribute driver yet
Deprecation::ignoreDeprecations('https://github.com/doctrine/orm/issues/10098');
}
}
if (!class_exists(AnnotationRegistry::class, false) && class_exists(AnnotationRegistry::class)) {
if (method_exists(AnnotationRegistry::class, 'registerUniqueLoader')) {
AnnotationRegistry::registerUniqueLoader('class_exists');
} elseif (method_exists(AnnotationRegistry::class, 'registerLoader')) {
AnnotationRegistry::registerLoader('class_exists');
}
}
if ('disabled' !== getenv('SYMFONY_DEPRECATIONS_HELPER')) {
DeprecationErrorHandler::register(getenv('SYMFONY_DEPRECATIONS_HELPER'));
}