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 40
__construct(Filesystem $files, string|null $workingPath = null)
Create a new Composer manager instance.
at line 52
bool
hasPackage(string $package)
Determine if the given Composer package is installed.
at line 65
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 90
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 118
void
modify(callable $callback)
Modify the "composer.json" file contents using the given callback.
at line 142
int
dumpAutoloads(string|array $extra = '', string|null $composerBinary = null)
Regenerate the Composer autoloader files.
at line 154
int
dumpOptimized(string|null $composerBinary = null)
Regenerate the optimized Composer autoloader files.
at line 164
array
findComposer(string|null $composerBinary = null)
Get the Composer binary / command for the environment.
at line 181
protected string
findComposerFile()
Get the path to the "composer.json" file.
at line 195
protected int
fileMode(string $path)
Get the basic permission bits for the Composer file.
at line 211
protected string
phpBinary()
Get the PHP binary.
at line 222
protected Process
getProcess(array $command, array $env = [])
Get a new Symfony process instance.
at line 230
Composer
setWorkingPath(string $path)
Set the working path used by the class.
at line 240
string|null
getVersion()
Get the version of Composer.
at line 263
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 274
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 282
static protected ClassLoader
findLoader()
Find the Composer autoloader from registered autoload functions.
at line 298
static void
flushState()
Flush all static state.