TYPO3  7.6
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
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)
 
 isIgnoredPath ($packagePath, $path)
 
 isIgnoredClassName ($className)
 
 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 ( ClassLoader  $classLoader,
array  $activeExtensionPackages,
  $installationRoot,
  $isDevMode = false 
)
Parameters
ClassLoader$classLoader
array$activeExtensionPackages
string$installationRoot
bool$isDevMode

Definition at line 55 of file ClassLoadingInformationGenerator.php.

References ClassLoadingInformationGenerator\$activeExtensionPackages, ClassLoadingInformationGenerator\$classLoader, ClassLoadingInformationGenerator\$installationRoot, and ClassLoadingInformationGenerator\$isDevMode.

Member Function Documentation

buildAutoloadInformationFiles ( )

Generate the class map file

Returns
string[]

Definition at line 243 of file ClassLoadingInformationGenerator.php.

buildClassAliasMapFile ( )

Build class alias mapping file

Returns
string
Exceptions
\Exception

Definition at line 322 of file ClassLoadingInformationGenerator.php.

buildClassAliasMapForPackage ( PackageInterface  $package)

Returns class alias map for given package

Parameters
PackageInterface$packageThe package to generate the class alias info for
Exceptions
\TYPO3\CMS\Core\Error\Exception
Returns
array

Definition at line 205 of file ClassLoadingInformationGenerator.php.

References PackageInterface\getValueFromComposerManifest().

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 ClassLoadingInformationGenerator\createClassMap(), ClassLoadingInformationGenerator\getAutoloadSectionFromManifest(), PackageInterface\getPackagePath(), PackageInterface\getValueFromComposerManifest(), and ClassLoadingInformationGenerator\makePathRelative().

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 143 of file ClassLoadingInformationGenerator.php.

References ClassMapGenerator\createMap().

Referenced by ClassLoadingInformationGenerator\buildClassLoadingInformationForPackage().

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 117 of file ClassLoadingInformationGenerator.php.

Referenced by ClassLoadingInformationGenerator\buildClassLoadingInformationForPackage().

getPathCode (   $relativePathToClassFile)
protected

Generate a relative path string from a relative path

Parameters
string$relativePathToClassFile
Returns
string

Definition at line 310 of file ClassLoadingInformationGenerator.php.

isIgnoredClassName (   $className)
protected

Check if class name should be ignored. Currently all classes with suffix "Test" and "Fixture" will be ignored

Parameters
string$className
Returns
bool

Definition at line 188 of file ClassLoadingInformationGenerator.php.

isIgnoredPath (   $packagePath,
  $path 
)
protected

Check if the class path should be ignored. Currently only tests folders are ignored.

Parameters
string$packagePath
string$path
Returns
bool

Definition at line 172 of file ClassLoadingInformationGenerator.php.

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 286 of file ClassLoadingInformationGenerator.php.

Referenced by ClassLoadingInformationGenerator\buildClassLoadingInformationForPackage().

Member Data Documentation

$activeExtensionPackages
protected
$classLoader
protected
$installationRoot
protected
$isDevMode
protected