PHP Class cweagans\Composer\Patches

Inheritance: implements Composer\Plugin\PluginInterface, implements Composer\EventDispatcher\EventSubscriberInterface
Exibir arquivo Open project: cweagans/composer-patches

Protected Properties

Property Type Description
$composer Composer\Composer
$eventDispatcher EventDispatcher
$executor Composer\Util\ProcessExecutor
$io Composer\IO\IOInterface
$patches array

Public Methods

Method Description
activate ( Composer\Composer $composer, Composer\IO\IOInterface $io ) Apply plugin modifications to composer
checkPatches ( Composer\Script\Event $event ) Before running composer install,
gatherPatches ( Composer\Installer\PackageEvent $event ) Gather patches from dependencies and store them for later use.
getSubscribedEvents ( ) Returns an array of event names this subscriber wants to listen to.
grabPatches ( ) : Patches Get the patches from root composer or external file
postInstall ( Composer\Installer\PackageEvent $event )

Protected Methods

Method Description
executeCommand ( string $cmd ) : boolean Executes a shell command with escaping.
getAndApplyPatch ( Composer\Util\RemoteFilesystem $downloader, $install_path, $patch_url ) Apply a patch on code in the specified directory.
getPackageFromOperation ( Composer\DependencyResolver\Operation\OperationInterface $operation ) : Composer\Package\PackageInterface Get a Package object from an OperationInterface object.
isPatchingEnabled ( ) : boolean Checks if the root package enables patching.
writePatchReport ( array $patches, string $directory ) Writes a patch report to the target directory.

Method Details

activate() public method

Apply plugin modifications to composer
public activate ( Composer\Composer $composer, Composer\IO\IOInterface $io )
$composer Composer\Composer
$io Composer\IO\IOInterface

checkPatches() public method

Before running composer install,
public checkPatches ( Composer\Script\Event $event )
$event Composer\Script\Event

executeCommand() protected method

Executes a shell command with escaping.
protected executeCommand ( string $cmd ) : boolean
$cmd string
return boolean

gatherPatches() public method

Gather patches from dependencies and store them for later use.
public gatherPatches ( Composer\Installer\PackageEvent $event )
$event Composer\Installer\PackageEvent

getAndApplyPatch() protected method

Apply a patch on code in the specified directory.
protected getAndApplyPatch ( Composer\Util\RemoteFilesystem $downloader, $install_path, $patch_url )
$downloader Composer\Util\RemoteFilesystem
$install_path
$patch_url

getPackageFromOperation() protected method

Get a Package object from an OperationInterface object.
protected getPackageFromOperation ( Composer\DependencyResolver\Operation\OperationInterface $operation ) : Composer\Package\PackageInterface
$operation Composer\DependencyResolver\Operation\OperationInterface
return Composer\Package\PackageInterface

getSubscribedEvents() public static method

Returns an array of event names this subscriber wants to listen to.
public static getSubscribedEvents ( )

grabPatches() public method

Get the patches from root composer or external file
public grabPatches ( ) : Patches
return Patches

isPatchingEnabled() protected method

Checks if the root package enables patching.
protected isPatchingEnabled ( ) : boolean
return boolean Whether patching is enabled. Defaults to TRUE.

postInstall() public method

public postInstall ( Composer\Installer\PackageEvent $event )
$event Composer\Installer\PackageEvent

writePatchReport() protected method

Writes a patch report to the target directory.
protected writePatchReport ( array $patches, string $directory )
$patches array
$directory string

Property Details

$composer protected_oe property

protected Composer,Composer $composer
return Composer\Composer

$eventDispatcher protected_oe property

protected EventDispatcher $eventDispatcher
return EventDispatcher

$executor protected_oe property

protected ProcessExecutor,Composer\Util $executor
return Composer\Util\ProcessExecutor

$io protected_oe property

protected IOInterface,Composer\IO $io
return Composer\IO\IOInterface

$patches protected_oe property

protected array $patches
return array