Handler
class Handler (View source)
| internal |
Core class of the plugin.
Contains the primary logic which determines the files to be fetched and processed.
Constants
| PRE_DRUPAL_SCAFFOLD_CMD |
Composer hook called before scaffolding begins. |
| POST_DRUPAL_SCAFFOLD_CMD |
Composer hook called after scaffolding completes. |
Properties
| protected Composer | $composer | The Composer service. |
|
| protected IOInterface | $io | Composer's I/O service. |
|
| protected ManageOptions | $manageOptions | The scaffold options in the top-level composer.json's 'extra' section. |
|
| protected AllowedPackages | $manageAllowedPackages | The manager that keeps track of which packages are allowed to scaffold. |
|
| protected PostPackageEventListenerInterface[] | $postPackageListeners | The list of listeners that are notified after a package event. |
Methods
Handler constructor.
Registers post-package events if the 'require' command was called.
Posts package command event.
Creates scaffold operation objects for all items in the file mappings.
Copies all scaffold files from source to destination.
Gets the path to the 'vendor' directory.
Gets a consolidated list of file mappings from all allowed packages.
Gets the array of file mappings provided by a given package.
Gets the root package name.
Details
__construct(Composer $composer, IOInterface $io)
Handler constructor.
requireWasCalled()
Registers post-package events if the 'require' command was called.
onPostPackageEvent(PackageEvent $event)
Posts package command event.
We want to detect packages 'require'd that have scaffold files, but are not yet allowed in the top-level composer.json file.
protected OperationInterface[]
createScaffoldOperations(PackageInterface $package, array $package_file_mappings)
Creates scaffold operation objects for all items in the file mappings.
scaffold()
Copies all scaffold files from source to destination.
protected string
getVendorPath()
Gets the path to the 'vendor' directory.
protected OperationInterface[][]
getFileMappingsFromPackages(array $allowed_packages)
Gets a consolidated list of file mappings from all allowed packages.
protected OperationInterface[]
getPackageFileMappings(PackageInterface $package)
Gets the array of file mappings provided by a given package.
protected string
rootPackageName()
Gets the root package name.