LibraryPackage
extends Package
in package
implements
PackageInterface
Uses
PhpConfigFile
UI Library Package class
Table of Contents
Interfaces
- PackageInterface
- Package interface, all packages type should impelement it.
Constants
- LIBRARY_PARAMS_FILE_NAME = \Arikaim\Core\Utils\Path::CONFIG_PATH . 'ui-library.php'
- Library params config file
Properties
- $comments : array<string|int, mixed>
- Config array comments
- $packageRegistry : PackageRegistryInterface|null
- Package Registry Interface
- $path : string
- Package root path
- $properties : CollectionInterface
- Package properties
Methods
- __construct() : mixed
- Constructor
- disable() : bool
- Disable library
- enable() : void
- Enable library
- getDrivers() : array<string|int, mixed>
- Get drivers classes list
- getInstalOrder() : mixed
- Get install order
- getLanguages() : array<string|int, mixed>|null
- Get suppported languages
- getLibraryParams() : array<string|int, mixed>
- Get library params
- getName() : string
- Return package name
- getParams() : array<string|int, mixed>
- Get library params
- getPath() : string
- Get package root path
- getProperties() : CollectionInterface
- Return package properties
- getProperty() : mixed
- Get package property
- getRequire() : CollectionInterface
- Get require property
- getThemeFile() : string
- Get theme file (DEPRECATED)
- getType() : string|null
- Get package type
- getVersion() : string
- Get Package version
- include() : array<string|int, mixed>|null
- Include file
- includeConfigFile() : array<string|int, mixed>|null
- Include config file
- includePhpArray() : array<string|int, mixed>|null
- Include php array
- install() : mixed
- Install package.
- isInstalled() : bool
- Return true if package is installed
- postInstall() : bool
- Run post install actions
- saveConfigFile() : bool
- Save config file
- saveLibraryParams() : bool
- Save ui library params
- savePackageProperties() : bool
- Save package properties file
- setPrimary() : bool
- Set package as primary
- setStatus() : void
- Set library status (enabled, disbled)
- unInstall() : bool
- UnInstall package
- validate() : bool
- Validate package properties
- validator() : PackageValidator
- Create package validator
- exportArray() : string
- Export array as text
- exportConfig() : string
- Export config as text
- exportItem() : string
- Export item as text
- getCommentsText() : string
- Get array imtem comment as text
- setComment() : void
- Set array key comment
- determineMaxTabs() : int
- Get max tabs count
- determineTabs() : int
- Get tabs count for array key
- getFileContent() : string
- Return config file content
- getFileContentHeader() : string
- Get config file header
- getTabs() : string
- Get tabs text
Constants
LIBRARY_PARAMS_FILE_NAME
Library params config file
public
mixed
LIBRARY_PARAMS_FILE_NAME
= \Arikaim\Core\Utils\Path::CONFIG_PATH . 'ui-library.php'
Properties
$comments
Config array comments
protected
array<string|int, mixed>
$comments
= []
$packageRegistry
Package Registry Interface
protected
PackageRegistryInterface|null
$packageRegistry
$path
Package root path
protected
string
$path
$properties
Package properties
protected
CollectionInterface
$properties
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 library
public
disable() : bool
Return values
boolenable()
Enable library
public
enable() : void
getDrivers()
Get drivers classes list
public
getDrivers() : array<string|int, mixed>
Return values
array<string|int, mixed>getInstalOrder()
Get install order
public
getInstalOrder([mixed|null $default = null ]) : mixed
Parameters
- $default : mixed|null = null
getLanguages()
Get suppported languages
public
getLanguages() : array<string|int, mixed>|null
Return values
array<string|int, mixed>|nullgetLibraryParams()
Get library params
public
getLibraryParams() : array<string|int, mixed>
Return values
array<string|int, mixed>getName()
Return package name
public
getName() : string
Return values
stringgetParams()
Get library params
public
getParams() : array<string|int, mixed>
Return values
array<string|int, mixed>getPath()
Get package root path
public
getPath() : string
Return values
stringgetProperties()
Return package properties
public
getProperties([bool $full = false ]) : CollectionInterface
Parameters
- $full : bool = false
Return values
CollectionInterfacegetProperty()
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
CollectionInterfacegetThemeFile()
Get theme file (DEPRECATED)
public
getThemeFile(string $theme) : string
Parameters
- $theme : string
Return values
stringgetType()
Get package type
public
getType() : string|null
Return values
string|nullgetVersion()
Get Package version
public
getVersion() : string
Return values
stringinclude()
Include file
public
include(string $fileName) : array<string|int, mixed>|null
Parameters
- $fileName : string
-
Full file name
Return values
array<string|int, mixed>|nullincludeConfigFile()
Include config file
public
includeConfigFile(string $fileName[, string|null $extensionName = null ]) : array<string|int, mixed>|null
Parameters
- $fileName : string
- $extensionName : string|null = null
Return values
array<string|int, mixed>|nullincludePhpArray()
Include php array
public
includePhpArray(string $fileName) : array<string|int, mixed>|null
Parameters
- $fileName : string
Return values
array<string|int, mixed>|nullinstall()
Install package.
public
install([bool|null $primary = null ]) : mixed
Parameters
- $primary : bool|null = null
-
Primary package replaces routes or other params
isInstalled()
Return true if package is installed
public
isInstalled() : bool
Return values
boolpostInstall()
Run post install actions
public
postInstall() : bool
Return values
boolsaveConfigFile()
Save config file
public
saveConfigFile(string $fileName, array<string|int, mixed> $data) : bool
Parameters
- $fileName : string
- $data : array<string|int, mixed>
Return values
boolsaveLibraryParams()
Save ui library params
public
saveLibraryParams(array<string|int, mixed> $params) : bool
Parameters
- $params : array<string|int, mixed>
Return values
boolsavePackageProperties()
Save package properties file
public
savePackageProperties() : bool
Return values
boolsetPrimary()
Set package as primary
public
setPrimary() : bool
Return values
boolsetStatus()
Set library status (enabled, disbled)
public
setStatus(bool $status) : void
Parameters
- $status : bool
unInstall()
UnInstall package
public
unInstall() : bool
Return values
boolvalidate()
Validate package properties
public
validate() : bool
Return values
boolvalidator()
Create package validator
public
validator() : PackageValidator
Return values
PackageValidatorexportArray()
Export array as text
protected
exportArray(array<string|int, mixed> $data, string $arrayKey[, int $currentTab = 1 ]) : string
Parameters
- $data : array<string|int, mixed>
- $arrayKey : string
- $currentTab : int = 1
Return values
stringexportConfig()
Export config as text
protected
exportConfig(array<string|int, mixed> $data) : string
Parameters
- $data : array<string|int, mixed>
Return values
stringexportItem()
Export item as text
protected
exportItem(string|int $key, mixed $value, int $maxTabs[, int $startTab = 1 ]) : string
Parameters
- $key : string|int
- $value : mixed
- $maxTabs : int
- $startTab : int = 1
Return values
stringgetCommentsText()
Get array imtem comment as text
protected
getCommentsText(string $key) : string
Parameters
- $key : string
Return values
stringsetComment()
Set array key comment
protected
setComment(string $comment, string $key) : void
Parameters
- $comment : string
- $key : string
determineMaxTabs()
Get max tabs count
private
determineMaxTabs(array<string|int, mixed> $data[, int $tabSize = 4 ]) : int
Parameters
- $data : array<string|int, mixed>
- $tabSize : int = 4
Return values
intdetermineTabs()
Get tabs count for array key
private
determineTabs(string $key[, int $tabSize = 4 ]) : int
Parameters
- $key : string
- $tabSize : int = 4
Return values
intgetFileContent()
Return config file content
private
getFileContent(array<string|int, mixed> $data) : string
Parameters
- $data : array<string|int, mixed>
Return values
stringgetFileContentHeader()
Get config file header
private
getFileContentHeader() : string
Return values
stringgetTabs()
Get tabs text
private
getTabs(int $count) : string
Parameters
- $count : int