Properties

$lockFile

$lockFile : 

Type

$repositoryManager

$repositoryManager : 

Type

$installationManager

$installationManager : 

Type

$hash

$hash : 

Type

$contentHash

$contentHash : 

Type

$loader

$loader : 

Type

$dumper

$dumper : 

Type

$process

$process : 

Type

$lockDataCache

$lockDataCache : 

Type

Methods

__construct()

__construct(\Composer\IO\IOInterface  $io, \Composer\Json\JsonFile  $lockFile, \Composer\Repository\RepositoryManager  $repositoryManager, \Composer\Installer\InstallationManager  $installationManager, string  $composerFileContents) 

Initializes packages locker.

Parameters

\Composer\IO\IOInterface $io
\Composer\Json\JsonFile $lockFile

lockfile loader

\Composer\Repository\RepositoryManager $repositoryManager

repository manager instance

\Composer\Installer\InstallationManager $installationManager

installation manager instance

string $composerFileContents

The contents of the composer file

getContentHash()

getContentHash(string  $composerFileContents) : string

Returns the md5 hash of the sorted content of the composer file.

Parameters

string $composerFileContents

The contents of the composer file.

Returns

string

isLocked()

isLocked() : boolean

Checks whether locker has been locked (lockfile found).

Returns

boolean

isFresh()

isFresh() : boolean

Checks whether the lock file is still up to date with the current hash

Returns

boolean

getLockedRepository()

getLockedRepository(boolean  $withDevReqs = false) : \Composer\Repository\RepositoryInterface

Searches and returns an array of locked packages, retrieved from registered repositories.

Parameters

boolean $withDevReqs

true to retrieve the locked dev packages

Throws

\RuntimeException

Returns

\Composer\Repository\RepositoryInterface

getPlatformRequirements()

getPlatformRequirements(boolean  $withDevReqs = false) : array<mixed,\Composer\Package\Link>

Returns the platform requirements stored in the lock file

Parameters

boolean $withDevReqs

if true, the platform requirements from the require-dev block are also returned

Returns

array<mixed,\Composer\Package\Link>

getMinimumStability()

getMinimumStability() 

getStabilityFlags()

getStabilityFlags() 

getPreferStable()

getPreferStable() 

getPreferLowest()

getPreferLowest() 

getPlatformOverrides()

getPlatformOverrides() 

getAliases()

getAliases() 

getLockData()

getLockData() 

setLockData()

setLockData(array  $packages, mixed  $devPackages, array  $platformReqs, mixed  $platformDevReqs, array  $aliases, string  $minimumStability, array  $stabilityFlags, boolean  $preferStable, boolean  $preferLowest, array  $platformOverrides) : boolean

Locks provided data into lockfile.

Parameters

array $packages

array of packages

mixed $devPackages

array of dev packages or null if installed without --dev

array $platformReqs

array of package name => constraint for required platform packages

mixed $platformDevReqs

array of package name => constraint for dev-required platform packages

array $aliases

array of aliases

string $minimumStability
array $stabilityFlags
boolean $preferStable
boolean $preferLowest
array $platformOverrides

Returns

boolean

lockPackages()

lockPackages(array  $packages) 

Parameters

array $packages

getPackageTime()

getPackageTime(\Composer\Package\PackageInterface  $package) : string|null

Returns the packages's datetime for its source reference.

Parameters

\Composer\Package\PackageInterface $package

The package to scan.

Returns

string|null —

The formatted datetime or null if none was found.