‪TYPO3CMS  9.5
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)
 
bool isPartOfFactoryDefault ()
 
bool isPartOfMinimalUsableSystem ()
 
string getPackageKey ()
 
bool isProtected ()
 
 setProtected ($protected)
 
string getPackagePath ()
 
MetaData getPackageMetaData ()
 
array getPackageReplacementKeys ()
 
mixed null getValueFromComposerManifest ($key=null)
 

Protected Member Functions

 loadFlagsFromComposerManifest ()
 
 createPackageMetaData (PackageManager $packageManager)
 

Protected Attributes

array $extensionManagerConfiguration = array( )
 
bool $partOfFactoryDefault = false
 
bool $partOfMinimalUsableSystem = false
 
string $packageKey
 
string $packagePath
 
bool $protected = false
 
stdClass $composerManifest
 
MetaData $packageMetaData
 

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

Definition at line 20 of file Package.php.

Constructor & Destructor Documentation

◆ __construct()

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

Constructor

Parameters
PackageManager$packageManager‪the package manager which knows this package
string$packageKey‪Key of this package
string$packagePath‪Absolute path to the location of the package's composer manifest
Exceptions
Exception

Definition at line 74 of file Package.php.

References TYPO3\CMS\Core\Package\Package\$packageKey, TYPO3\CMS\Core\Package\Package\$packagePath, and TYPO3\CMS\Core\Package\Package\loadFlagsFromComposerManifest().

Member Function Documentation

◆ createPackageMetaData()

TYPO3\CMS\Core\Package\Package::createPackageMetaData ( PackageManager  $packageManager)
protected

Creates the package meta data object of this package.

Parameters
PackageManager$packageManager

Definition at line 113 of file Package.php.

◆ getPackageKey()

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

Returns the package key of this package.

Returns
‪string

Implements TYPO3\CMS\Core\Package\PackageInterface.

Definition at line 165 of file Package.php.

◆ getPackageMetaData()

MetaData TYPO3\CMS\Core\Package\Package::getPackageMetaData ( )

Returns the package meta data object of this package.

Returns
MetaData

Implements TYPO3\CMS\Core\Package\PackageInterface.

Definition at line 206 of file Package.php.

◆ getPackagePath()

string 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 195 of file Package.php.

◆ getPackageReplacementKeys()

array 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 217 of file Package.php.

◆ getValueFromComposerManifest()

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

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

Parameters
string$key‪Optional. 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 231 of file Package.php.

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

◆ isPartOfFactoryDefault()

bool TYPO3\CMS\Core\Package\Package::isPartOfFactoryDefault ( )
Returns
‪bool

Implements TYPO3\CMS\Core\Package\PackageInterface.

Definition at line 146 of file Package.php.

◆ isPartOfMinimalUsableSystem()

bool TYPO3\CMS\Core\Package\Package::isPartOfMinimalUsableSystem ( )
Returns
‪bool

Implements TYPO3\CMS\Core\Package\PackageInterface.

Definition at line 155 of file Package.php.

◆ isProtected()

bool 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 175 of file Package.php.

◆ 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

Definition at line 96 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$protected‪TRUE if the package should be protected, otherwise FALSE

Implements TYPO3\CMS\Core\Package\PackageInterface.

Definition at line 185 of file Package.php.

Member Data Documentation

◆ $composerManifest

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

Definition at line 57 of file Package.php.

◆ $extensionManagerConfiguration

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

Definition at line 24 of file Package.php.

◆ $packageKey

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

Unique key of this package.

Definition at line 43 of file Package.php.

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

◆ $packageMetaData

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

Meta information about this package

Definition at line 62 of file Package.php.

◆ $packagePath

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

Full path to this package's main directory

Definition at line 48 of file Package.php.

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

◆ $partOfFactoryDefault

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

If this package is part of factory default, it will be activated during first installation.

Definition at line 31 of file Package.php.

◆ $partOfMinimalUsableSystem

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

If this package is part of minimal usable system, it will be activated if PackageStates is created from scratch.

Definition at line 38 of file Package.php.

◆ $protected

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

If this package is protected and therefore cannot be deactivated or deleted

Definition at line 53 of file Package.php.