class Composer

Composer commands

Methods

static void
run(string $command, string|array|null $packages = null, bool $quiet = false)

Run composer commmand

static void
updatePackage(string $packageName, bool $quiet = true)

Run update package command

static void
removePackage(string $packageName, bool $quiet = true)

Run remove package command

static void
requirePackage(string $packageName, bool $quiet = true)

Run require package command

static array|null
getPackageData(string $vendor, string $package)

Get package data

static array|null
getPackageInfo(string $vendor, string $package)

Get package info

static string|false
getLastVersion(string $vendor, string $package)

Get package last version

static string|false
getInstalledPackageVersion(string $packageName, string|null $path = null)

Get installed package version

static array|null
getInstalledPackageInfo(string $name)

Get installed package info

static array
getLocalPackagesInfo(array $packagesList, string|null $path = null)

Get local package info

static boolean
isInstalled(string|array $packageList, string|null $path = null)

Return true if composer package is installed

static array|false
readInstalledPackages(string|null $path = null)

Read local packages info file

static string
getPacakgeInfoUrl(string $vendor, string $package)

Get package info url

Details

at line 31
static void run(string $command, string|array|null $packages = null, bool $quiet = false)

Run composer commmand

Parameters

string $command
string|array|null $packages
bool $quiet

Return Value

void

at line 59
static void updatePackage(string $packageName, bool $quiet = true)

Run update package command

Parameters

string $packageName
bool $quiet

Return Value

void

at line 71
static void removePackage(string $packageName, bool $quiet = true)

Run remove package command

Parameters

string $packageName
bool $quiet

Return Value

void

at line 83
static void requirePackage(string $packageName, bool $quiet = true)

Run require package command

Parameters

string $packageName
bool $quiet

Return Value

void

at line 95
static array|null getPackageData(string $vendor, string $package)

Get package data

Parameters

string $vendor
string $package

Return Value

array|null

at line 109
static array|null getPackageInfo(string $vendor, string $package)

Get package info

Parameters

string $vendor Package vendor name
string $package Package name

Return Value

array|null

at line 124
static string|false getLastVersion(string $vendor, string $package)

Get package last version

Parameters

string $vendor
string $package

Return Value

string|false

at line 143
static string|false getInstalledPackageVersion(string $packageName, string|null $path = null)

Get installed package version

Parameters

string $packageName
string|null $path

Return Value

string|false

at line 166
static array|null getInstalledPackageInfo(string $name)

Get installed package info

Parameters

string $name

Return Value

array|null

at line 187
static array getLocalPackagesInfo(array $packagesList, string|null $path = null)

Get local package info

Parameters

array $packagesList
string|null $path

Return Value

array

at line 218
static boolean isInstalled(string|array $packageList, string|null $path = null)

Return true if composer package is installed

Parameters

string|array $packageList
string|null $path

Return Value

boolean

at line 237
static array|false readInstalledPackages(string|null $path = null)

Read local packages info file

Parameters

string|null $path

Return Value

array|false

at line 252
static string getPacakgeInfoUrl(string $vendor, string $package)

Get package info url

Parameters

string $vendor
string $package

Return Value

string