Arikaim CMS

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

COMPONENTS_LIBRARY_PACKAGE

public mixed COMPONENTS_LIBRARY_PACKAGE = 'components'

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'

Properties

$cacheSaveTime

Cache save time

public static int $cacheSaveTime = 4

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
bool

createPackage()

Create package

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

createRepository()

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

createRepositoryUrl()

Create repository url

public static createRepositoryUrl(string $packageName, string|null $type) : string|null
Parameters
$packageName : string
$type : string|null
Return values
string|null

disablePackage()

Disable package

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

enablePackage()

Enable package

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

findPackage()

Find package

public findPackage(string $param, mixed $value) : PackageInterface|false
Parameters
$param : string
$value : mixed
Return values
PackageInterface|false

getInstalled()

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

getPackages()

Get packages list

public getPackages([bool $cached = false ][, mixed $filter = null ]) : mixed
Parameters
$cached : bool = false
$filter : mixed = null

getPath()

Return packages path

public getPath() : string
Return values
string

getRepository()

Get package repository

public getRepository(string $packageName[, string|null $accessKey = null ]) : RepositoryInterface|null
Parameters
$packageName : string
$accessKey : string|null = null
Return values
RepositoryInterface|null

hasPackage()

Return tru if package exists

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

installAllPackages()

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
bool

installPackage()

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
throws
Exception
Return values
Collection

postInstallAllPackages()

Run post install actions on all packages

public postInstallAllPackages() : bool
Return values
bool

postInstallPackage()

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
bool

resolveRepositoryType()

Resolve package repository type

protected resolveRepositoryType(string $repositoryUrl) : string|null
Parameters
$repositoryUrl : string
Return values
string|null

scan()

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
Return values
array<string|int, mixed>

        
On this page

Search results