Allow plugins to register commands
parent
e5985a9b55
commit
86e0b847be
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Composer.
|
||||
*
|
||||
* (c) Nils Adermann <naderman@naderman.de>
|
||||
* Jordi Boggiano <j.boggiano@seld.be>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Composer\Plugin;
|
||||
|
||||
use Composer\Composer;
|
||||
use Composer\IO\IOInterface;
|
||||
|
||||
/**
|
||||
* Commands Provider Interface
|
||||
*
|
||||
* @author Jérémy Derussé <jeremy@derusse.com>
|
||||
*/
|
||||
interface CommandsProviderInterface
|
||||
{
|
||||
|
||||
/**
|
||||
* Retreives list of commands
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getCommands();
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace Installer;
|
||||
|
||||
use Composer\Composer;
|
||||
use Composer\IO\IOInterface;
|
||||
use Composer\Plugin\PluginInterface;
|
||||
use Composer\Plugin\CommandsProviderInterface;
|
||||
|
||||
class Plugin implements PluginInterface, CommandsProviderInterface
|
||||
{
|
||||
public $version = 'installer-v5';
|
||||
|
||||
public function activate(Composer $composer, IOInterface $io)
|
||||
{
|
||||
}
|
||||
|
||||
public function getCommands()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
{
|
||||
"name": "plugin-v5",
|
||||
"version": "5.0.0",
|
||||
"type": "composer-plugin",
|
||||
"autoload": { "psr-0": { "Installer": "" } },
|
||||
"extra": {
|
||||
"class": [
|
||||
"Installer\\Plugin"
|
||||
]
|
||||
},
|
||||
"require": {
|
||||
"composer-plugin-api": "1.0.0"
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue