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

Public Member Functions

 __construct (PackageManagerInterface $packageManager)
 
 create ($packagesBasePath, $packagePath, $packageKey, $classesPath, $manifestPath='')
 

Static Public Member Functions

static getPackageKeyFromManifest ($manifest, $packagePath, $packagesBasePath)
 

Protected Attributes

 $packageManager
 

Detailed Description

Class for building Packages

Definition at line 19 of file PackageFactory.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\Flow\Package\PackageFactory::__construct ( PackageManagerInterface  $packageManager)

Constructor

Parameters
\TYPO3\Flow\Package\PackageManagerInterface$packageManager

Definition at line 31 of file PackageFactory.php.

References TYPO3\Flow\Package\PackageFactory\$packageManager.

Member Function Documentation

◆ create()

TYPO3\CMS\Core\Package\PackageFactory::create (   $packagesBasePath,
  $packagePath,
  $packageKey,
  $classesPath,
  $manifestPath = '' 
)

Returns a package instance.

Parameters
string$packagesBasePaththe base install path of packages,
string$packagePathpath to package, relative to base path
string$packageKeykey / name of the package
string$classesPathpath to the classes directory, relative to the package path
string$manifestPathpath to the package's Composer manifest, relative to package path, defaults to same path
Returns
Exceptions
Exception
Todo:
there should be a general method for getting Namespace from $packageKey
Todo:
it should be tested if the package class implements the interface

Definition at line 46 of file PackageFactory.php.

References TYPO3\Flow\Utility\Files\concatenatePaths().

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

◆ getPackageKeyFromManifest()

static TYPO3\Flow\Package\PackageFactory::getPackageKeyFromManifest (   $manifest,
  $packagePath,
  $packagesBasePath 
)
static

Resolves package key from Composer manifest

If it is a Flow package the name of the containing directory will be used.

Else if the composer name of the package matches the first part of the lowercased namespace of the package, the mixed case version of the composer name / namespace will be used, with backslashes replaced by dots.

Else the composer name will be used with the slash replaced by a dot

Parameters
object$manifest
string$packagesBasePath
Returns
string
Todo:
check that manifest name and directory follows convention

Definition at line 82 of file PackageFactory.php.

Referenced by TYPO3\Flow\Package\PackageManager\scanAvailablePackages().

Member Data Documentation

◆ $packageManager

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

Definition at line 24 of file PackageFactory.php.

Referenced by TYPO3\Flow\Package\PackageFactory\__construct().