Composer
class Composer (View source)
The Composer class is a wrapper for setting up Composer and executing commands.
Properties
private | $autoloader | Composer autoloader within the temporary extraction directory. | |
private | $composerVersion | The Composer version to be used. | |
private | $extractionDir | Composer extraction directory within temporary directory. | |
private | $installDirCacheFile | A chached file including the temporary Composer install directory. | |
private | $pharUrl | The download URL for the composer.phar file. | |
private | $reservedShutdownMemory | A variable to reserve memory for running a shutdown function when Composer reaches the allowd memory limit. |
Methods
The constructor runs the setup.
Set up Composer by downloading and extracting the composer.phar to a temporary directory outside the document root, defining some environment variables, registering a shutdown function and including the autoloader.
Run a given Composer command.
Download the composer.phar file to a given directory.
Read the Composer install directory from cache to reuse the installation in case Composer was already used before. In case Composer hasn't been used before, a new path will be generated and save to the cache.
Generate a fresh installation directory for Composer.
A shutdown function to handle memory limit erros.
Details
at line 91
__construct()
The constructor runs the setup.
at line 105
private
setUp()
Set up Composer by downloading and extracting the composer.phar to a temporary directory outside the document root, defining some environment variables, registering a shutdown function and including the autoloader.
at line 152
string
run(string $command, bool $getBuffer = false)
Run a given Composer command.
at line 218
private string
downloadPhar(string $dir)
Download the composer.phar file to a given directory.
at line 264
private string
getInstallDir()
Read the Composer install directory from cache to reuse the installation in case Composer was already used before. In case Composer hasn't been used before, a new path will be generated and save to the cache.
at line 288
private string
newInstallDir()
Generate a fresh installation directory for Composer.
at line 301
private
shutdownOnError()
A shutdown function to handle memory limit erros.