FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
phpstan-phar-composer-source/bootstrap.php at git · phpstan/phpstan-phar-composer-source · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
This repository was archived by the owner on Sep 30, 2025. It is now read-only.
phpstan
/
phpstan-phar-composer-source
Public archive
Notifications
You must be signed in to change notification settings
Fork
0
Star
10
Code
Issues
0
Pull requests
1
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
phpstan-phar-composer-source
/
bootstrap.php
Copy path
More file actions
More file actions
Latest commit
History
History
History
129 lines (109 loc) · 4.86 KB
Breadcrumbs
phpstan-phar-composer-source
/
bootstrap.php
Copy path
File metadata and controls
129 lines (109 loc) · 4.86 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
<?php
declare
(strict_types =
1
);
namespace
PHPStan
;
use
Composer
\
Autoload
\
ClassLoader
;
use
function
class_exists
;
use
function
file_exists
;
use
const
PHP_VERSION_ID
;
final
class
PharAutoloader
{
/** @var ClassLoader */
private
static
$
composerAutoloader
;
/** @var bool */
private
static
$
polyfillsLoaded
=
false
;
final
public
static
function
loadClass
(
string
$
class
):
void
{
$
downloadedPharPath
=
'
phar://
'
.
__DIR__
.
'
/phpstan-downloaded.phar
'
;
if
(!@
file_exists
(
$
downloadedPharPath
)) {
return
;
}
if
(!
extension_loaded
(
'
phar
'
) ||
defined
(
'
__PHPSTAN_RUNNING__
'
)) {
return
;
}
if
(
strpos
(
$
class
,
'
_PHPStan_
'
) ===
0
) {
if
(!
in_array
(
'
phar
'
,
stream_get_wrappers
(),
true
)) {
throw
new
\
Exception
(
'
Phar wrapper is not registered. Please review your php.ini settings.
'
);
}
if
(
self
::
$
composerAutoloader
===
null
) {
self
::
$
composerAutoloader
=
require
$
downloadedPharPath
.
'
/vendor/autoload.php
'
;
require_once
$
downloadedPharPath
.
'
/vendor/jetbrains/phpstorm-stubs/PhpStormStubsMap.php
'
;
require_once
$
downloadedPharPath
.
'
/vendor/react/async/src/functions_include.php
'
;
require_once
$
downloadedPharPath
.
'
/vendor/react/promise/src/functions_include.php
'
;
}
self
::
$
composerAutoloader
->
loadClass
(
$
class
);
return
;
}
if
(
strpos
(
$
class
,
'
PHPStan
\\'
) !==
0
||
strpos
(
$
class
,
'
PHPStan
\\
PhpDocParser
\\'
) ===
0
) {
return
;
}
if
(!
in_array
(
'
phar
'
,
stream_get_wrappers
(),
true
)) {
throw
new
\
Exception
(
'
Phar wrapper is not registered. Please review your php.ini settings.
'
);
}
if
(!
self
::
$
polyfillsLoaded
) {
self
::
$
polyfillsLoaded
=
true
;
if
(
PHP_VERSION_ID
<
80000
&&
empty
(
$
GLOBALS
[
'
__composer_autoload_files
'
][
'
a4a119a56e50fbb293281d9a48007e0e
'
])
&& !
class_exists
(\
Symfony
\
Polyfill
\
Php80
\Php80::class,
false
)
) {
$
GLOBALS
[
'
__composer_autoload_files
'
][
'
a4a119a56e50fbb293281d9a48007e0e
'
] =
true
;
require_once
$
downloadedPharPath
.
'
/vendor/symfony/polyfill-php80/Php80.php
'
;
require_once
$
downloadedPharPath
.
'
/vendor/symfony/polyfill-php80/bootstrap.php
'
;
}
if
(
empty
(
$
GLOBALS
[
'
__composer_autoload_files
'
][
'
0e6d7bf4a5811bfa5cf40c5ccd6fae6a
'
])
&& !
class_exists
(\
Symfony
\
Polyfill
\
Mbstring
\Mbstring::class,
false
)
) {
$
GLOBALS
[
'
__composer_autoload_files
'
][
'
0e6d7bf4a5811bfa5cf40c5ccd6fae6a
'
] =
true
;
require_once
$
downloadedPharPath
.
'
/vendor/symfony/polyfill-mbstring/Mbstring.php
'
;
require_once
$
downloadedPharPath
.
'
/vendor/symfony/polyfill-mbstring/bootstrap.php
'
;
}
if
(
empty
(
$
GLOBALS
[
'
__composer_autoload_files
'
][
'
e69f7f6ee287b969198c3c9d6777bd38
'
])
&& !
class_exists
(\
Symfony
\
Polyfill
\
Intl
\
Normalizer
\Normalizer::class,
false
)
) {
$
GLOBALS
[
'
__composer_autoload_files
'
][
'
e69f7f6ee287b969198c3c9d6777bd38
'
] =
true
;
require_once
$
downloadedPharPath
.
'
/vendor/symfony/polyfill-intl-normalizer/Normalizer.php
'
;
require_once
$
downloadedPharPath
.
'
/vendor/symfony/polyfill-intl-normalizer/bootstrap.php
'
;
}
if
(
!
extension_loaded
(
'
intl
'
)
&&
empty
(
$
GLOBALS
[
'
__composer_autoload_files
'
][
'
8825ede83f2f289127722d4e842cf7e8
'
])
&& !
class_exists
(\
Symfony
\
Polyfill
\
Intl
\
Grapheme
\Grapheme::class,
false
)
) {
$
GLOBALS
[
'
__composer_autoload_files
'
][
'
8825ede83f2f289127722d4e842cf7e8
'
] =
true
;
require_once
$
downloadedPharPath
.
'
/vendor/symfony/polyfill-intl-grapheme/Grapheme.php
'
;
require_once
$
downloadedPharPath
.
'
/vendor/symfony/polyfill-intl-grapheme/bootstrap.php
'
;
}
if
(
PHP_VERSION_ID
<
80100
&&
empty
(
$
GLOBALS
[
'
__composer_autoload_files
'
][
'
23c18046f52bef3eea034657bafda50f
'
])
&& !
class_exists
(\
Symfony
\
Polyfill
\
Php81
\Php81::class,
false
)
) {
$
GLOBALS
[
'
__composer_autoload_files
'
][
'
23c18046f52bef3eea034657bafda50f
'
] =
true
;
require_once
$
downloadedPharPath
.
'
/vendor/symfony/polyfill-php81/Php81.php
'
;
require_once
$
downloadedPharPath
.
'
/vendor/symfony/polyfill-php81/bootstrap.php
'
;
}
if
(
PHP_VERSION_ID
<
80300
&&
empty
(
$
GLOBALS
[
'
__composer_autoload_files
'
][
'
662a729f963d39afe703c9d9b7ab4a8c
'
])
&& !
class_exists
(\
Symfony
\
Polyfill
\
Php83
\Php83::class,
false
)
) {
$
GLOBALS
[
'
__composer_autoload_files
'
][
'
662a729f963d39afe703c9d9b7ab4a8c
'
] =
true
;
require_once
$
downloadedPharPath
.
'
/vendor/symfony/polyfill-php83/Php83.php
'
;
require_once
$
downloadedPharPath
.
'
/vendor/symfony/polyfill-php83/bootstrap.php
'
;
}
}
$
filename
=
str_replace
(
'\\'
,
DIRECTORY_SEPARATOR
,
$
class
);
if
(
strpos
(
$
class
,
'
PHPStan
\\
BetterReflection
\\'
) ===
0
) {
$
filename
=
substr
(
$
filename
,
strlen
(
'
PHPStan
\\
BetterReflection
\\'
));
$
filepath
=
$
downloadedPharPath
.
'
/vendor/ondrejmirtes/better-reflection/src/
'
.
$
filename
.
'
.php
'
;
}
else
{
$
filename
=
substr
(
$
filename
,
strlen
(
'
PHPStan
\\'
));
$
filepath
=
$
downloadedPharPath
.
'
/src/
'
.
$
filename
.
'
.php
'
;
}
if
(!
file_exists
(
$
filepath
)) {
return
;
}
require
$
filepath
;
}
}
spl_autoload_register
([PharAutoloader::class,
'
loadClass
'
]);
Back
|
FazBrowse Home
|
New Git URL