PHP Class Neos\Flow\Package\Package

Inheritance: implements Neos\Flow\Package\PackageInterface
Mostra file Open project: neos/flow-development-collection Class Usage Examples

Protected Properties

Property Type Description
$autoloadConfiguration array
$autoloadTypes string[]
$composerName string composer name for this package
$flattenedAutoloadConfiguration array
$namespace string The namespace of the classes contained in this package
$namespaces string[] Array of all declared autoload namespaces contained in this package
$objectManagementEnabled boolean Disable this flag if you don't need object management for your package and want to save some memory.
$packageKey string Unique key of this package. Example for the Flow package: "Neos.Flow"
$packagePath string Full path to this package's main directory
$protected boolean If this package is protected and therefore cannot be deactivated or deleted

Public Methods

Method Description
__construct ( string $packageKey, string $composerName, string $packagePath, array $autoloadConfiguration = [] ) Constructor
boot ( Bootstrap $bootstrap ) : void Invokes custom PHP code directly after the package manager has been initialized.
getAutoloadConfiguration ( ) : array Get the autoload configuration for this package. Any valid composer "autoload" configuration.
getAutoloadPaths ( ) : array
getAutoloadTypes ( ) : string[]
getClassFiles ( ) : Generator Returns the array of filenames of the class files
getComposerManifest ( string $key = null ) : array | mixed Returns contents of Composer manifest - or part there of.
getComposerName ( ) : string Returns the packages composer name
getConfigurationPath ( ) : string Returns the full path to this package's Configuration directory
getFlattenedAutoloadConfiguration ( ) : array Get a flattened array of autoload configurations that have a predictable pattern (PSR-0, PSR-4)
getFunctionalTestsClassFiles ( ) : array Returns the array of filenames of class files provided by functional tests contained in this package
getFunctionalTestsPath ( ) : string Returns the full path to this package's functional tests directory
getInstalledVersion ( ) : string Get the installed package version (from composer) and as fallback the version given by composer manifest.
getNamespaces ( ) : array Returns array of all declared autoload namespaces contained in this package
getPackageKey ( ) : string Returns the package key of this package.
getPackagePath ( ) : string Returns the full path to this package's main directory
getResourcesPath ( ) : string Returns the full path to this package's Resources directory
isObjectManagementEnabled ( ) : boolean Tells if files in the Classes directory should be registered and object management enabled for this package.
isProtected ( ) : boolean Tells if this package is protected and therefore cannot be deactivated or deleted
setProtected ( boolean $protected ) : void Sets the protection flag of the package

Protected Methods

Method Description
explodeAutoloadConfiguration ( ) : void Brings the composer autoload configuration into an easy to use format for various parts of Flow.
getClassesInNormalizedAutoloadPath ( string $baseAutoloadPath, string $autoloadNamespace ) : Generator
isPathAutoloadEntryPoint ( string $path ) : boolean
normalizeAutoloadPath ( string $autoloadType, string $autoloadNamespace, string $autoloadPath ) : string

Method Details

__construct() public method

Constructor
public __construct ( string $packageKey, string $composerName, string $packagePath, array $autoloadConfiguration = [] )
$packageKey string Key of this package
$composerName string
$packagePath string Absolute path to the location of the package's composer manifest
$autoloadConfiguration array

boot() public method

Invokes custom PHP code directly after the package manager has been initialized.
public boot ( Bootstrap $bootstrap ) : void
$bootstrap Neos\Flow\Core\Bootstrap The current bootstrap
return void

explodeAutoloadConfiguration() protected method

Brings the composer autoload configuration into an easy to use format for various parts of Flow.
protected explodeAutoloadConfiguration ( ) : void
return void

getAutoloadConfiguration() public method

Get the autoload configuration for this package. Any valid composer "autoload" configuration.
public getAutoloadConfiguration ( ) : array
return array

getAutoloadPaths() public method

public getAutoloadPaths ( ) : array
return array

getAutoloadTypes() public method

public getAutoloadTypes ( ) : string[]
return string[]

getClassFiles() public method

Returns the array of filenames of the class files
public getClassFiles ( ) : Generator
return Generator A Generator for class names (key) and their filename, including the absolute path.

getClassesInNormalizedAutoloadPath() protected method

protected getClassesInNormalizedAutoloadPath ( string $baseAutoloadPath, string $autoloadNamespace ) : Generator
$baseAutoloadPath string
$autoloadNamespace string
return Generator

getComposerManifest() public method

Returns contents of Composer manifest - or part there of.
public getComposerManifest ( string $key = null ) : array | mixed
$key string Optional. Only return the part of the manifest indexed by 'key'
return array | mixed

getComposerName() public method

Returns the packages composer name
public getComposerName ( ) : string
return string

getConfigurationPath() public method

Returns the full path to this package's Configuration directory
public getConfigurationPath ( ) : string
return string Path to this package's Configuration directory

getFlattenedAutoloadConfiguration() public method

Get a flattened array of autoload configurations that have a predictable pattern (PSR-0, PSR-4)
public getFlattenedAutoloadConfiguration ( ) : array
return array Keys: "namespace", "classPath", "mappingType"

getFunctionalTestsClassFiles() public method

Returns the array of filenames of class files provided by functional tests contained in this package
public getFunctionalTestsClassFiles ( ) : array
return array An array of class names (key) and their filename, including the relative path to the package's directory

getFunctionalTestsPath() public method

Returns the full path to this package's functional tests directory
public getFunctionalTestsPath ( ) : string
return string Path to this package's functional tests directory

getInstalledVersion() public method

Get the installed package version (from composer) and as fallback the version given by composer manifest.
public getInstalledVersion ( ) : string
return string

getNamespaces() public method

Returns array of all declared autoload namespaces contained in this package
public getNamespaces ( ) : array
return array

getPackageKey() public method

Returns the package key of this package.
public getPackageKey ( ) : string
return string

getPackagePath() public method

Returns the full path to this package's main directory
public getPackagePath ( ) : string
return string Path to this package's main directory

getResourcesPath() public method

Returns the full path to this package's Resources directory
public getResourcesPath ( ) : string
return string Path to this package's Resources directory

isObjectManagementEnabled() public method

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

isPathAutoloadEntryPoint() protected method

protected isPathAutoloadEntryPoint ( string $path ) : boolean
$path string
return boolean

isProtected() public method

Tells if this package is protected and therefore cannot be deactivated or deleted
public isProtected ( ) : boolean
return boolean

normalizeAutoloadPath() protected method

protected normalizeAutoloadPath ( string $autoloadType, string $autoloadNamespace, string $autoloadPath ) : string
$autoloadType string
$autoloadNamespace string
$autoloadPath string
return string

setProtected() public method

Sets the protection flag of the package
public setProtected ( boolean $protected ) : void
$protected boolean TRUE if the package should be protected, otherwise FALSE
return void

Property Details

$autoloadConfiguration protected_oe property

protected array $autoloadConfiguration
return array

$autoloadTypes protected_oe property

protected string[] $autoloadTypes
return string[]

$composerName protected_oe property

composer name for this package
protected string $composerName
return string

$flattenedAutoloadConfiguration protected_oe property

protected array $flattenedAutoloadConfiguration
return array

$namespace protected_oe property

The namespace of the classes contained in this package
protected string $namespace
return string

$namespaces protected_oe property

Array of all declared autoload namespaces contained in this package
protected string[] $namespaces
return string[]

$objectManagementEnabled protected_oe property

Disable this flag if you don't need object management for your package and want to save some memory.
protected bool $objectManagementEnabled
return boolean

$packageKey protected_oe property

Unique key of this package. Example for the Flow package: "Neos.Flow"
protected string $packageKey
return string

$packagePath protected_oe property

Full path to this package's main directory
protected string $packagePath
return string

$protected protected_oe property

If this package is protected and therefore cannot be deactivated or deleted
protected bool $protected
return boolean