-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the ability to rename files/folders and support vendor namespaces.
Also adds a convenience "install-drupal-libraries" command.
- Loading branch information
1 parent
723eca1
commit e395487
Showing
22 changed files
with
498 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# Demo root project | ||
|
||
Demo root project integrating with Drupal libraries installer. | ||
|
||
Update locally after committing by running `composer update zodiacmedia/drupal-libraries-installer`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
namespace Zodiacmedia\DrupalLibrariesInstaller; | ||
|
||
use Composer\Script\Event; | ||
|
||
/** | ||
* The Install Drupal libraries event. | ||
*/ | ||
class InstallLibrariesEvent extends Event { | ||
|
||
/** | ||
* The event is triggered when the 'install-drupal-libraries' command is ran. | ||
* | ||
* The event listener method receives a | ||
* \Zodiacmedia\DrupalLibrariesInstaller\DownloadLibraryEvent instance. | ||
* | ||
* @var string | ||
*/ | ||
const INSTALL_LIBRARIES = 'install-drupal-libraries'; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?php | ||
|
||
namespace Zodiacmedia\DrupalLibrariesInstaller; | ||
|
||
use Composer\Command\BaseCommand; | ||
use Symfony\Component\Console\Input\InputInterface; | ||
use Symfony\Component\Console\Output\OutputInterface; | ||
|
||
/** | ||
* The composer plugin command provider. | ||
*/ | ||
class PluginCommand extends BaseCommand { | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
protected function configure() { | ||
$this->setName('install-drupal-libraries'); | ||
$this->setDescription( | ||
'Download and install the drupal libraries.' | ||
); | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
protected function execute(InputInterface $input, OutputInterface $output) { | ||
$composer = $this->getComposer(); | ||
|
||
$install_libraries_event = new InstallLibrariesEvent( | ||
InstallLibrariesEvent::INSTALL_LIBRARIES, | ||
$composer, | ||
$this->getIO(), | ||
FALSE | ||
); | ||
return $composer->getEventDispatcher()->dispatch( | ||
$install_libraries_event->getName(), | ||
$install_libraries_event | ||
); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
namespace Zodiacmedia\DrupalLibrariesInstaller; | ||
|
||
use Composer\Plugin\Capability\CommandProvider; | ||
|
||
/** | ||
* The composer plugin command provider. | ||
*/ | ||
class PluginCommandProvider implements CommandProvider { | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
public function getCommands() { | ||
return [ | ||
new PluginCommand(), | ||
]; | ||
} | ||
|
||
} |
Oops, something went wrong.