Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
addSourcePathsFromPrefixes example
self::
$vendors
[
]
= \
dirname
(
__DIR__
)
.\DIRECTORY_SEPARATOR.'Legacy';
if
(
class_exists
(
DebugClassLoader::
class
, false
)
)
{
self::
$vendors
[
]
= \
dirname
(
(
new
\
ReflectionClass
(
DebugClassLoader::
class
)
)
->
getFileName
(
)
)
;
}
foreach
(
get_declared_classes
(
)
as
$class
)
{
if
(
'C' ===
$class
[
0
]
&& 0 ===
strpos
(
$class
, 'ComposerAutoloaderInit'
)
)
{
$r
=
new
\
ReflectionClass
(
$class
)
;
$v
= \
dirname
(
$r
->
getFileName
(
)
, 2
)
;
if
(
file_exists
(
$v
.'/composer/installed.json'
)
)
{
self::
$vendors
[
]
=
$v
;
$loader
=
require
$v
.'/autoload.php';
$paths
= self::
addSourcePathsFromPrefixes
(
array_merge
(
$loader
->
getPrefixes
(
)
,
$loader
->
getPrefixesPsr4
(
)
)
,
$paths
)
;
}
}
}
foreach
(
$paths
as
$path
)
{
foreach
(
self::
$vendors
as
$vendor
)
{
if
(
0 !==
strpos
(
$path
,
$vendor
)
)
{
self::
$internalPaths
[
]
=
$path
;
}
}