ExtensionPackage
extends Package
in package
implements
PackageInterface, ViewComponentsInterface
Uses
ViewComponents, ConsoleCommands, Jobs, Actions, Middlewares, Drivers
Extension Package
Table of Contents
Interfaces
- PackageInterface
- Package interface, all packages type should impelement it.
- ViewComponentsInterface
- Package view components interface
Constants
Properties
- $packageRegistry : PackageRegistryInterface|null
- Package Registry Interface
- $path : string
- Package root path
- $properties : CollectionInterface
- Package properties
- $viewPath : string|null
- View path
- $typeName : array<string|int, mixed>
- Extension types
Methods
- __construct() : mixed
- Constructor
- disable() : bool
- Disable extension
- enable() : bool
- Enable extension
- getActionsPath() : string
- Get package actions path
- getComponentPath() : string
- Get component path
- getComponents() : array<string|int, mixed>
- Scan directory and return components list
- getComponentsPath() : string
- Get components path
- getComponentsRecursive() : array<string|int, mixed>
- Scan directory and return components list
- getConsoleCommands() : array<string|int, mixed>
- Get package console commands
- getDrivers() : array<string|int, mixed>
- Get drivers classes list
- getDriversPath() : string
- Get module drivers path
- getEmails() : array<string|int, mixed>
- Scan directory and return emails list
- getEmailsPath() : string
- Get emails components path
- getInstalOrder() : mixed
- Get install order
- getJobsPath() : string
- Get extension jobs path
- getLanguages() : array<string|int, mixed>|null
- Get suppported languages
- getMacros() : array<string|int, mixed>
- Scan directory and return macros list
- getMacrosPath() : string
- Get macros path
- getMiddlewaresPath() : string
- Get extension middlewares path
- getModels() : array<string|int, mixed>
- Get extension models.
- getModelsPath() : string
- Get extension model path
- getModelsSchemaPath() : string
- Get extension models schema path
- getName() : string
- Return package name
- getPackageActions() : array<string|int, mixed>
- Get package actions
- getPackageJobs() : array<string|int, mixed>
- Get extension jobs
- getPackageMiddlewares() : array<string|int, mixed>
- Get extension middlewares
- getPages() : array<string|int, mixed>
- Scan directory and return pages list
- getPagesPath() : string
- Get pages path
- getPath() : string
- Get package root path
- getProperties() : Collection
- Get extension package properties
- getProperty() : mixed
- Get package property
- getRequire() : CollectionInterface
- Get require property
- getSubscribersPath() : string
- Get extension subscribers path.
- getType() : string|null
- Get package type
- getTypeId() : int|false
- Return extension type id
- getVersion() : string
- Get Package version
- getViewPath() : string
- Get view path
- install() : mixed|true
- Install extension package
- isInstalled() : bool
- Return true if package is installed
- postInstall() : bool
- Run post install actions
- registerEventsSubscribers() : int
- Register event subscribers
- savePackageProperties() : bool
- Save package properties file
- setPrimary() : bool
- Set package as primary
- unInstall() : bool
- Uninstall extension package
- validate() : bool
- Validate package properties
- validator() : PackageValidator
- Create package validator
Constants
SYSTEM
public
mixed
SYSTEM
= 1
USER
Extension type
public
mixed
USER
= 0
Properties
$packageRegistry
Package Registry Interface
protected
PackageRegistryInterface|null
$packageRegistry
$path
Package root path
protected
string
$path
$properties
Package properties
protected
CollectionInterface
$properties
$viewPath
View path
protected
string|null
$viewPath
$typeName
Extension types
private
array<string|int, mixed>
$typeName
= ['user', 'system']
Methods
__construct()
Constructor
public
__construct(string $path, CollectionInterface $properties[, PackageRegistryInterface|null $packageRegistry = null ]) : mixed
Parameters
- $path : string
- $properties : CollectionInterface
- $packageRegistry : PackageRegistryInterface|null = null
disable()
Disable extension
public
disable() : bool
Return values
boolenable()
Enable extension
public
enable() : bool
Return values
boolgetActionsPath()
Get package actions path
public
getActionsPath() : string
Return values
stringgetComponentPath()
Get component path
public
getComponentPath(string|null $componentName[, string $type = 'components' ]) : string
Parameters
- $componentName : string|null
- $type : string = 'components'
Return values
stringgetComponents()
Scan directory and return components list
public
getComponents([string|null $parent = null ][, string $type = 'components' ]) : array<string|int, mixed>
Parameters
- $parent : string|null = null
- $type : string = 'components'
Return values
array<string|int, mixed>getComponentsPath()
Get components path
public
getComponentsPath() : string
Return values
stringgetComponentsRecursive()
Scan directory and return components list
public
getComponentsRecursive([string|null $path = null ]) : array<string|int, mixed>
Parameters
- $path : string|null = null
Return values
array<string|int, mixed>getConsoleCommands()
Get package console commands
public
getConsoleCommands() : array<string|int, mixed>
Return values
array<string|int, mixed>getDrivers()
Get drivers classes list
public
getDrivers() : array<string|int, mixed>
Return values
array<string|int, mixed>getDriversPath()
Get module drivers path
public
getDriversPath() : string
Return values
stringgetEmails()
Scan directory and return emails list
public
getEmails([string|null $parent = null ]) : array<string|int, mixed>
Parameters
- $parent : string|null = null
Return values
array<string|int, mixed>getEmailsPath()
Get emails components path
public
getEmailsPath() : string
Return values
stringgetInstalOrder()
Get install order
public
getInstalOrder([mixed|null $default = null ]) : mixed
Parameters
- $default : mixed|null = null
getJobsPath()
Get extension jobs path
public
getJobsPath() : string
Return values
stringgetLanguages()
Get suppported languages
public
getLanguages() : array<string|int, mixed>|null
Return values
array<string|int, mixed>|nullgetMacros()
Scan directory and return macros list
public
getMacros([string|null $path = null ]) : array<string|int, mixed>
Parameters
- $path : string|null = null
Return values
array<string|int, mixed>getMacrosPath()
Get macros path
public
getMacrosPath() : string
Return values
stringgetMiddlewaresPath()
Get extension middlewares path
public
getMiddlewaresPath() : string
Return values
stringgetModels()
Get extension models.
public
getModels() : array<string|int, mixed>
Return values
array<string|int, mixed>getModelsPath()
Get extension model path
public
getModelsPath() : string
Return values
stringgetModelsSchemaPath()
Get extension models schema path
public
getModelsSchemaPath() : string
Return values
stringgetName()
Return package name
public
getName() : string
Return values
stringgetPackageActions()
Get package actions
public
getPackageActions() : array<string|int, mixed>
Return values
array<string|int, mixed>getPackageJobs()
Get extension jobs
public
getPackageJobs() : array<string|int, mixed>
Return values
array<string|int, mixed>getPackageMiddlewares()
Get extension middlewares
public
getPackageMiddlewares() : array<string|int, mixed>
Return values
array<string|int, mixed>getPages()
Scan directory and return pages list
public
getPages([string|null $parent = null ]) : array<string|int, mixed>
Parameters
- $parent : string|null = null
Return values
array<string|int, mixed>getPagesPath()
Get pages path
public
getPagesPath() : string
Return values
stringgetPath()
Get package root path
public
getPath() : string
Return values
stringgetProperties()
Get extension package properties
public
getProperties([bool $full = false ]) : Collection
Parameters
- $full : bool = false
Return values
CollectiongetProperty()
Get package property
public
getProperty(string $name[, mixed $default = null ]) : mixed
Parameters
- $name : string
- $default : mixed = null
getRequire()
Get require property
public
getRequire() : CollectionInterface
Return values
CollectionInterfacegetSubscribersPath()
Get extension subscribers path.
public
getSubscribersPath() : string
Return values
stringgetType()
Get package type
public
getType() : string|null
Return values
string|nullgetTypeId()
Return extension type id
public
getTypeId(string|int $typeName) : int|false
Parameters
- $typeName : string|int
Return values
int|falsegetVersion()
Get Package version
public
getVersion() : string
Return values
stringgetViewPath()
Get view path
public
getViewPath([string|null $componentsType = null ]) : string
Parameters
- $componentsType : string|null = null
Return values
stringinstall()
Install extension package
public
install([bool|null $primary = null ]) : mixed|true
Parameters
- $primary : bool|null = null
-
Primary package replaces routes or other params
Return values
mixed|trueisInstalled()
Return true if package is installed
public
isInstalled() : bool
Return values
boolpostInstall()
Run post install actions
public
postInstall() : bool
Return values
boolregisterEventsSubscribers()
Register event subscribers
public
registerEventsSubscribers() : int
Return values
intsavePackageProperties()
Save package properties file
public
savePackageProperties() : bool
Return values
boolsetPrimary()
Set package as primary
public
setPrimary() : bool
Return values
boolunInstall()
Uninstall extension package
public
unInstall() : bool
Return values
boolvalidate()
Validate package properties
public
validate() : bool
Return values
boolvalidator()
Create package validator
public
validator() : PackageValidator