PackageManager
in package
implements
PackageManagerInterface
Package managers base class
Table of Contents
Interfaces
- PackageManagerInterface
- Package manager interface
Constants
- ARIKAIM_REPOSITORY = 'arikaim'
- COMPONENTS_LIBRARY_PACKAGE = 'components'
- COMPOSER_PACKAGE = 'composer'
- COMPOSER_REPOSITORY = 'composer'
- EXTENSION_PACKAGE = 'extension'
- Package type
- GITHUB_PRIVATE_REPOSITORY = 'private-github'
- GITHUB_REPOSITORY = 'github'
- Repository type
- LIBRARY_PACKAGE = 'library'
- MODULE_PACKAGE = 'module'
- SERVICE_PACKAGE = 'service'
- TEMPLATE_PACKAGE = 'template'
Properties
- $cacheSaveTime : int
- Cache save time
- $cache : CacheInterface
- Cache
- $httpClient : HttpClientInterface
- Http client
- $packageRegistry : PackageRegistryInterface
- Package Registry
- $packageType : string
- Package type
- $path : string
- Path to packages
- $storage : StorageInterface
- Local Storage
Methods
- __construct() : mixed
- Constructor
- createBackup() : bool
- Create zip arhive with package files and save to storage/backup/
- createPackage() : PackageInterface|null
- Create package
- createRepository() : object|null
- Create repository driver
- createRepositoryUrl() : string|null
- Create repository url
- disablePackage() : bool
- Disable package
- enablePackage() : bool
- Enable package
- findPackage() : PackageInterface|false
- Find package
- getInstalled() : array<string|int, mixed>
- Get installed packages.
- getPackageProperties() : Collection|null
- Get package properties
- getPackages() : mixed
- Get packages list
- getPackgesRegistry() : PackageRegistryInterface
- Get packages registry
- getPath() : string
- Return packages path
- getRepository() : RepositoryInterface|null
- Get package repository
- hasPackage() : bool
- Return tru if package exists
- installAllPackages() : bool
- Install all packages
- installPackage() : mixed
- Install package
- loadPackageProperties() : Collection
- Load package properties file
- postInstallAllPackages() : bool
- Run post install actions on all packages
- postInstallPackage() : mixed
- Run post install actions on package
- sortPackages() : array<string|int, mixed>
- Sort packages by 'install-order' property
- unInstallPackage() : bool
- Uninstall package
- resolveRepositoryType() : string|null
- Resolve package repository type
- scan() : array<string|int, mixed>
- Explore packages root directory
Constants
ARIKAIM_REPOSITORY
public
mixed
ARIKAIM_REPOSITORY
= 'arikaim'
COMPONENTS_LIBRARY_PACKAGE
public
mixed
COMPONENTS_LIBRARY_PACKAGE
= 'components'
COMPOSER_PACKAGE
public
mixed
COMPOSER_PACKAGE
= 'composer'
COMPOSER_REPOSITORY
public
mixed
COMPOSER_REPOSITORY
= 'composer'
EXTENSION_PACKAGE
Package type
public
mixed
EXTENSION_PACKAGE
= 'extension'
GITHUB_PRIVATE_REPOSITORY
public
mixed
GITHUB_PRIVATE_REPOSITORY
= 'private-github'
GITHUB_REPOSITORY
Repository type
public
mixed
GITHUB_REPOSITORY
= 'github'
LIBRARY_PACKAGE
public
mixed
LIBRARY_PACKAGE
= 'library'
MODULE_PACKAGE
public
mixed
MODULE_PACKAGE
= 'module'
SERVICE_PACKAGE
public
mixed
SERVICE_PACKAGE
= 'service'
TEMPLATE_PACKAGE
public
mixed
TEMPLATE_PACKAGE
= 'template'
Properties
$cacheSaveTime
Cache save time
public
static int
$cacheSaveTime
= 4
$cache
Cache
protected
CacheInterface
$cache
$httpClient
Http client
protected
HttpClientInterface
$httpClient
$packageRegistry
Package Registry
protected
PackageRegistryInterface
$packageRegistry
$packageType
Package type
protected
string
$packageType
$path
Path to packages
protected
string
$path
$storage
Local Storage
protected
StorageInterface
$storage
Methods
__construct()
Constructor
public
__construct(string $packagePath, string $packageType, string $packageClass, CacheInterface $cache, StorageInterface $storage, HttpClientInterface $httpClient[, PackageRegistryInterface|null $packageRegistry = null ]) : mixed
Parameters
- $packagePath : string
- $packageType : string
- $packageClass : string
- $cache : CacheInterface
- $storage : StorageInterface
- $httpClient : HttpClientInterface
- $packageRegistry : PackageRegistryInterface|null = null
createBackup()
Create zip arhive with package files and save to storage/backup/
public
createBackup(string $name) : bool
Parameters
- $name : string
Return values
boolcreatePackage()
Create package
public
createPackage(string $name) : PackageInterface|null
Parameters
- $name : string
Return values
PackageInterface|nullcreateRepository()
Create repository driver
public
createRepository(string $repositoryUrl[, string|null $accessKey = null ][, string|null $type = null ]) : object|null
Parameters
- $repositoryUrl : string
- $accessKey : string|null = null
- $type : string|null = null
Return values
object|nullcreateRepositoryUrl()
Create repository url
public
static createRepositoryUrl(string $packageName, string|null $type) : string|null
Parameters
- $packageName : string
- $type : string|null
Return values
string|nulldisablePackage()
Disable package
public
disablePackage(string $name) : bool
Parameters
- $name : string
Return values
boolenablePackage()
Enable package
public
enablePackage(string $name) : bool
Parameters
- $name : string
Return values
boolfindPackage()
Find package
public
findPackage(string $param, mixed $value) : PackageInterface|false
Parameters
- $param : string
- $value : mixed
Return values
PackageInterface|falsegetInstalled()
Get installed packages.
public
getInstalled([int|null $status = null ][, string|int $type = null ]) : array<string|int, mixed>
Parameters
- $status : int|null = null
- $type : string|int = null
Return values
array<string|int, mixed>getPackageProperties()
Get package properties
public
getPackageProperties(string $name[, bool $full = false ]) : Collection|null
Parameters
- $name : string
- $full : bool = false
Return values
Collection|nullgetPackages()
Get packages list
public
getPackages([bool $cached = false ][, mixed $filter = null ]) : mixed
Parameters
- $cached : bool = false
- $filter : mixed = null
getPackgesRegistry()
Get packages registry
public
getPackgesRegistry() : PackageRegistryInterface
Return values
PackageRegistryInterfacegetPath()
Return packages path
public
getPath() : string
Return values
stringgetRepository()
Get package repository
public
getRepository(string $packageName[, string|null $accessKey = null ]) : RepositoryInterface|null
Parameters
- $packageName : string
- $accessKey : string|null = null
Return values
RepositoryInterface|nullhasPackage()
Return tru if package exists
public
hasPackage(string $name) : bool
Parameters
- $name : string
Return values
boolinstallAllPackages()
Install all packages
public
installAllPackages([Closure|null $onProgress = null ][, Closure|null $onProgressError = null ][, bool $skipErrors = true ]) : bool
Parameters
- $onProgress : Closure|null = null
- $onProgressError : Closure|null = null
- $skipErrors : bool = true
Return values
boolinstallPackage()
Install package
public
installPackage(string $name) : mixed
Parameters
- $name : string
loadPackageProperties()
Load package properties file
public
static loadPackageProperties(string $name, string $path[, string|null $packageType = null ]) : Collection
Parameters
- $name : string
- $path : string
- $packageType : string|null = null
Tags
Return values
CollectionpostInstallAllPackages()
Run post install actions on all packages
public
postInstallAllPackages() : bool
Return values
boolpostInstallPackage()
Run post install actions on package
public
postInstallPackage(string $name) : mixed
Parameters
- $name : string
sortPackages()
Sort packages by 'install-order' property
public
sortPackages(array<string|int, mixed> $packages) : array<string|int, mixed>
Parameters
- $packages : array<string|int, mixed>
Return values
array<string|int, mixed>unInstallPackage()
Uninstall package
public
unInstallPackage(string $name) : bool
Parameters
- $name : string
Return values
boolresolveRepositoryType()
Resolve package repository type
protected
resolveRepositoryType(string $repositoryUrl) : string|null
Parameters
- $repositoryUrl : string
Return values
string|nullscan()
Explore packages root directory
protected
scan([array<string|int, mixed>|null $filter = null ]) : array<string|int, mixed>
Parameters
- $filter : array<string|int, mixed>|null = null