PHP Class Bolt\Extension\Manager

Author: Gawain Lynch ([email protected])
Show file Open project: bolt/bolt

Protected Properties

Property Type Description
$composerNames string[]
$extensions Bolt\Extension\ResolvedExtension[]

Public Methods

Method Description
__construct ( Bolt\Filesystem\FilesystemInterface $extensions, Bolt\Filesystem\FilesystemInterface $web, Bolt\Logger\FlashLoggerInterface $flashLogger, Config $config ) Constructor.
add ( Bolt\Extension\ExtensionInterface $extension, Bolt\Filesystem\Handler\DirectoryInterface $baseDir = null, Bolt\Filesystem\Handler\DirectoryInterface $webDir = null, string | null $composerName = null ) : Bolt\Extension\ResolvedExtension Add an extension to be registered.
addManagedExtensions ( ) Load a collection of extension classes.
all ( ) : Bolt\Extension\ResolvedExtension[] Get all installed extensions.
get ( string | null $id ) : Bolt\Extension\ExtensionInterface | null Get an installed extension class.
getResolved ( string | null $id ) : Bolt\Extension\ResolvedExtension | null Get the resolved form of an installed extension class.
register ( Silex\Application $app ) Call register() for each extension.

Protected Methods

Method Description
getApp ( )

Private Methods

Method Description
addManagedExtension ( Bolt\Composer\EventListener\PackageDescriptor $descriptor ) Load a single extension.
isClassLoadable ( string $className ) : boolean Check if a class is loadable.
loadPackageDescriptors ( ) : Bolt\Composer\EventListener\PackageDescriptor[] Load the extension autoload.json cache file and build the PackageDescriptor array.

Method Details

__construct() public method

Constructor.
public __construct ( Bolt\Filesystem\FilesystemInterface $extensions, Bolt\Filesystem\FilesystemInterface $web, Bolt\Logger\FlashLoggerInterface $flashLogger, Config $config )
$extensions Bolt\Filesystem\FilesystemInterface
$web Bolt\Filesystem\FilesystemInterface
$flashLogger Bolt\Logger\FlashLoggerInterface
$config Bolt\Config

add() public method

Add an extension to be registered.
public add ( Bolt\Extension\ExtensionInterface $extension, Bolt\Filesystem\Handler\DirectoryInterface $baseDir = null, Bolt\Filesystem\Handler\DirectoryInterface $webDir = null, string | null $composerName = null ) : Bolt\Extension\ResolvedExtension
$extension Bolt\Extension\ExtensionInterface
$baseDir Bolt\Filesystem\Handler\DirectoryInterface
$webDir Bolt\Filesystem\Handler\DirectoryInterface
$composerName string | null
return Bolt\Extension\ResolvedExtension

addManagedExtensions() public method

Load a collection of extension classes.

all() public method

Get all installed extensions.
public all ( ) : Bolt\Extension\ResolvedExtension[]
return Bolt\Extension\ResolvedExtension[]

get() public method

Get an installed extension class.
public get ( string | null $id ) : Bolt\Extension\ExtensionInterface | null
$id string | null The extension ID or composer name
return Bolt\Extension\ExtensionInterface | null

getApp() protected method

Deprecation: Deprecated since 3.0, to be removed in 4.0.
protected getApp ( )

getResolved() public method

Get the resolved form of an installed extension class.
public getResolved ( string | null $id ) : Bolt\Extension\ResolvedExtension | null
$id string | null The extension ID or composer name
return Bolt\Extension\ResolvedExtension | null

register() public method

Call register() for each extension.
public register ( Silex\Application $app )
$app Silex\Application

Property Details

$composerNames protected property

protected string[] $composerNames
return string[]

$extensions protected property

protected ResolvedExtension[],Bolt\Extension $extensions
return Bolt\Extension\ResolvedExtension[]