TYPO3 CMS  TYPO3_6-2
TYPO3\Flow\Package\Package Class Reference
Inheritance diagram for TYPO3\Flow\Package\Package:
TYPO3\Flow\Package\PackageInterface TYPO3\CMS\Core\Package\Package

Public Member Functions

 __construct (\TYPO3\Flow\Package\PackageManager $packageManager, $packageKey, $packagePath, $classesPath=NULL, $manifestPath='')
 
 boot (\TYPO3\Flow\Core\Bootstrap $bootstrap)
 
 getPackageMetaData ()
 
 getClassFiles ()
 
 getFunctionalTestsClassFiles ()
 
 getPackageKey ()
 
 getNamespace ()
 
 isProtected ()
 
 isObjectManagementEnabled ()
 
 setProtected ($protected)
 
 getPackagePath ()
 
 getManifestPath ()
 
 getClassesPath ()
 
 getClassesNamespaceEntryPath ()
 
 getFunctionalTestsPath ()
 
 getResourcesPath ()
 
 getConfigurationPath ()
 
 getMetaPath ()
 
 getDocumentationPath ()
 
 getPackageDocumentations ()
 
 getComposerManifest ($key=NULL)
 
 __sleep ()
 
 __wakeup ()
 

Protected Member Functions

 packageRequirementIsComposerPackage ($requirement)
 
 buildArrayOfClassFiles ($classesPath, $extraNamespaceSegment='', $subDirectory='', $recursionLevel=0)
 

Protected Attributes

 $packageKey
 
 $manifestPath
 
 $packagePath
 
 $classesPath
 
 $protected = FALSE
 
 $composerManifest
 
 $packageMetaData
 
 $classFiles
 
 $namespace
 
 $objectManagementEnabled = TRUE
 
 $packageManager
 

Additional Inherited Members

- Public Attributes inherited from TYPO3\Flow\Package\PackageInterface
const PATTERN_MATCH_PACKAGEKEY = '/^[a-z0-9]+\.(?:[a-z0-9][\.a-z0-9]*)+$/i'
 
const DIRECTORY_CLASSES = 'Classes/'
 
const DIRECTORY_CONFIGURATION = 'Configuration/'
 
const DIRECTORY_DOCUMENTATION = 'Documentation/'
 
const DIRECTORY_METADATA = 'Meta/'
 
const DIRECTORY_TESTS_FUNCTIONAL = 'Tests/Functional/'
 
const DIRECTORY_TESTS_UNIT = 'Tests/Unit/'
 
const DIRECTORY_RESOURCES = 'Resources/'
 

Detailed Description

A Package

Definition at line 21 of file Package.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\Flow\Package\Package::__construct ( \TYPO3\Flow\Package\PackageManager  $packageManager,
  $packageKey,
  $packagePath,
  $classesPath = NULL,
  $manifestPath = '' 
)

Constructor

Parameters
\TYPO3\Flow\Package\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
string$classesPathPath the classes of the package are in, relative to $packagePath. Optional, read from Composer manifest if not set.
string$manifestPathPath the composer manifest of the package, relative to $packagePath. Optional, defaults to ''.
Exceptions

Definition at line 101 of file Package.php.

References TYPO3\Flow\Package\Package\$classesPath, TYPO3\Flow\Package\Package\$manifestPath, TYPO3\Flow\Package\Package\$packageKey, TYPO3\Flow\Package\Package\$packageManager, TYPO3\Flow\Package\Package\$packagePath, TYPO3\Flow\Package\Package\getComposerManifest(), TYPO3\Flow\Package\Package\getNamespace(), TYPO3\Flow\Utility\Files\getNormalizedPath(), and TYPO3\Flow\Utility\Files\is_link().

Member Function Documentation

◆ __sleep()

TYPO3\Flow\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 451 of file Package.php.

◆ __wakeup()

TYPO3\Flow\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 467 of file Package.php.

References $GLOBALS.

◆ boot()

TYPO3\Flow\Package\Package::boot ( \TYPO3\Flow\Core\Bootstrap  $bootstrap)

Invokes custom PHP code directly after the package manager has been initialized.

Parameters
\TYPO3\Flow\Core\Bootstrap$bootstrapThe current bootstrap
Returns
void

Implements TYPO3\Flow\Package\PackageInterface.

Definition at line 135 of file Package.php.

◆ buildArrayOfClassFiles()

TYPO3\Flow\Package\Package::buildArrayOfClassFiles (   $classesPath,
  $extraNamespaceSegment = '',
  $subDirectory = '',
  $recursionLevel = 0 
)
protected

PathSegment

Parameters
string$subDirectoryUsed internally
integer$recursionLevelUsed internally
Returns
array
Exceptions

Definition at line 404 of file Package.php.

References TYPO3\Flow\Package\Package\$classesPath, and TYPO3\Flow\Package\Package\$classFiles.

Referenced by TYPO3\Flow\Package\Package\getClassFiles(), and TYPO3\Flow\Package\Package\getFunctionalTestsClassFiles().

◆ getClassesNamespaceEntryPath()

TYPO3\Flow\Package\Package::getClassesNamespaceEntryPath ( )

Returns the full path to the package's classes namespace entry path, e.g. "My.Package/ClassesPath/My/Package/"

Returns
string Path to this package's Classes directory

Implements TYPO3\Flow\Package\PackageInterface.

Definition at line 297 of file Package.php.

References TYPO3\Flow\Package\Package\getNamespace(), and TYPO3\Flow\Utility\Files\getNormalizedPath().

◆ getClassesPath()

TYPO3\Flow\Package\Package::getClassesPath ( )

Returns the full path to this package's Classes directory

Returns
string Path to this package's Classes directory

Implements TYPO3\Flow\Package\PackageInterface.

Definition at line 286 of file Package.php.

References TYPO3\Flow\Package\Package\$classesPath.

◆ getClassFiles()

TYPO3\Flow\Package\Package::getClassFiles ( )

Returns the array of filenames of the class files

Returns
array An array of class names (key) and their filename, including the relative path to the package's directory

Implements TYPO3\Flow\Package\PackageInterface.

Definition at line 180 of file Package.php.

References TYPO3\Flow\Package\Package\$classFiles, and TYPO3\Flow\Package\Package\buildArrayOfClassFiles().

◆ getComposerManifest()

TYPO3\Flow\Package\Package::getComposerManifest (   $key = NULL)

◆ getConfigurationPath()

TYPO3\Flow\Package\Package::getConfigurationPath ( )

Returns the full path to this package's Configuration directory

Returns
string Path to this package's Configuration directory

Implements TYPO3\Flow\Package\PackageInterface.

Definition at line 328 of file Package.php.

◆ getDocumentationPath()

TYPO3\Flow\Package\Package::getDocumentationPath ( )

Returns the full path to the package's documentation directory

Returns
string Full path to the package's documentation directory

Implements TYPO3\Flow\Package\PackageInterface.

Definition at line 348 of file Package.php.

Referenced by TYPO3\Flow\Package\Package\getPackageDocumentations().

◆ getFunctionalTestsClassFiles()

TYPO3\Flow\Package\Package::getFunctionalTestsClassFiles ( )

Returns the array of filenames of class files provided by functional tests contained in this package

Returns
array An array of class names (key) and their filename, including the relative path to the package's directory

Definition at line 192 of file Package.php.

References TYPO3\Flow\Package\Package\buildArrayOfClassFiles(), and TYPO3\Flow\Package\Package\getNamespace().

◆ getFunctionalTestsPath()

TYPO3\Flow\Package\Package::getFunctionalTestsPath ( )

Returns the full path to this package's functional tests directory

Returns
string Path to this package's functional tests directory

Definition at line 308 of file Package.php.

◆ getManifestPath()

TYPO3\Flow\Package\Package::getManifestPath ( )

Returns the full path to the packages Composer manifest

Returns
string

Definition at line 276 of file Package.php.

References TYPO3\Flow\Package\Package\$manifestPath.

Referenced by TYPO3\Flow\Package\Package\getComposerManifest().

◆ getMetaPath()

TYPO3\Flow\Package\Package::getMetaPath ( )

Returns the full path to the package's meta data directory

Returns
string Full path to the package's meta data directory

Implements TYPO3\Flow\Package\PackageInterface.

Definition at line 338 of file Package.php.

◆ getNamespace()

◆ getPackageDocumentations()

TYPO3\Flow\Package\Package::getPackageDocumentations ( )

Returns the available documentations for this package

Returns
array Array of

Implements TYPO3\Flow\Package\PackageInterface.

Definition at line 358 of file Package.php.

References TYPO3\Flow\Package\Package\getDocumentationPath().

◆ getPackageKey()

◆ getPackageMetaData()

◆ getPackagePath()

TYPO3\Flow\Package\Package::getPackagePath ( )

Returns the full path to this package's main directory

Returns
string Path to this package's main directory

Implements TYPO3\Flow\Package\PackageInterface.

Definition at line 267 of file Package.php.

References TYPO3\Flow\Package\Package\$packagePath.

◆ getResourcesPath()

TYPO3\Flow\Package\Package::getResourcesPath ( )

Returns the full path to this package's Resources directory

Returns
string Path to this package's Resources directory

Implements TYPO3\Flow\Package\PackageInterface.

Definition at line 318 of file Package.php.

◆ isObjectManagementEnabled()

TYPO3\Flow\Package\Package::isObjectManagementEnabled ( )

Tells if files in the Classes directory should be registered and object management enabled for this package.

Returns
boolean

Implements TYPO3\Flow\Package\PackageInterface.

Definition at line 246 of file Package.php.

References TYPO3\Flow\Package\Package\$objectManagementEnabled.

◆ isProtected()

TYPO3\Flow\Package\Package::isProtected ( )

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

Returns
boolean

Implements TYPO3\Flow\Package\PackageInterface.

Definition at line 237 of file Package.php.

References TYPO3\Flow\Package\Package\$protected.

◆ packageRequirementIsComposerPackage()

TYPO3\Flow\Package\Package::packageRequirementIsComposerPackage (   $requirement)
protected

Check whether the given package requirement (like "typo3/flow" or "php") is a composer package or not

Parameters
string$requirementthe composer requirement string
Returns
boolean TRUE if $requirement is a composer package (contains a slash), FALSE otherwise

Definition at line 171 of file Package.php.

Referenced by TYPO3\Flow\Package\Package\getPackageMetaData().

◆ setProtected()

TYPO3\Flow\Package\Package::setProtected (   $protected)

Sets the protection flag of the package

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

Implements TYPO3\Flow\Package\PackageInterface.

Definition at line 257 of file Package.php.

References TYPO3\Flow\Package\Package\$protected.

Member Data Documentation

◆ $classesPath

◆ $classFiles

TYPO3\Flow\Package\Package::$classFiles
protected

◆ $composerManifest

TYPO3\Flow\Package\Package::$composerManifest
protected

◆ $manifestPath

TYPO3\Flow\Package\Package::$manifestPath
protected

◆ $namespace

TYPO3\Flow\Package\Package::$namespace
protected

Definition at line 74 of file Package.php.

Referenced by TYPO3\Flow\Package\Package\getNamespace().

◆ $objectManagementEnabled

TYPO3\Flow\Package\Package::$objectManagementEnabled = TRUE
protected

Definition at line 82 of file Package.php.

Referenced by TYPO3\Flow\Package\Package\isObjectManagementEnabled().

◆ $packageKey

◆ $packageManager

TYPO3\Flow\Package\Package::$packageManager
protected

◆ $packageMetaData

TYPO3\Flow\Package\Package::$packageMetaData
protected

◆ $packagePath

TYPO3\Flow\Package\Package::$packagePath
protected

◆ $protected

TYPO3\Flow\Package\Package::$protected = FALSE
protected