class Composer (View source)
| protected Filesystem | $files | The filesystem instance. | |
| protected string|null | $workingPath | The working path to regenerate from. |
| 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. | |
| string | findComposerFile()
Get the path to the "composer.json" file. | |
| string | phpBinary()
Get the PHP binary. | |
| 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. |
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.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/11.x/Illuminate/Support/Composer.html