PHP Class PPI\Framework\Module\AbstractModule

Author: Paul Dragoonis ([email protected])
Inheritance: implements PPI\Framework\Module\ModuleInterface, implements Zend\ModuleManager\Feature\ConfigProviderInterface
Exibir arquivo Open project: ppi/framework

Protected Properties

Property Type Description
$config null
$configLoader null | PPI\Framework\Config\ConfigLoader Configuration loader.
$name The Module name.
$reflected ReflectionObject
$routes null
$services null

Public Methods

Method Description
getCommandsPath ( ) : string Returns the default location of where Command classes are registered.
getConfig ( ) : array | Traversable Returns configuration to merge with application configuration.
getName ( ) : string Returns the module name. Defaults to the module namespace stripped of backslashes.
getNamespace ( ) : string Gets the Module namespace.
getPath ( ) : string Gets the Module directory path.
getService ( string $serviceName ) : mixed Get a particular service.
getServices ( ) : array Get the services.
loadConfig ( string $resource, null | string $type = null ) : array Loads a configuration file (PHP, YAML) or PHP array.
mergeConfig ( mixed $resources ) : array Loads and merges the configuration.
registerCommands ( PPI\Framework\Console\Application $application ) Finds and registers Commands.
setName ( string $Name ) Set the module name.
setServices ( string $services ) : Module Set services for our module.

Protected Methods

Method Description
getConfigLoader ( ) : ConfigLoader Returns a ConfigLoader instance.
loadAuraRoutes ( string $path ) : Aura\Router\Router
loadFastRouteRoutes ( $path ) : PPI\FastRoute\Wrapper\FastRouteWrapper
loadLaravelRoutes ( string $path ) : Aura\Router\Router
loadSymfonyRoutes ( string $path ) : RouteCollection Load up our routes.
loadYamlConfig ( string $path ) : array Load up our config results from the specific yaml file.
loadYamlRoutes ( string $path ) : RouteCollection Load up our routes.

Method Details

getCommandsPath() public method

Override this in your child module if it differs from this default convention.
public getCommandsPath ( ) : string
return string

getConfig() public method

Returns configuration to merge with application configuration.
public getConfig ( ) : array | Traversable
return array | Traversable

getConfigLoader() protected method

Returns a ConfigLoader instance.
protected getConfigLoader ( ) : ConfigLoader
return PPI\Framework\Config\ConfigLoader

getName() public method

Returns the module name. Defaults to the module namespace stripped of backslashes.
public getName ( ) : string
return string The Module name

getNamespace() public method

Gets the Module namespace.
public getNamespace ( ) : string
return string The Module namespace

getPath() public method

Gets the Module directory path.
public getPath ( ) : string
return string The Module absolute path

getService() public method

Get a particular service.
public getService ( string $serviceName ) : mixed
$serviceName string
return mixed

getServices() public method

Get the services.
public getServices ( ) : array
return array

loadAuraRoutes() protected method

protected loadAuraRoutes ( string $path ) : Aura\Router\Router
$path string
return Aura\Router\Router

loadConfig() public method

Loads a configuration file (PHP, YAML) or PHP array.
public loadConfig ( string $resource, null | string $type = null ) : array
$resource string The resource
$type null | string The resource type
return array

loadFastRouteRoutes() protected method

protected loadFastRouteRoutes ( $path ) : PPI\FastRoute\Wrapper\FastRouteWrapper
$path
return PPI\FastRoute\Wrapper\FastRouteWrapper

loadLaravelRoutes() protected method

protected loadLaravelRoutes ( string $path ) : Aura\Router\Router
$path string
return Aura\Router\Router

loadSymfonyRoutes() protected method

Load up our routes.
protected loadSymfonyRoutes ( string $path ) : RouteCollection
$path string
return Symfony\Component\Routing\RouteCollection

loadYamlConfig() protected method

Load up our config results from the specific yaml file.
Deprecation: since version 2.1, to be removed in 2.2. Use "loadConfig()" instead.
protected loadYamlConfig ( string $path ) : array
$path string
return array

loadYamlRoutes() protected method

Load up our routes.
Deprecation: Please use loadSymfonyRoutes instead
protected loadYamlRoutes ( string $path ) : RouteCollection
$path string
return Symfony\Component\Routing\RouteCollection

mergeConfig() public method

Loads and merges the configuration.
public mergeConfig ( mixed $resources ) : array
$resources mixed
return array

registerCommands() public method

Override this method if your module commands do not follow the conventions: * Commands are in the 'Command' sub-directory * Commands extend PPI\Framework\Console\Command\AbstractCommand
public registerCommands ( PPI\Framework\Console\Application $application )
$application PPI\Framework\Console\Application An Application instance

setName() public method

Set the module name.
public setName ( string $Name )
$Name string

setServices() public method

Set services for our module.
public setServices ( string $services ) : Module
$services string
return Module

Property Details

$config protected_oe property

protected null $config
return null

$configLoader protected_oe property

Configuration loader.
protected null|ConfigLoader,PPI\Framework\Config $configLoader
return null | PPI\Framework\Config\ConfigLoader

$name protected_oe property

The Module name.
protected $name

$reflected protected_oe property

protected ReflectionObject $reflected
return ReflectionObject

$routes protected_oe property

protected null $routes
return null

$services protected_oe property

protected null $services
return null