TYPO3 CMS  TYPO3_7-6
TYPO3\CMS\Core\Package\Package Class Reference
Inheritance diagram for TYPO3\CMS\Core\Package\Package:
TYPO3\CMS\Core\Package\PackageInterface

Public Member Functions

 __construct (PackageManager $packageManager, $packageKey, $packagePath)
 
 isPartOfFactoryDefault ()
 
 isPartOfMinimalUsableSystem ()
 
 getPackageKey ()
 
 isProtected ()
 
 setProtected ($protected)
 
 getPackagePath ()
 
 getPackageMetaData ()
 
 getPackageReplacementKeys ()
 
 getValueFromComposerManifest ($key=null)
 
 __sleep ()
 
 __wakeup ()
 

Protected Member Functions

 loadFlagsFromComposerManifest ()
 

Protected Attributes

 $extensionManagerConfiguration = []
 
 $classAliases
 
 $partOfFactoryDefault = false
 
 $partOfMinimalUsableSystem = false
 
 $packageKey
 
 $packagePath
 
 $protected = false
 
 $composerManifest
 
 $packageMetaData
 
 $packageManager
 

Additional Inherited Members

- Public Attributes inherited from TYPO3\CMS\Core\Package\PackageInterface
const PATTERN_MATCH_PACKAGEKEY = '/^[a-z0-9]+\.(?:[a-z0-9][\.a-z0-9]*)+$/i'
 
const PATTERN_MATCH_EXTENSIONKEY = '/^[0-9a-z_-]+$/i'
 

Detailed Description

A Package representing the details of an extension and/or a composer package Adapted from FLOW for TYPO3 CMS

Definition at line 23 of file Package.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Core\Package\Package::__construct ( PackageManager  $packageManager,
  $packageKey,
  $packagePath 
)

Constructor

Parameters
PackageManager$packageManagerthe package manager which knows this package
string$packageKeyKey of this package
string$packagePathAbsolute path to the location of the package's composer manifest
Exceptions
Exception

Definition at line 95 of file Package.php.

References TYPO3\CMS\Core\Package\Package\$packageKey, TYPO3\CMS\Core\Package\Package\$packageManager, TYPO3\CMS\Core\Package\Package\$packagePath, TYPO3\CMS\Core\Package\PackageManager\getComposerManifest(), TYPO3\CMS\Core\Package\PackageManager\isPackageKeyValid(), and TYPO3\CMS\Core\Package\Package\loadFlagsFromComposerManifest().

Member Function Documentation

◆ __sleep()

TYPO3\CMS\Core\Package\Package::__sleep ( )

Added by TYPO3 CMS

The package caching serializes package objects. The package manager instance may not be serialized as a fresh instance is created upon every request.

This method will be removed once the package is released of the package manager dependency.

Returns
array

Definition at line 273 of file Package.php.

◆ __wakeup()

TYPO3\CMS\Core\Package\Package::__wakeup ( )

Added by TYPO3 CMS

The package caching deserializes package objects. A fresh package manager instance has to be set during bootstrapping.

This method will be removed once the package is released of the package manager dependency.

Definition at line 290 of file Package.php.

References $GLOBALS.

◆ getPackageKey()

TYPO3\CMS\Core\Package\Package::getPackageKey ( )

Returns the package key of this package.

Returns
string

Implements TYPO3\CMS\Core\Package\PackageInterface.

Definition at line 153 of file Package.php.

References TYPO3\CMS\Core\Package\Package\$packageKey.

Referenced by TYPO3\CMS\Core\Package\Package\getPackageMetaData().

◆ getPackageMetaData()

◆ getPackagePath()

TYPO3\CMS\Core\Package\Package::getPackagePath ( )

Returns the full path to this package's main directory

Returns
string Path to this package's main directory

Implements TYPO3\CMS\Core\Package\PackageInterface.

Definition at line 187 of file Package.php.

References TYPO3\CMS\Core\Package\Package\$packagePath.

◆ getPackageReplacementKeys()

TYPO3\CMS\Core\Package\Package::getPackageReplacementKeys ( )

Returns an array of packages this package replaces

Returns
array

Implements TYPO3\CMS\Core\Package\PackageInterface.

Definition at line 234 of file Package.php.

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

◆ getValueFromComposerManifest()

TYPO3\CMS\Core\Package\Package::getValueFromComposerManifest (   $key = null)

Returns contents of Composer manifest - or part there of if a key is given.

Parameters
string$keyOptional. Only return the part of the manifest indexed by 'key'
Returns
mixed|NULL
See also
json_decode for return values

Implements TYPO3\CMS\Core\Package\PackageInterface.

Definition at line 247 of file Package.php.

References TYPO3\CMS\Core\Package\Package\$composerManifest.

Referenced by TYPO3\CMS\Core\Package\Package\getPackageMetaData(), TYPO3\CMS\Core\Package\Package\getPackageReplacementKeys(), and TYPO3\CMS\Core\Package\Package\loadFlagsFromComposerManifest().

◆ isPartOfFactoryDefault()

TYPO3\CMS\Core\Package\Package::isPartOfFactoryDefault ( )

◆ isPartOfMinimalUsableSystem()

TYPO3\CMS\Core\Package\Package::isPartOfMinimalUsableSystem ( )

◆ isProtected()

TYPO3\CMS\Core\Package\Package::isProtected ( )

Tells if this package is protected and therefore cannot be deactivated or deleted

Returns
bool

Implements TYPO3\CMS\Core\Package\PackageInterface.

Definition at line 164 of file Package.php.

References TYPO3\CMS\Core\Package\Package\$protected.

◆ loadFlagsFromComposerManifest()

TYPO3\CMS\Core\Package\Package::loadFlagsFromComposerManifest ( )
protected

Loads package management related flags from the "extra:typo3/cms:Package" section of extensions composer.json files into local properties

Returns
void

Definition at line 119 of file Package.php.

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

Referenced by TYPO3\CMS\Core\Package\Package\__construct().

◆ setProtected()

TYPO3\CMS\Core\Package\Package::setProtected (   $protected)

Sets the protection flag of the package

Parameters
bool$protectedTRUE if the package should be protected, otherwise FALSE
Returns
void

Implements TYPO3\CMS\Core\Package\PackageInterface.

Definition at line 176 of file Package.php.

References TYPO3\CMS\Core\Package\Package\$protected.

Member Data Documentation

◆ $classAliases

TYPO3\CMS\Core\Package\Package::$classAliases
protected

Definition at line 33 of file Package.php.

◆ $composerManifest

TYPO3\CMS\Core\Package\Package::$composerManifest
protected

◆ $extensionManagerConfiguration

TYPO3\CMS\Core\Package\Package::$extensionManagerConfiguration = []
protected

Definition at line 28 of file Package.php.

◆ $packageKey

TYPO3\CMS\Core\Package\Package::$packageKey
protected

◆ $packageManager

TYPO3\CMS\Core\Package\Package::$packageManager
protected

Definition at line 83 of file Package.php.

Referenced by TYPO3\CMS\Core\Package\Package\__construct().

◆ $packageMetaData

TYPO3\CMS\Core\Package\Package::$packageMetaData
protected

Definition at line 78 of file Package.php.

Referenced by TYPO3\CMS\Core\Package\Package\getPackageMetaData().

◆ $packagePath

TYPO3\CMS\Core\Package\Package::$packagePath
protected

◆ $partOfFactoryDefault

TYPO3\CMS\Core\Package\Package::$partOfFactoryDefault = false
protected

Definition at line 41 of file Package.php.

Referenced by TYPO3\CMS\Core\Package\Package\isPartOfFactoryDefault().

◆ $partOfMinimalUsableSystem

TYPO3\CMS\Core\Package\Package::$partOfMinimalUsableSystem = false
protected

◆ $protected

TYPO3\CMS\Core\Package\Package::$protected = false
protected