PHP Class Bolt\Composer\PackageManager

Datei anzeigen Open project: bolt/bolt Class Usage Examples

Protected Properties

Property Type Description
$app Silex\Application
$started boolean
$useSsl boolean

Public Methods

Method Description
__construct ( Silex\Application $app ) Constructor.
checkPackage ( ) : array Check for packages that need to be installed or updated.
dependsPackage ( string $packageName, string $constraint ) Find which packages cause the given package to be installed.
dumpAutoload ( ) Dump fresh autoloader.
getAllPackages ( ) : Bolt\Composer\PackageCollection Get packages that a properly installed, pending installed and locally installed.
getMessages ( ) : string[] Get the stored messages.
getOutput ( ) : string Return the output from the last IO.
initJson ( string $file, array $data = [] ) Initialise a new JSON file.
installPackages ( ) : integer Install configured packages.
prohibitsPackage ( string $packageName, string $constraint ) Find which packages prevent the given package from being installed.
removePackage ( array $packages ) : integer Remove packages from the root install.
requirePackage ( array $packages ) : integer Require (install) packages.
searchPackage ( array $packages ) : array Search for packages.
showPackage ( string $target, string $package = '', string $version = '', boolean $root = false ) : array Show packages.
updatePackage ( array $packages ) : integer Update packages in the root install.
useSsl ( ) : boolean Check if we can/should use SSL/TLS/HTTP2 or HTTP.

Private Methods

Method Description
linkConfig ( Bolt\Extension\ResolvedExtension $extension ) : string Return the URI for a package's config file edit window.
linkReadMe ( Bolt\Extension\ResolvedExtension $extension ) : string Return the URI for a package's readme.
ping ( boolean $addQuery = false ) Ping site to see if we have a valid connection and it is responding correctly.
setup ( ) Set up function.
updateJson ( ) Set up Composer JSON file.

Method Details

__construct() public method

Constructor.
public __construct ( Silex\Application $app )
$app Silex\Application

checkPackage() public method

Check for packages that need to be installed or updated.
public checkPackage ( ) : array
return array

dependsPackage() public method

Find which packages cause the given package to be installed.
public dependsPackage ( string $packageName, string $constraint )
$packageName string
$constraint string

dumpAutoload() public method

Dump fresh autoloader.
public dumpAutoload ( )

getAllPackages() public method

Get packages that a properly installed, pending installed and locally installed.
public getAllPackages ( ) : Bolt\Composer\PackageCollection
return Bolt\Composer\PackageCollection

getMessages() public method

Get the stored messages.
public getMessages ( ) : string[]
return string[]

getOutput() public method

Return the output from the last IO.
public getOutput ( ) : string
return string

initJson() public method

Initialise a new JSON file.
public initJson ( string $file, array $data = [] )
$file string File to initialise
$data array Data to be added as JSON paramter/value pairs

installPackages() public method

Install configured packages.
public installPackages ( ) : integer
return integer 0 on success or a positive error code on failure

prohibitsPackage() public method

Find which packages prevent the given package from being installed.
public prohibitsPackage ( string $packageName, string $constraint )
$packageName string
$constraint string

removePackage() public method

Remove packages from the root install.
public removePackage ( array $packages ) : integer
$packages array array Indexed array of package names to remove
return integer 0 on success or a positive error code on failure

requirePackage() public method

Require (install) packages.
public requirePackage ( array $packages ) : integer
$packages array array Associative array of package names/versions to remove Format: ['name' => '', 'version' => '']
return integer 0 on success or a positive error code on failure

searchPackage() public method

Search for packages.
public searchPackage ( array $packages ) : array
$packages array array Indexed array of package names to search
return array List of matching packages

showPackage() public method

Show packages.
public showPackage ( string $target, string $package = '', string $version = '', boolean $root = false ) : array
$target string
$package string
$version string
$root boolean
return array

updatePackage() public method

Update packages in the root install.
public updatePackage ( array $packages ) : integer
$packages array array Indexed array of package names to update
return integer 0 on success or a positive error code on failure

useSsl() public method

Check if we can/should use SSL/TLS/HTTP2 or HTTP.
public useSsl ( ) : boolean
return boolean

Property Details

$app protected_oe property

protected Application,Silex $app
return Silex\Application

$started protected_oe property

protected bool $started
return boolean

$useSsl protected_oe property

protected bool $useSsl
return boolean