PHP Class PHPComposter\PHPComposter\Plugin

This main class activates and sets up the PHP Composter system within the package's .git folder.
Since: 0.1.0
Author: Alain Schlesser ([email protected])
Inheritance: implements Composer\Plugin\PluginInterface, implements Composer\EventDispatcher\EventSubscriberInterface
Show file Open project: php-composter/php-composter

Protected Properties

Property Type Description
$io Composer\IO\IOInterface Instance of the IO interface.

Public Methods

Method Description
activate ( Composer\Composer $composer, Composer\IO\IOInterface $io ) Activate the Composer plugin.
getConfig ( ) : string Generate the config file.
getSubscribedEvents ( ) : string>\array Get the event subscriber configuration for this plugin.
persistConfig ( Composer\Script\Event $event ) Persist the stored configuration.

Protected Methods

Method Description
cleanUp ( Composer\Util\Filesystem $filesystem ) Clean up previous installation.
createGitHooks ( Composer\Util\Filesystem $filesystem ) Symlink each known Git hook to the PHP Composter bootstrapping script.
getGitHookNames ( ) : array Get an array with all known Git hooks.
linkBootstrapFiles ( Composer\Util\Filesystem $filesystem ) Symlink the bootstrapping code into the .git folder.

Method Details

activate() public method

Activate the Composer plugin.
Since: 0.1.0
public activate ( Composer\Composer $composer, Composer\IO\IOInterface $io )
$composer Composer\Composer Reference to the Composer instance.
$io Composer\IO\IOInterface Reference to the IO interface.

cleanUp() protected method

Clean up previous installation.
Since: 0.1.0
protected cleanUp ( Composer\Util\Filesystem $filesystem )
$filesystem Composer\Util\Filesystem Reference to the Filesystem instance.

createGitHooks() protected method

Symlink each known Git hook to the PHP Composter bootstrapping script.
Since: 0.1.0
protected createGitHooks ( Composer\Util\Filesystem $filesystem )
$filesystem Composer\Util\Filesystem Reference to the Filesystem instance.

getConfig() public static method

Generate the config file.
Since: 0.1.0
public static getConfig ( ) : string
return string Generated Config file.

getGitHookNames() protected static method

Get an array with all known Git hooks.
Since: 0.1.0
protected static getGitHookNames ( ) : array
return array Array of strings.

getSubscribedEvents() public static method

Get the event subscriber configuration for this plugin.
public static getSubscribedEvents ( ) : string>\array
return string>\array

linkBootstrapFiles() protected method

Symlink the bootstrapping code into the .git folder.
Since: 0.1.0
protected linkBootstrapFiles ( Composer\Util\Filesystem $filesystem )
$filesystem Composer\Util\Filesystem Reference to the Filesystem instance.

persistConfig() public static method

Persist the stored configuration.
Since: 0.1.0
public static persistConfig ( Composer\Script\Event $event )
$event Composer\Script\Event Event that was triggered.

Property Details

$io protected static property

Instance of the IO interface.
Since: 0.1.0
protected static IOInterface,Composer\IO $io
return Composer\IO\IOInterface