TYPO3 CMS  TYPO3_6-2
TYPO3\CMS\Core\Package\PackageManager Class Reference
Inheritance diagram for TYPO3\CMS\Core\Package\PackageManager:
TYPO3\Flow\Package\PackageManager TYPO3\CMS\Core\SingletonInterface TYPO3\Flow\Package\PackageManagerInterface TYPO3\CMS\Core\Package\FailsafePackageManager TYPO3\CMS\Core\Package\UnitTestPackageManager

Public Member Functions

 __construct ()
 
 injectClassLoader (\TYPO3\CMS\Core\Core\ClassLoader $classLoader)
 
 injectCoreCache (\TYPO3\CMS\Core\Cache\Frontend\PhpFrontend $coreCache)
 
 injectDependencyResolver (DependencyResolver $dependencyResolver)
 
 scanAvailablePackages ()
 
 registerPackage (\TYPO3\Flow\Package\PackageInterface $package, $sortAndSave=TRUE)
 
 getPackageKeyFromComposerName ($composerName)
 
 getExtAutoloadRegistry ()
 
 getPackage ($packageKey)
 
 isPackageAvailable ($packageKey)
 
 isPackageActive ($packageKey)
 
 deactivatePackage ($packageKey)
 
 activatePackage ($packageKey)
 
 activatePackageDuringRuntime ($packageKey)
 
 deletePackage ($packageKey)
 
 freezePackage ($packageKey)
 
 isPackageFrozen ($packageKey)
 
 unfreezePackage ($packageKey)
 
 refreezePackage ($packageKey)
 
 getActivePackages ()
 
 isPackageKeyValid ($packageKey)
 
- Public Member Functions inherited from TYPO3\Flow\Package\PackageManager
 injectClassLoader (\TYPO3\Flow\Core\ClassLoader $classLoader)
 
 injectSettings (array $settings)
 
 injectSystemLogger (\TYPO3\Flow\Log\SystemLoggerInterface $systemLogger)
 
 initialize (\TYPO3\Flow\Core\Bootstrap $bootstrap)
 
 isPackageAvailable ($packageKey)
 
 isPackageActive ($packageKey)
 
 getPackagesBasePath ()
 
 getPackage ($packageKey)
 
 getPackageOfObject ($object)
 
 getAvailablePackages ()
 
 getActivePackages ()
 
 getFrozenPackages ()
 
 getFilteredPackages ($packageState='available', $packagePath=NULL, $packageType=NULL)
 
 getCaseSensitivePackageKey ($unknownCasedPackageKey)
 
 getPackageKeyFromComposerName ($composerName)
 
 isPackageKeyValid ($packageKey)
 
 createPackage ($packageKey, \TYPO3\Flow\Package\MetaData $packageMetaData=NULL, $packagesPath=NULL, $packageType='typo3-flow-package')
 
 deactivatePackage ($packageKey)
 
 activatePackage ($packageKey)
 
 freezePackage ($packageKey)
 
 isPackageFrozen ($packageKey)
 
 unfreezePackage ($packageKey)
 
 refreezePackage ($packageKey)
 
 registerPackage (PackageInterface $package, $sortAndSave=TRUE)
 
 unregisterPackage (PackageInterface $package)
 
 deletePackage ($packageKey)
 

Protected Member Functions

 getPackageFactory ()
 
 getCacheIdentifier ()
 
 getCacheEntryIdentifier ()
 
 saveToPackageCache ()
 
 loadPackageManagerStatesFromCache ()
 
 loadPackageStates ()
 
 initializePackageObjects ()
 
 initializeCompatibilityLoadedExtArray ()
 
 findComposerManifestPaths ($packagePath)
 
 registerPackagesFromConfiguration ($registerOnlyNewPackages=FALSE)
 
 unregisterPackageByPackageKey ($packageKey)
 
 sortAvailablePackagesByDependencies ()
 
 resolvePackageDependencies ()
 
 getSuggestionArrayForPackage ($packageKey)
 
 sortAndSavePackageStates ()
 
- Protected Member Functions inherited from TYPO3\Flow\Package\PackageManager
 writeComposerManifest ($manifestPath, $packageKey, \TYPO3\Flow\Package\MetaData $packageMetaData=NULL)
 
 unregisterPackageByPackageKey ($packageKey)
 
 loadPackageStates ()
 
 scanAvailablePackages ()
 
 findComposerManifestPaths ($packagePath)
 
 scanPackagesInPath ($startPath, array &$collectedPackagePaths=array())
 
 registerPackagesFromConfiguration ()
 
 sortAndSavePackageStates ()
 
 resolvePackageDependencies ()
 
 getDependencyArrayForPackage ($packageKey, array &$dependentPackageKeys=array(), array $trace=array())
 
 sortAvailablePackagesByDependencies ()
 

Protected Attributes

 $classLoader
 
 $dependencyResolver
 
 $bootstrap
 
 $coreCache
 
 $cacheIdentifier
 
 $extAutoloadClassFiles
 
 $packagesBasePaths = array()
 
 $packageAliasMap = array()
 
 $requiredPackageKeys = array()
 
 $runtimeActivatedPackages = array()
 
 $packagesBasePath = PATH_site
 
- Protected Attributes inherited from TYPO3\Flow\Package\PackageManager
 $classLoader
 
 $bootstrap
 
 $packageFactory
 
 $packages = array()
 
 $packageKeys = array()
 
 $composerNameToPackageKeyMap = array()
 
 $activePackages = array()
 
 $packagesBasePath = FLOW_PATH_PACKAGES
 
 $packageStatesPathAndFilename
 
 $packageStatesConfiguration = array()
 
 $settings
 
 $systemLogger
 

Additional Inherited Members

- Static Public Member Functions inherited from TYPO3\Flow\Package\PackageManager
static getComposerManifest ($manifestPath, $key=NULL, $composerManifest=NULL)
 

Detailed Description

The default TYPO3 Package Manager Adapted from FLOW for TYPO3 CMS

("singleton")

Definition at line 23 of file PackageManager.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Core\Package\PackageManager::__construct ( )

Constructor

Definition at line 84 of file PackageManager.php.

Member Function Documentation

◆ activatePackage()

TYPO3\CMS\Core\Package\PackageManager::activatePackage (   $packageKey)
Parameters
string$packageKey

Implements TYPO3\Flow\Package\PackageManagerInterface.

Definition at line 615 of file PackageManager.php.

References TYPO3\CMS\Core\Package\PackageManager\getPackage().

◆ activatePackageDuringRuntime()

TYPO3\CMS\Core\Package\PackageManager::activatePackageDuringRuntime (   $packageKey)

Enables packages during runtime, but no class aliases will be available

Parameters
string$packageKey

Definition at line 627 of file PackageManager.php.

References $GLOBALS, and TYPO3\CMS\Core\Package\PackageManager\getPackage().

◆ deactivatePackage()

TYPO3\CMS\Core\Package\PackageManager::deactivatePackage (   $packageKey)
Parameters
string$packageKey

Implements TYPO3\Flow\Package\PackageManagerInterface.

Definition at line 607 of file PackageManager.php.

References TYPO3\CMS\Core\Package\PackageManager\getPackage().

◆ deletePackage()

TYPO3\CMS\Core\Package\PackageManager::deletePackage (   $packageKey)
Parameters
string$packageKey

Implements TYPO3\Flow\Package\PackageManagerInterface.

Definition at line 641 of file PackageManager.php.

References TYPO3\CMS\Core\Package\PackageManager\getPackage().

◆ findComposerManifestPaths()

TYPO3\CMS\Core\Package\PackageManager::findComposerManifestPaths (   $packagePath)
protected

Looks for composer.json in the given path and returns a path or NULL.

Parameters
string$packagePath
Returns
array

Definition at line 426 of file PackageManager.php.

◆ freezePackage()

TYPO3\CMS\Core\Package\PackageManager::freezePackage (   $packageKey)
Parameters
string$packageKey

Implements TYPO3\Flow\Package\PackageManagerInterface.

Definition at line 650 of file PackageManager.php.

References TYPO3\CMS\Core\Package\PackageManager\getPackage().

◆ getActivePackages()

TYPO3\CMS\Core\Package\PackageManager::getActivePackages ( )

Returns an array of objects of all active packages. A package is active, if it is available and has been activated in the package manager settings. This method returns runtime activated packages too

Returns
[]

Implements TYPO3\Flow\Package\PackageManagerInterface.

Definition at line 688 of file PackageManager.php.

◆ getCacheEntryIdentifier()

◆ getCacheIdentifier()

TYPO3\CMS\Core\Package\PackageManager::getCacheIdentifier ( )
protected

◆ getExtAutoloadRegistry()

TYPO3\CMS\Core\Package\PackageManager::getExtAutoloadRegistry ( )

◆ getPackage()

◆ getPackageFactory()

TYPO3\CMS\Core\Package\PackageManager::getPackageFactory ( )
protected

◆ getPackageKeyFromComposerName()

TYPO3\CMS\Core\Package\PackageManager::getPackageKeyFromComposerName (   $composerName)

Resolves a Flow package key from a composer package name.

Parameters
string$composerName
Returns
string
Exceptions

Definition at line 528 of file PackageManager.php.

◆ getSuggestionArrayForPackage()

TYPO3\CMS\Core\Package\PackageManager::getSuggestionArrayForPackage (   $packageKey)
protected

Returns an array of suggested package keys for the given package.

Parameters
string$packageKeyThe package key to fetch the suggestions for
Returns
array|NULL An array of directly suggested packages

Definition at line 734 of file PackageManager.php.

Referenced by TYPO3\CMS\Core\Package\PackageManager\resolvePackageDependencies().

◆ initializeCompatibilityLoadedExtArray()

TYPO3\CMS\Core\Package\PackageManager::initializeCompatibilityLoadedExtArray ( )
protected

Initializes a backwards compatibility $GLOBALS['TYPO3_LOADED_EXT'] array

Returns
void

Definition at line 312 of file PackageManager.php.

References $GLOBALS.

Referenced by TYPO3\CMS\Core\Package\PackageManager\injectDependencyResolver(), and TYPO3\CMS\Core\Package\PackageManager\sortAndSavePackageStates().

◆ initializePackageObjects()

TYPO3\CMS\Core\Package\PackageManager::initializePackageObjects ( )
protected

Initializes activePackages and requiredPackageKeys properties

Saves PackageStates.php if list of required extensions has changed.

Returns
void

Definition at line 284 of file PackageManager.php.

References TYPO3\Flow\Package\PackageManager\$activePackages, and TYPO3\CMS\Core\Package\PackageManager\sortAndSavePackageStates().

Referenced by TYPO3\CMS\Core\Package\PackageManager\injectDependencyResolver().

◆ injectClassLoader()

TYPO3\CMS\Core\Package\PackageManager::injectClassLoader ( \TYPO3\CMS\Core\Core\ClassLoader  $classLoader)
Parameters
\TYPO3\CMS\Core\Core\ClassLoader$classLoader

Definition at line 100 of file PackageManager.php.

References TYPO3\CMS\Core\Package\PackageManager\$classLoader.

◆ injectCoreCache()

TYPO3\CMS\Core\Package\PackageManager::injectCoreCache ( \TYPO3\CMS\Core\Cache\Frontend\PhpFrontend  $coreCache)
Parameters
\TYPO3\CMS\Core\Cache\Frontend\PhpFrontend$coreCache

Definition at line 107 of file PackageManager.php.

References TYPO3\CMS\Core\Package\PackageManager\$coreCache.

◆ injectDependencyResolver()

◆ isPackageActive()

TYPO3\CMS\Core\Package\PackageManager::isPackageActive (   $packageKey)

Returns TRUE if a package is activated or FALSE if it's not.

Parameters
string$packageKeyThe key of the package to check
Returns
boolean TRUE if package is active, otherwise FALSE

Implements TYPO3\Flow\Package\PackageManagerInterface.

Definition at line 597 of file PackageManager.php.

◆ isPackageAvailable()

TYPO3\CMS\Core\Package\PackageManager::isPackageAvailable (   $packageKey)

Returns TRUE if a package is available (the package's files exist in the packages directory) or FALSE if it's not. If a package is available it doesn't mean necessarily that it's active!

Parameters
string$packageKeyThe key of the package to check
Returns
boolean TRUE if the package is available, otherwise FALSE

Implements TYPO3\Flow\Package\PackageManagerInterface.

Definition at line 583 of file PackageManager.php.

Referenced by TYPO3\CMS\Core\Package\PackageManager\registerPackagesFromConfiguration().

◆ isPackageFrozen()

TYPO3\CMS\Core\Package\PackageManager::isPackageFrozen (   $packageKey)
Parameters
string$packageKey
Returns
bool

Implements TYPO3\Flow\Package\PackageManagerInterface.

Definition at line 659 of file PackageManager.php.

References TYPO3\CMS\Core\Package\PackageManager\getPackage().

◆ isPackageKeyValid()

TYPO3\CMS\Core\Package\PackageManager::isPackageKeyValid (   $packageKey)

Check the conformance of the given package key

Parameters
string$packageKeyThe package key to validate
Returns
boolean If the package key is valid, returns TRUE otherwise FALSE

Implements TYPO3\Flow\Package\PackageManagerInterface.

Definition at line 772 of file PackageManager.php.

References TYPO3\CMS\Core\Package\Package\PATTERN_MATCH_EXTENSIONKEY.

Referenced by TYPO3\CMS\Core\Package\PackageManager\scanAvailablePackages().

◆ loadPackageManagerStatesFromCache()

TYPO3\CMS\Core\Package\PackageManager::loadPackageManagerStatesFromCache ( )
protected

Attempts to load the package manager states from cache

Exceptions
Exception

Definition at line 238 of file PackageManager.php.

References $GLOBALS, and TYPO3\CMS\Core\Package\PackageManager\getCacheEntryIdentifier().

Referenced by TYPO3\CMS\Core\Package\PackageManager\injectDependencyResolver().

◆ loadPackageStates()

TYPO3\CMS\Core\Package\PackageManager::loadPackageStates ( )
protected

Loads the states of available packages from the PackageStates.php file. The result is stored in $this->packageStatesConfiguration.

Exceptions
Exception

Definition at line 265 of file PackageManager.php.

References TYPO3\Flow\Package\PackageManager\registerPackagesFromConfiguration().

Referenced by TYPO3\CMS\Core\Package\PackageManager\injectDependencyResolver().

◆ refreezePackage()

TYPO3\CMS\Core\Package\PackageManager::refreezePackage (   $packageKey)
Parameters
string$packageKey

Implements TYPO3\Flow\Package\PackageManagerInterface.

Definition at line 675 of file PackageManager.php.

References TYPO3\CMS\Core\Package\PackageManager\getPackage().

◆ registerPackage()

TYPO3\CMS\Core\Package\PackageManager::registerPackage ( \TYPO3\Flow\Package\PackageInterface  $package,
  $sortAndSave = TRUE 
)

Register a native Flow package

Parameters
\TYPO3\Flow\Package\PackageInterface$packageThe Package to be registered
boolean$sortAndSaveallows for not saving packagestates when used in loops etc.
Returns
Exceptions

Definition at line 489 of file PackageManager.php.

Referenced by TYPO3\CMS\Core\Package\PackageManager\registerPackagesFromConfiguration().

◆ registerPackagesFromConfiguration()

TYPO3\CMS\Core\Package\PackageManager::registerPackagesFromConfiguration (   $registerOnlyNewPackages = FALSE)
protected

◆ resolvePackageDependencies()

TYPO3\CMS\Core\Package\PackageManager::resolvePackageDependencies ( )
protected

Resolves the dependent packages from the meta data of all packages recursively. The resolved direct or indirect dependencies of each package will put into the package states configuration array.

Returns
void

Definition at line 721 of file PackageManager.php.

References TYPO3\CMS\Core\Package\PackageManager\getSuggestionArrayForPackage().

Referenced by TYPO3\CMS\Core\Package\PackageManager\sortAvailablePackagesByDependencies().

◆ saveToPackageCache()

TYPO3\CMS\Core\Package\PackageManager::saveToPackageCache ( )
protected

◆ scanAvailablePackages()

◆ sortAndSavePackageStates()

TYPO3\CMS\Core\Package\PackageManager::sortAndSavePackageStates ( )
protected

◆ sortAvailablePackagesByDependencies()

TYPO3\CMS\Core\Package\PackageManager::sortAvailablePackagesByDependencies ( )
protected

Orders all packages by comparing their dependencies. By this, the packages and package configurations arrays holds all packages in the correct initialization order.

Returns
void

Definition at line 699 of file PackageManager.php.

References TYPO3\CMS\Core\Package\PackageManager\resolvePackageDependencies().

◆ unfreezePackage()

TYPO3\CMS\Core\Package\PackageManager::unfreezePackage (   $packageKey)
Parameters
string$packageKey

Implements TYPO3\Flow\Package\PackageManagerInterface.

Definition at line 667 of file PackageManager.php.

References TYPO3\CMS\Core\Package\PackageManager\getPackage().

◆ unregisterPackageByPackageKey()

TYPO3\CMS\Core\Package\PackageManager::unregisterPackageByPackageKey (   $packageKey)
protected

Unregisters a package from the list of available packages

Parameters
string$packageKeyPackage Key of the package to be unregistered
Returns
void

Definition at line 505 of file PackageManager.php.

References TYPO3\CMS\Core\Package\PackageManager\getPackage().

Referenced by TYPO3\CMS\Core\Package\PackageManager\registerPackagesFromConfiguration().

Member Data Documentation

◆ $bootstrap

TYPO3\CMS\Core\Package\PackageManager::$bootstrap
protected

◆ $cacheIdentifier

◆ $classLoader

TYPO3\CMS\Core\Package\PackageManager::$classLoader
protected

◆ $coreCache

TYPO3\CMS\Core\Package\PackageManager::$coreCache
protected

◆ $dependencyResolver

TYPO3\CMS\Core\Package\PackageManager::$dependencyResolver
protected

◆ $extAutoloadClassFiles

TYPO3\CMS\Core\Package\PackageManager::$extAutoloadClassFiles
protected

◆ $packageAliasMap

TYPO3\CMS\Core\Package\PackageManager::$packageAliasMap = array()
protected

Definition at line 63 of file PackageManager.php.

◆ $packagesBasePath

TYPO3\CMS\Core\Package\PackageManager::$packagesBasePath = PATH_site
protected

◆ $packagesBasePaths

TYPO3\CMS\Core\Package\PackageManager::$packagesBasePaths = array()
protected

Definition at line 58 of file PackageManager.php.

◆ $requiredPackageKeys

TYPO3\CMS\Core\Package\PackageManager::$requiredPackageKeys = array()
protected

Definition at line 68 of file PackageManager.php.

◆ $runtimeActivatedPackages

TYPO3\CMS\Core\Package\PackageManager::$runtimeActivatedPackages = array()
protected

Definition at line 73 of file PackageManager.php.