PackageManagerImpl
in package
Table of Contents
Constants
- ASSETS_PATH = '/resources/assets'
- where to storage assets.
- CONFIG_PATH = '/config/config.php'
- Configure Path.
- MIGRATION_PATH = '/src/Database/Migrations'
- Migrations folder.
Properties
- $activePackages : array<string, bool>
- $aliasForEntities : array<string|int, mixed>
- $listeners : array<string|int, BasePackageSettingListener>
- $moduleNames : array<string|int, string>
- $providers : array<string|int, string>
- $titleMap : array<string, string>
Methods
- checkActive() : bool
- discoverSettings() : array<string|int, mixed>
- discover module settings collect settings from all active module PackageSettingListener class to an array.
- discoverSettingsPackageKey() : array<string|int, mixed>
- exportToFilesystem() : string
- getAlias() : string
- getAliasFor() : string
- getAliasForEntityType() : string
- getAssetPath() : string
- Get internal assets path within packages directory.
- getBasePath() : string
- getByAlias() : string
- Get package name by an alias name.
- getComposerJson() : array<string|int, mixed>|null
- getComposerJsonPath() : string|null
- getConfig() : array<string|int, mixed>
- getConfigPath() : string
- getDatabaseMigrationsFrom() : array<string|int, string>|null
- getEvents() : array<string, array<int, mixed>>
- Get all packages events.
- getFrontendAlias() : string
- getInfo() : array<string, mixed>|null
- getListener() : BasePackageSettingListener|null
- Resolve listener instance of a package.
- getListenerClass() : string
- Get the listener class name of a package.
- getMasterSeederClasses() : array<string|int, string>
- Get the master seeder name in the database.
- getMigrationPath() : string
- getMigrations() : array<string|int, string>
- getName() : string
- getNamespace() : string
- getNameStudly() : string
- getPackageNames() : array<string|int, string>
- getPath() : string|null
- getProviders() : array<string|int, string>
- Get provider names in schema packages.
- getResourceNames() : array<string|int, string>
- getSeeder() : string|null
- Get the master seeder name in the database.
- getTitle() : string|null
- instance() : $this
- Backward compatible to ModuleManager before 5.1.4.
- isCore() : bool
- normalizePackageName() : string
- Create package name.
- pluck() : array<string|int, mixed>
- readFile() : array<string|int, mixed>|null
- registerApplicationSchedule() : void
- This method is called to assign scheduler. It should be run in console only.
- updateEnvironmentFile() : void
- with() : mixed
- withActivePackages() : mixed
- getListeners() : array<string|int, BasePackageSettingListener>
- getModules() : Collection<string|int, Package>
- getSettings() : array<string, array<string, mixed>>
- Can be invoked before booted.
- initModuleNames() : void
- scanListeners() : array<string|int, BasePackageSettingListener>
Constants
ASSETS_PATH
where to storage assets.
public
mixed
ASSETS_PATH
= '/resources/assets'
CONFIG_PATH
Configure Path.
public
mixed
CONFIG_PATH
= '/config/config.php'
MIGRATION_PATH
Migrations folder.
public
mixed
MIGRATION_PATH
= '/src/Database/Migrations'
Properties
$activePackages
private
array<string, bool>
$activePackages
$aliasForEntities
private
array<string|int, mixed>
$aliasForEntities
= []
$listeners
private
array<string|int, BasePackageSettingListener>
$listeners
$moduleNames
private
array<string|int, string>
$moduleNames
$providers
private
array<string|int, string>
$providers
$titleMap
private
array<string, string>
$titleMap
Methods
checkActive()
public
checkActive(string $name) : bool
Parameters
- $name : string
Return values
booldiscoverSettings()
discover module settings collect settings from all active module PackageSettingListener class to an array.
public
discoverSettings(string $name[, bool $cache = true ]) : array<string|int, mixed>
etc: PackageManager::discoverSettings('getEvents')
Parameters
- $name : string
- $cache : bool = true
Return values
array<string|int, mixed>discoverSettingsPackageKey()
public
discoverSettingsPackageKey(string $name) : array<string|int, mixed>
Parameters
- $name : string
Return values
array<string|int, mixed>exportToFilesystem()
public
exportToFilesystem(string $package, string $path, array<string|int, mixed> $data) : string
Parameters
- $package : string
-
Package name to export file
- $path : string
-
Path within package directory. Example: resources/lang/en.php
- $data : array<string|int, mixed>
-
Data to export. Example [[item=>1]]
Return values
stringgetAlias()
public
getAlias(string $name) : string
Parameters
- $name : string
Return values
stringgetAliasFor()
public
getAliasFor(string $name[, string|null $for = null ]) : string
Parameters
- $name : string
- $for : string|null = null
Return values
stringgetAliasForEntityType()
public
getAliasForEntityType(string $entityType) : string
Parameters
- $entityType : string
Return values
string —Optimize for other method
getAssetPath()
Get internal assets path within packages directory.
public
getAssetPath(string $name) : string
Parameters
- $name : string
Return values
stringgetBasePath()
public
getBasePath(string $name) : string
Parameters
- $name : string
Return values
stringgetByAlias()
Get package name by an alias name.
public
getByAlias(string $alias) : string
Parameters
- $alias : string
Return values
stringgetComposerJson()
public
getComposerJson(string $name) : array<string|int, mixed>|null
Parameters
- $name : string
Return values
array<string|int, mixed>|nullgetComposerJsonPath()
public
getComposerJsonPath(string $name) : string|null
Parameters
- $name : string
Return values
string|nullgetConfig()
public
getConfig(string $name) : array<string|int, mixed>
Parameters
- $name : string
Return values
array<string|int, mixed>getConfigPath()
public
getConfigPath(string $name) : string
Parameters
- $name : string
Return values
stringgetDatabaseMigrationsFrom()
public
getDatabaseMigrationsFrom() : array<string|int, string>|null
Tags
Return values
array<string|int, string>|nullgetEvents()
Get all packages events.
public
getEvents() : array<string, array<int, mixed>>
Tags
Return values
array<string, array<int, mixed>> —["eventName"=> [Listener::class, ...]]
getFrontendAlias()
public
getFrontendAlias(string $name) : string
Parameters
- $name : string
Return values
stringgetInfo()
public
getInfo(string $name) : array<string, mixed>|null
Parameters
- $name : string
Return values
array<string, mixed>|nullgetListener()
Resolve listener instance of a package.
public
getListener(string $name) : BasePackageSettingListener|null
Parameters
- $name : string
-
Package name. Example: metafox/core
Return values
BasePackageSettingListener|nullgetListenerClass()
Get the listener class name of a package.
public
getListenerClass(string $name) : string
Parameters
- $name : string
Return values
stringgetMasterSeederClasses()
Get the master seeder name in the database.
public
getMasterSeederClasses(string $packageName) : array<string|int, string>
Parameters
- $packageName : string
Return values
array<string|int, string>getMigrationPath()
public
getMigrationPath(string $name) : string
Parameters
- $name : string
Return values
stringgetMigrations()
public
getMigrations(string $name) : array<string|int, string>
Parameters
- $name : string
Return values
array<string|int, string>getName()
public
getName(string $name) : string
Parameters
- $name : string
Return values
stringgetNamespace()
public
getNamespace(string $name) : string
Parameters
- $name : string
Return values
stringgetNameStudly()
public
getNameStudly(string $packageName) : string
Parameters
- $packageName : string
Return values
stringgetPackageNames()
public
getPackageNames() : array<string|int, string>
Return values
array<string|int, string>getPath()
public
getPath(string $name) : string|null
Parameters
- $name : string
Return values
string|nullgetProviders()
Get provider names in schema packages.
public
getProviders() : array<string|int, string>
Tags
Return values
array<string|int, string>getResourceNames()
public
getResourceNames(string $name) : array<string|int, string>
Parameters
- $name : string
Return values
array<string|int, string>getSeeder()
Get the master seeder name in the database.
public
getSeeder(string $packageName) : string|null
Parameters
- $packageName : string
Return values
string|nullgetTitle()
public
getTitle(string $name) : string|null
Parameters
- $name : string
Return values
string|nullinstance()
Backward compatible to ModuleManager before 5.1.4.
public
instance() : $this
Return values
$thisisCore()
public
isCore(string $name) : bool
Parameters
- $name : string
Return values
boolnormalizePackageName()
Create package name.
public
normalizePackageName(string $vendorName, string $appName) : string
Parameters
- $vendorName : string
- $appName : string
Return values
stringpluck()
public
pluck(Closure $callback) : array<string|int, mixed>
Parameters
- $callback : Closure
Return values
array<string|int, mixed>readFile()
public
readFile(string $package, string $filename[, bool $silent = false ]) : array<string|int, mixed>|null
Parameters
- $package : string
-
Package name. Example: metafox/blog
- $filename : string
-
: related file name in under package. etc: resources/lang/en.php
- $silent : bool = false
Return values
array<string|int, mixed>|nullregisterApplicationSchedule()
This method is called to assign scheduler. It should be run in console only.
public
registerApplicationSchedule(Schedule $schedule) : void
Parameters
- $schedule : Schedule
Tags
updateEnvironmentFile()
public
updateEnvironmentFile(array<string|int, mixed> $values) : void
Parameters
- $values : array<string|int, mixed>
with()
public
with(Closure $callback) : mixed
Parameters
- $callback : Closure
withActivePackages()
public
withActivePackages(Closure $callback) : mixed
Parameters
- $callback : Closure
getListeners()
private
getListeners() : array<string|int, BasePackageSettingListener>
Return values
array<string|int, BasePackageSettingListener>getModules()
private
getModules() : Collection<string|int, Package>
Return values
Collection<string|int, Package>getSettings()
Can be invoked before booted.
private
getSettings(string $name) : array<string, array<string, mixed>>
Parameters
- $name : string
Return values
array<string, array<string, mixed>>initModuleNames()
private
initModuleNames() : void
scanListeners()
private
scanListeners() : array<string|int, BasePackageSettingListener>