TYPO3 CMS  TYPO3_7-6
TYPO3\CMS\Core\Core\ClassLoadingInformationGenerator Class Reference

Public Member Functions

 __construct (ClassLoader $classLoader, array $activeExtensionPackages, $installationRoot, $isDevMode=false)
 
 buildClassLoadingInformationForPackage (PackageInterface $package, $useRelativePaths=false)
 
 buildClassAliasMapForPackage (PackageInterface $package)
 
 buildAutoloadInformationFiles ()
 
 buildClassAliasMapFile ()
 

Protected Member Functions

 getAutoloadSectionFromManifest ($manifest, $section)
 
 createClassMap ($classesPath, $useRelativePaths=false, $ignorePotentialTestClasses=false, $namespace=null)
 
 makePathRelative ($packagePath, $realPathOfClassFile, $relativeToRoot=true)
 
 getPathCode ($relativePathToClassFile)
 

Protected Attributes

 $activeExtensionPackages
 
 $classLoader
 
 $installationRoot
 
 $isDevMode
 

Detailed Description

Generates class loading information (class maps, class aliases etc.) and writes it to files for further inclusion in the bootstrap

Definition at line 27 of file ClassLoadingInformationGenerator.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Core\Core\ClassLoadingInformationGenerator::__construct ( ClassLoader  $classLoader,
array  $activeExtensionPackages,
  $installationRoot,
  $isDevMode = false 
)

Member Function Documentation

◆ buildAutoloadInformationFiles()

TYPO3\CMS\Core\Core\ClassLoadingInformationGenerator::buildAutoloadInformationFiles ( )

◆ buildClassAliasMapFile()

TYPO3\CMS\Core\Core\ClassLoadingInformationGenerator::buildClassAliasMapFile ( )

Build class alias mapping file

Returns
string
Exceptions

Definition at line 290 of file ClassLoadingInformationGenerator.php.

References TYPO3\CMS\Core\Core\ClassLoadingInformationGenerator\buildClassAliasMapForPackage().

◆ buildClassAliasMapForPackage()

TYPO3\CMS\Core\Core\ClassLoadingInformationGenerator::buildClassAliasMapForPackage ( PackageInterface  $package)

Returns class alias map for given package

Parameters
PackageInterface$packageThe package to generate the class alias info for
Exceptions

Definition at line 173 of file ClassLoadingInformationGenerator.php.

References TYPO3\CMS\Core\Package\PackageInterface\getValueFromComposerManifest().

Referenced by TYPO3\CMS\Core\Core\ClassLoadingInformationGenerator\buildClassAliasMapFile().

◆ buildClassLoadingInformationForPackage()

TYPO3\CMS\Core\Core\ClassLoadingInformationGenerator::buildClassLoadingInformationForPackage ( PackageInterface  $package,
  $useRelativePaths = false 
)

Returns class loading information for a single package

Parameters
PackageInterface$packageThe package to generate the class loading info for
bool$useRelativePathsIf set to TRUE, make the path relative to the current TYPO3 instance (PATH_site)
Returns
array

Definition at line 70 of file ClassLoadingInformationGenerator.php.

References TYPO3\CMS\Core\Core\ClassLoadingInformationGenerator\createClassMap(), TYPO3\CMS\Core\Core\ClassLoadingInformationGenerator\getAutoloadSectionFromManifest(), TYPO3\CMS\Core\Package\PackageInterface\getPackagePath(), TYPO3\CMS\Core\Package\PackageInterface\getValueFromComposerManifest(), and TYPO3\CMS\Core\Core\ClassLoadingInformationGenerator\makePathRelative().

Referenced by TYPO3\CMS\Core\Core\ClassLoadingInformationGenerator\buildAutoloadInformationFiles().

◆ createClassMap()

TYPO3\CMS\Core\Core\ClassLoadingInformationGenerator::createClassMap (   $classesPath,
  $useRelativePaths = false,
  $ignorePotentialTestClasses = false,
  $namespace = null 
)
protected

Creates a class map for a given (absolute) path

Parameters
string$classesPath
bool$useRelativePaths
bool$ignorePotentialTestClasses
string$namespace
Returns
array

Definition at line 147 of file ClassLoadingInformationGenerator.php.

References Composer\Autoload\ClassMapGenerator\createMap(), and TYPO3\CMS\Core\Core\ClassLoadingInformationGenerator\makePathRelative().

Referenced by TYPO3\CMS\Core\Core\ClassLoadingInformationGenerator\buildClassLoadingInformationForPackage().

◆ getAutoloadSectionFromManifest()

TYPO3\CMS\Core\Core\ClassLoadingInformationGenerator::getAutoloadSectionFromManifest (   $manifest,
  $section 
)
protected

Fetches class loading info from the according section from the manifest file. Development information will be extracted and merged as well.

Parameters
\stdClass$manifest
string$section
Returns
array

Definition at line 119 of file ClassLoadingInformationGenerator.php.

Referenced by TYPO3\CMS\Core\Core\ClassLoadingInformationGenerator\buildClassLoadingInformationForPackage().

◆ getPathCode()

TYPO3\CMS\Core\Core\ClassLoadingInformationGenerator::getPathCode (   $relativePathToClassFile)
protected

Generate a relative path string from a relative path

Parameters
string$relativePathToClassFile
Returns
string

Definition at line 278 of file ClassLoadingInformationGenerator.php.

Referenced by TYPO3\CMS\Core\Core\ClassLoadingInformationGenerator\buildAutoloadInformationFiles().

◆ makePathRelative()

TYPO3\CMS\Core\Core\ClassLoadingInformationGenerator::makePathRelative (   $packagePath,
  $realPathOfClassFile,
  $relativeToRoot = true 
)
protected

Generate a relative path string from an absolute path within a give package path

Parameters
string$packagePath
string$realPathOfClassFile
bool$relativeToRoot
Returns
string

Definition at line 254 of file ClassLoadingInformationGenerator.php.

References TYPO3\CMS\Core\Utility\GeneralUtility\fixWindowsFilePath().

Referenced by TYPO3\CMS\Core\Core\ClassLoadingInformationGenerator\buildClassLoadingInformationForPackage(), and TYPO3\CMS\Core\Core\ClassLoadingInformationGenerator\createClassMap().

Member Data Documentation

◆ $activeExtensionPackages

TYPO3\CMS\Core\Core\ClassLoadingInformationGenerator::$activeExtensionPackages
protected

◆ $classLoader

TYPO3\CMS\Core\Core\ClassLoadingInformationGenerator::$classLoader
protected

◆ $installationRoot

TYPO3\CMS\Core\Core\ClassLoadingInformationGenerator::$installationRoot
protected

◆ $isDevMode

TYPO3\CMS\Core\Core\ClassLoadingInformationGenerator::$isDevMode
protected