Skip to content
This repository was archived by the owner on Nov 2, 2024. It is now read-only.

Commit 65b2380

Browse files
committed
Initial commit
0 parents  commit 65b2380

8 files changed

+444
-0
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
composer.lock
2+
composer.phar
3+
/vendor/
4+
5+
/.idea/

.travis.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
language: php
2+
3+
php:
4+
# - 5.5
5+
# - 5.6
6+
# - 7.0
7+
- 7.1
8+
9+
# This triggers builds to run on the new TravisCI infrastructure.
10+
# See: http://docs.travis-ci.com/user/workers/container-based-infrastructure/
11+
sudo: false
12+
13+
before_script:
14+
- travis_retry composer self-update
15+
- travis_retry composer install --no-interaction --prefer-dist --dev
16+
17+
script:
18+
- composer test
19+
# - vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2017 hussainweb
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# drupal-composer-init
2+
3+
[![Latest Version](https://img.shields.io/github/release/hussainweb/drupal-composer-init.svg?style=flat-square)](https://github.com/hussainweb/drupal-composer-init/releases)
4+
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md)
5+
[![Build Status](https://img.shields.io/travis/hussainweb/drupal-composer-init/master.svg?style=flat-square)](https://travis-ci.org/hussainweb/drupal-composer-init)
6+
[![Total Downloads](https://img.shields.io/packagist/dt/hussainweb/drupal-composer-init.svg?style=flat-square)](https://packagist.org/packages/hussainweb/drupal-composer-init)
7+
8+
This plugin handles common operations for Drupal setups. This is derived from the Drupal code base itself and also other projects.
9+
10+
## Installation
11+
12+
```
13+
composer global require hussainweb/drupal-composer-init:~1.0
14+
```
15+
16+
## Usage
17+
18+
In a fresh directory, run this command to get started.
19+
20+
```
21+
composer drupal-init
22+
```
23+
24+
Run `composer help drupal-init` for more options.
25+
26+
More details coming soon...

composer.json

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"name": "hussainweb/drupal-composer-init",
3+
"description": "Initialise a Drupal composer project setup",
4+
"type": "composer-plugin",
5+
"keywords": [
6+
"drupal"
7+
],
8+
"license": "MIT",
9+
"authors": [
10+
{
11+
"name": "hussainweb",
12+
"email": "hussainweb@gmail.com",
13+
"homepage": "http://hussainweb.me",
14+
"role": "Developer"
15+
}
16+
],
17+
"require": {
18+
"php": ">=5.5.9",
19+
"composer-plugin-api": "^1.1"
20+
},
21+
"require-dev": {
22+
"composer/composer": "~1.0",
23+
"squizlabs/php_codesniffer": "~2.3"
24+
},
25+
"autoload": {
26+
"psr-4": {
27+
"Hussainweb\\DrupalComposerInit\\": "src/"
28+
}
29+
},
30+
"config": {
31+
"optimize-autoloader": true,
32+
"sort-packages": true
33+
},
34+
"extra": {
35+
"branch-alias": {
36+
"dev-master": "1.x-dev"
37+
},
38+
"class": "Hussainweb\\DrupalComposerInit\\ComposerPlugin"
39+
},
40+
"scripts": {
41+
"test": [
42+
"composer validate --no-interaction",
43+
"phpcs --standard=psr2 src/"
44+
]
45+
}
46+
}

src/CommandProvider.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
namespace Hussainweb\DrupalComposerInit;
4+
5+
use Composer\Plugin\Capability\CommandProvider as CommandProviderCapability;
6+
7+
class CommandProvider implements CommandProviderCapability
8+
{
9+
10+
/**
11+
* {@inheritdoc}
12+
*/
13+
public function getCommands()
14+
{
15+
return [new DrupalInitCommand()];
16+
}
17+
}

src/ComposerPlugin.php

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
3+
namespace Hussainweb\DrupalComposerInit;
4+
5+
use Composer\Composer;
6+
use Composer\IO\IOInterface;
7+
use Composer\Plugin\Capable;
8+
use Composer\Plugin\PluginInterface;
9+
10+
class ComposerPlugin implements PluginInterface, Capable
11+
{
12+
13+
/**
14+
* {@inheritdoc}
15+
*/
16+
public function activate(Composer $composer, IOInterface $io)
17+
{
18+
}
19+
20+
/**
21+
* {@inheritdoc}
22+
*/
23+
public function getCapabilities()
24+
{
25+
return [
26+
'Composer\Plugin\Capability\CommandProvider' => 'Hussainweb\DrupalComposerInit\CommandProvider',
27+
];
28+
}
29+
}

0 commit comments

Comments
 (0)