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

Static Public Member Functions

static setClassLoader (ClassLoader $classLoader)
 
static bool isClassLoadingInformationAvailable ()
 
static dumpClassLoadingInformation ()
 
static updateClassLoadingInformationAfterPackageDeactivation (AfterPackageDeactivationEvent $event)
 
static updateClassLoadingInformationAfterPackageActivation (AfterPackageActivationEvent $event)
 
static registerClassLoadingInformation ()
 
static registerTransientClassLoadingInformationForPackage (PackageInterface $package)
 
static mixed getClassNameForAlias ($alias)
 

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 ClassLoader getClassLoader ()
 
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()

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

◆ 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 216 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 251 of file ClassLoadingInformation.php.

◆ getClassLoader()

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

Internal method calling the bootstrap to fetch the composer class loader

Returns
‪ClassLoader
Exceptions

Definition at line 230 of file ClassLoadingInformation.php.

◆ getClassLoadingInformationDirectory()

◆ getClassNameForAlias()

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

Get class name for alias

Parameters
string$alias
Returns
‪mixed

Definition at line 207 of file ClassLoadingInformation.php.

Referenced by TYPO3\CMS\Extbase\Object\Container\Container\getInstanceInternal().

◆ 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 82 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 241 of file ClassLoadingInformation.php.

References TYPO3\CMS\Core\Core\Environment\getContext(), and TYPO3\CMS\Core\Core\ApplicationContext\isTesting().

◆ 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

Parameters
PackageInterface$package
Exceptions

Definition at line 171 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

Parameters
ClassLoader$classLoader

Definition at line 71 of file ClassLoadingInformation.php.

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

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

◆ updateClassLoadingInformationAfterPackageActivation()

static TYPO3\CMS\Core\Core\ClassLoadingInformation::updateClassLoadingInformationAfterPackageActivation ( AfterPackageActivationEvent  $event)
static
Parameters
AfterPackageActivationEvent$event

Definition at line 122 of file ClassLoadingInformation.php.

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

◆ updateClassLoadingInformationAfterPackageDeactivation()

static TYPO3\CMS\Core\Core\ClassLoadingInformation::updateClassLoadingInformationAfterPackageDeactivation ( AfterPackageDeactivationEvent  $event)
static
Parameters
AfterPackageDeactivationEvent$event

Definition at line 110 of file ClassLoadingInformation.php.

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

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().