‪TYPO3CMS  ‪main
TYPO3\CMS\Core\Core\ClassLoadingInformation Class Reference

Static Public Member Functions

static setClassLoader (ClassLoader $classLoader)
 
static bool isClassLoadingInformationAvailable ()
 
static dumpClassLoadingInformation ()
 
static registerClassLoadingInformation ()
 
static registerTransientClassLoadingInformationForPackage (PackageInterface $package)
 
static class string getClassNameForAlias ($alias)
 
static ClassLoader getClassLoader ()
 

Public Attributes

const AUTOLOAD_INFO_DIR = 'autoload/'
 
const AUTOLOAD_INFO_DIR_TESTS = 'autoload-tests/'
 
const AUTOLOAD_CLASSMAP_FILENAME = 'autoload_classmap.php'
 
const AUTOLOAD_PSR4_FILENAME = 'autoload_psr4.php'
 
const AUTOLOAD_CLASSALIASMAP_FILENAME = 'autoload_classaliasmap.php'
 

Static Protected Member Functions

static string getClassLoadingInformationDirectory ()
 
static ensureAutoloadInfoDirExists ()
 
static bool isTestingContext ()
 
static PackageInterface[] getActiveExtensionPackages ()
 

Static Protected Attributes

static ClassLoader $classLoader
 

Detailed Description

Get and manipulate class loading information, only necessary/in use when TYPO3 is not purely set up by composer but when e.g. extensions are installed via the extension manager by utilizing the composer class loader and adding more information built by the ClassLoadingInformationGenerator class.

Definition at line 34 of file ClassLoadingInformation.php.

Member Function Documentation

◆ dumpClassLoadingInformation()

◆ ensureAutoloadInfoDirExists()

static TYPO3\CMS\Core\Core\ClassLoadingInformation::ensureAutoloadInfoDirExists ( )
staticprotected

Ensures the defined path for class information files exists And clears it in case we're in testing context

Definition at line 188 of file ClassLoadingInformation.php.

References TYPO3\CMS\Core\Core\ClassLoadingInformation\getClassLoadingInformationDirectory(), and TYPO3\CMS\Core\Utility\GeneralUtility\mkdir_deep().

Referenced by TYPO3\CMS\Core\Core\ClassLoadingInformation\dumpClassLoadingInformation().

◆ getActiveExtensionPackages()

static PackageInterface [] TYPO3\CMS\Core\Core\ClassLoadingInformation::getActiveExtensionPackages ( )
staticprotected

Get all packages except the protected ones, as they are covered already

Returns
‪PackageInterface[]

Definition at line 223 of file ClassLoadingInformation.php.

◆ getClassLoader()

static ClassLoader TYPO3\CMS\Core\Core\ClassLoadingInformation::getClassLoader ( )
static

Internal method calling the bootstrap to fetch the composer class loader

Returns
‪ClassLoader

Currently used in TYPO3 testing. Public visibility is experimental and may vanish without further notice.

Definition at line 202 of file ClassLoadingInformation.php.

◆ getClassLoadingInformationDirectory()

◆ getClassNameForAlias()

static class string TYPO3\CMS\Core\Core\ClassLoadingInformation::getClassNameForAlias (   $alias)
static

Get class name for alias

Parameters
string$alias
Returns
‪class-string

Definition at line 179 of file ClassLoadingInformation.php.

◆ isClassLoadingInformationAvailable()

static bool TYPO3\CMS\Core\Core\ClassLoadingInformation::isClassLoadingInformationAvailable ( )
static

Checks if the autoload_classmap.php exists and we are not in testing context. Used to see if the ClassLoadingInformationGenerator should be called.

Returns
‪bool

Definition at line 81 of file ClassLoadingInformation.php.

Referenced by TYPO3\CMS\Core\Core\Bootstrap\baseSetup(), and TYPO3\CMS\Core\Core\Bootstrap\init().

◆ isTestingContext()

static bool TYPO3\CMS\Core\Core\ClassLoadingInformation::isTestingContext ( )
staticprotected

Internal method calling the bootstrap to get application context information

Returns
‪bool
Exceptions

Definition at line 213 of file ClassLoadingInformation.php.

References TYPO3\CMS\Core\Core\Environment\getContext().

◆ registerClassLoadingInformation()

static TYPO3\CMS\Core\Core\ClassLoadingInformation::registerClassLoadingInformation ( )
static

◆ registerTransientClassLoadingInformationForPackage()

static TYPO3\CMS\Core\Core\ClassLoadingInformation::registerTransientClassLoadingInformationForPackage ( PackageInterface  $package)
static

Sets class loading information for a package for the current web request

Exceptions

Definition at line 144 of file ClassLoadingInformation.php.

References TYPO3\CMS\Core\Core\Environment\getPublicPath().

◆ setClassLoader()

static TYPO3\CMS\Core\Core\ClassLoadingInformation::setClassLoader ( ClassLoader  $classLoader)
static

Sets the package manager instance

Definition at line 70 of file ClassLoadingInformation.php.

References TYPO3\CMS\Core\Core\ClassLoadingInformation\$classLoader.

Referenced by TYPO3\CMS\Core\Core\Bootstrap\initializeClassLoader().

Member Data Documentation

◆ $classLoader

ClassLoader TYPO3\CMS\Core\Core\ClassLoadingInformation::$classLoader
staticprotected

◆ AUTOLOAD_CLASSALIASMAP_FILENAME

const TYPO3\CMS\Core\Core\ClassLoadingInformation::AUTOLOAD_CLASSALIASMAP_FILENAME = 'autoload_classaliasmap.php'

Name of file that contains all class alias mappings

Definition at line 59 of file ClassLoadingInformation.php.

Referenced by TYPO3\CMS\Core\Core\ClassLoadingInformation\registerClassLoadingInformation().

◆ AUTOLOAD_CLASSMAP_FILENAME

const TYPO3\CMS\Core\Core\ClassLoadingInformation::AUTOLOAD_CLASSMAP_FILENAME = 'autoload_classmap.php'

Name of file that contains all classes-filename mappings

Definition at line 49 of file ClassLoadingInformation.php.

Referenced by TYPO3\CMS\Core\Core\ClassLoadingInformation\registerClassLoadingInformation().

◆ AUTOLOAD_INFO_DIR

const TYPO3\CMS\Core\Core\ClassLoadingInformation::AUTOLOAD_INFO_DIR = 'autoload/'

Base directory storing all autoload information

Definition at line 39 of file ClassLoadingInformation.php.

Referenced by TYPO3\CMS\Core\Core\ClassLoadingInformation\getClassLoadingInformationDirectory().

◆ AUTOLOAD_INFO_DIR_TESTS

const TYPO3\CMS\Core\Core\ClassLoadingInformation::AUTOLOAD_INFO_DIR_TESTS = 'autoload-tests/'

Base directory storing all autoload information in testing context

Definition at line 44 of file ClassLoadingInformation.php.

Referenced by TYPO3\CMS\Core\Core\ClassLoadingInformation\getClassLoadingInformationDirectory().

◆ AUTOLOAD_PSR4_FILENAME

const TYPO3\CMS\Core\Core\ClassLoadingInformation::AUTOLOAD_PSR4_FILENAME = 'autoload_psr4.php'

Name of file that contains all PSR4 mappings, fetched from the composer.json files of extensions

Definition at line 54 of file ClassLoadingInformation.php.

Referenced by TYPO3\CMS\Core\Core\ClassLoadingInformation\registerClassLoadingInformation().