MetaFox

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'

MIGRATION_PATH

Migrations folder.

public mixed MIGRATION_PATH = '/src/Database/Migrations'

Properties

Methods

checkActive()

public checkActive(string $name) : bool
Parameters
$name : string
Return values
bool

discoverSettings()

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
string

getAlias()

public getAlias(string $name) : string
Parameters
$name : string
Return values
string

getAliasFor()

public getAliasFor(string $name[, string|null $for = null ]) : string
Parameters
$name : string
$for : string|null = null
Return values
string

getAliasForEntityType()

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
string

getBasePath()

public getBasePath(string $name) : string
Parameters
$name : string
Return values
string

getByAlias()

Get package name by an alias name.

public getByAlias(string $alias) : string
Parameters
$alias : string
Return values
string

getComposerJson()

public getComposerJson(string $name) : array<string|int, mixed>|null
Parameters
$name : string
Return values
array<string|int, mixed>|null

getComposerJsonPath()

public getComposerJsonPath(string $name) : string|null
Parameters
$name : string
Return values
string|null

getConfig()

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
string

getDatabaseMigrationsFrom()

public getDatabaseMigrationsFrom() : array<string|int, string>|null
Tags
see
AppServiceProvider::boot()
Return values
array<string|int, string>|null

getEvents()

Get all packages events.

public getEvents() : array<string, array<int, mixed>>
Tags
see
EventServiceProvider::discoverPackageEvents()
Return values
array<string, array<int, mixed>>

["eventName"=> [Listener::class, ...]]

getFrontendAlias()

public getFrontendAlias(string $name) : string
Parameters
$name : string
Return values
string

getInfo()

public getInfo(string $name) : array<string, mixed>|null
Parameters
$name : string
Return values
array<string, mixed>|null

getListenerClass()

Get the listener class name of a package.

public getListenerClass(string $name) : string
Parameters
$name : string
Return values
string

getMasterSeederClasses()

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
string

getMigrations()

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
string

getNamespace()

public getNamespace(string $name) : string
Parameters
$name : string
Return values
string

getNameStudly()

public getNameStudly(string $packageName) : string
Parameters
$packageName : string
Return values
string

getPackageNames()

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|null

getProviders()

Get provider names in schema packages.

public getProviders() : array<string|int, string>
Tags
see
AppServiceProvider::discoverPackageProviders()
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|null

getTitle()

public getTitle(string $name) : string|null
Parameters
$name : string
Return values
string|null

instance()

Backward compatible to ModuleManager before 5.1.4.

public instance() : $this
Return values
$this

isCore()

public isCore(string $name) : bool
Parameters
$name : string
Return values
bool

normalizePackageName()

Create package name.

public normalizePackageName(string $vendorName, string $appName) : string
Parameters
$vendorName : string
$appName : string
Return values
string

pluck()

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>|null

registerApplicationSchedule()

This method is called to assign scheduler. It should be run in console only.

public registerApplicationSchedule(Schedule $schedule) : void
Parameters
$schedule : Schedule
Tags
see
Kernel::schedule()

updateEnvironmentFile()

public updateEnvironmentFile(array<string|int, mixed> $values) : void
Parameters
$values : array<string|int, mixed>

withActivePackages()

public withActivePackages(Closure $callback) : mixed
Parameters
$callback : Closure

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>>

        
On this page

Search results