Environment::getPsr4Prefixes()
\nn\t3::Environment()->getPsr4Prefixes();
Return list of PSR4 prefixes.
This is an array with all folders that must be parsed by class when autoloading / bootstrapping TYPO3
have to be parsed. In a TYPO3 extension, this is the Classes folder by default.
The list is generated by Composer/TYPO3.
An array is returned. Key is Vendor\Namespace\, Value is an array with paths to the folders,
which are searched recursively for classes. It does not matter whether TYPO3 is running in composer
mode or not.
\nn\t3::Environment()->getPsr4Prefixes();
Copied!
Example for return:
[
'Nng\Nnhelpers\' => ['/path/to/composer/../../public/typo3conf/ext/nnhelpers/Classes', ...],
'Nng\Nnrestapi\' => ['/path/to/composer/../../public/typo3conf/ext/nnrestapi/Classes', ...]
]
Copied!
| @return array
Source Code
public function getPsr4Prefixes() {
$composerClassLoader = ClassLoadingInformation::getClassLoader();
$psr4prefixes = $composerClassLoader->getPrefixesPsr4();
return $psr4prefixes;
}
Copied!