Composer
class Composer (View source)
Properties
protected Filesystem | $files | The filesystem instance. |
|
protected string|null | $workingPath | The working path to regenerate from. |
Methods
Create a new Composer manager instance.
Determine if the given Composer package is installed.
Install the given Composer packages into the application.
Remove the given Composer packages from the application.
Modify the "composer.json" file contents using the given callback.
Regenerate the Composer autoloader files.
Regenerate the optimized Composer autoloader files.
Get the Composer binary / command for the environment.
Get the path to the "composer.json" file.
Get the PHP binary.
Get a new Symfony process instance.
Set the working path used by the class.
Get the version of Composer.
Details
void
__construct(Filesystem $files, string|null $workingPath = null)
Create a new Composer manager instance.
bool
hasPackage(string $package)
Determine if the given Composer package is installed.
bool
requirePackages(array $packages, bool $dev = false, OutputInterface|null $output = null, string|null $composerBinary = null)
Install the given Composer packages into the application.
bool
removePackages(array $packages, bool $dev = false, OutputInterface|null $output = null, string|null $composerBinary = null)
Remove the given Composer packages from the application.
void
modify(callable $callback)
Modify the "composer.json" file contents using the given callback.
int
dumpAutoloads(string|array $extra = '', string|null $composerBinary = null)
Regenerate the Composer autoloader files.
int
dumpOptimized(string|null $composerBinary = null)
Regenerate the optimized Composer autoloader files.
array
findComposer(string|null $composerBinary = null)
Get the Composer binary / command for the environment.
protected string
findComposerFile()
Get the path to the "composer.json" file.
protected string
phpBinary()
Get the PHP binary.
protected Process
getProcess(array $command, array $env = [])
Get a new Symfony process instance.
$this
setWorkingPath(string $path)
Set the working path used by the class.
string|null
getVersion()
Get the version of Composer.