Composer
class Composer
Properties
| protected Filesystem | $files | The filesystem instance. |
|
| protected string|null | $workingPath | The working path to regenerate from. |
|
| static protected ClassLoader|null | $classLoader | The cached Composer autoloader instance. |
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 basic permission bits for the Composer file.
Get the PHP binary.
Get a new Symfony process instance.
Set the working path used by the class.
Get the version of Composer.
Get the Composer autoloader instance.
Set the Composer autoloader instance.
Find the Composer autoloader from registered autoload functions.
Flush all static state.
Details
at line 39
__construct(Filesystem $files, string|null $workingPath = null)
Create a new Composer manager instance.
at line 51
bool
hasPackage(string $package)
Determine if the given Composer package is installed.
at line 64
bool
requirePackages(array $packages, bool $dev = false, Closure|OutputInterface|null $output = null, string|null $composerBinary = null)
Install the given Composer packages into the application.
at line 89
bool
removePackages(array $packages, bool $dev = false, Closure|OutputInterface|null $output = null, string|null $composerBinary = null)
Remove the given Composer packages from the application.
at line 117
void
modify(callable $callback)
Modify the "composer.json" file contents using the given callback.
at line 136
int
dumpAutoloads(string|array $extra = '', string|null $composerBinary = null)
Regenerate the Composer autoloader files.
at line 148
int
dumpOptimized(string|null $composerBinary = null)
Regenerate the optimized Composer autoloader files.
at line 156
array
findComposer(string|null $composerBinary = null)
Get the Composer binary / command for the environment.
at line 173
protected string
findComposerFile()
Get the path to the "composer.json" file.
at line 187
protected int
fileMode(string $path)
Get the basic permission bits for the Composer file.
at line 203
protected string
phpBinary()
Get the PHP binary.
at line 211
protected Process
getProcess(array $command, array $env = [])
Get a new Symfony process instance.
at line 219
Composer
setWorkingPath(string $path)
Set the working path used by the class.
at line 229
string|null
getVersion()
Get the version of Composer.
at line 252
static ClassLoader
getLoader()
Get the Composer autoloader instance.
Static because AOP proxy generation needs autoloader access during bootstrap, before the container is available.
at line 263
static ClassLoader
setLoader(ClassLoader $classLoader)
Set the Composer autoloader instance.
Tests only. Swaps the cached Composer loader for the worker lifetime and affects every subsequent class-map registration.
at line 271
static protected ClassLoader
findLoader()
Find the Composer autoloader from registered autoload functions.
at line 287
static void
flushState()
Flush all static state.