class Composer (View source)

Provides static functions for composer script events.

Properties

static protected $packageToCleanup

Methods

static 
preAutoloadDump(Event $event)

Add vendor classes to Composer's static classmap.

static 
ensureHtaccess(Event $event)

Ensures that .htaccess and web.config files are present in Composer root.

static 
vendorTestCodeCleanup(PackageEvent $event)

Remove possibly problematic test files from vendored projects.

static string|null
findPackageKey(string $package_name)

Find the array key for a given package name with a case-insensitive search.

static 
removeTimeout()

Removes Composer's timeout so that scripts can run indefinitely.

static bool
deleteRecursive(string $path)

Helper method to remove directories and the files they contain.

static 
upgradePHPUnit(Event $event)

Fires the drupal-phpunit-upgrade script event if necessary.

static bool
upgradePHPUnitCheck(string $phpunit_version)

Determines if PHPUnit needs to be upgraded.

Details

static preAutoloadDump(Event $event)

Add vendor classes to Composer's static classmap.

Parameters

Event $event

static ensureHtaccess(Event $event)

Ensures that .htaccess and web.config files are present in Composer root.

Parameters

Event $event

static vendorTestCodeCleanup(PackageEvent $event)

Remove possibly problematic test files from vendored projects.

Parameters

PackageEvent $event

A PackageEvent object to get the configured composer vendor directories from.

static protected string|null findPackageKey(string $package_name)

Find the array key for a given package name with a case-insensitive search.

Parameters

string $package_name

The package name from composer. This is always already lower case.

Return Value

string|null

The string key, or NULL if none was found.

static removeTimeout()

Removes Composer's timeout so that scripts can run indefinitely.

static protected bool deleteRecursive(string $path)

Helper method to remove directories and the files they contain.

Parameters

string $path

The directory or file to remove. It must exist.

Return Value

bool

TRUE on success or FALSE on failure.

static upgradePHPUnit(Event $event)

Fires the drupal-phpunit-upgrade script event if necessary.

Parameters

Event $event

static bool upgradePHPUnitCheck(string $phpunit_version)

Determines if PHPUnit needs to be upgraded.

This method is located in this file because it is possible that it is called before the autoloader is available.

Parameters

string $phpunit_version

The PHPUnit version string.

Return Value

bool

TRUE if the PHPUnit needs to be upgraded, FALSE if not.