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

Commit 4f44bfb

Browse files
committed
Add more guidelines to README.md
1 parent 22aee09 commit 4f44bfb

File tree

1 file changed

+77
-2
lines changed

1 file changed

+77
-2
lines changed

README.md

Lines changed: 77 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,24 @@
55
[![Build Status](https://img.shields.io/travis/hussainweb/drupal-composer-init/master.svg?style=flat-square)](https://travis-ci.org/hussainweb/drupal-composer-init)
66
[![Total Downloads](https://img.shields.io/packagist/dt/hussainweb/drupal-composer-init.svg?style=flat-square)](https://packagist.org/packages/hussainweb/drupal-composer-init)
77

8-
This plugin handles common operations for Drupal setups. This is derived from the Drupal code base itself and also other projects.
8+
This plugin provides a new composer command (`drupal-init`) which helps in creating new Drupal installations based on composer. Most of the options are very similar to the default `composer init` command. There are additional options to specify a Drupal core or distro to use and the docroot.
9+
10+
This plugin also supports Drupal 7 installation but this option needs to be passed in from command line.
911

1012
## Installation
1113

14+
Since this plugin provides a new composer command that should be used in an empty directory (or at least a directory without a composer.json setup), this has to be installed globally.
15+
1216
```
1317
composer global require hussainweb/drupal-composer-init:~1.0
1418
```
1519

20+
## Updating
21+
22+
```
23+
composer global update hussainweb/drupal-composer-init --with-dependencies
24+
```
25+
1626
## Usage
1727

1828
In a fresh directory, run this command to get started.
@@ -21,6 +31,71 @@ In a fresh directory, run this command to get started.
2131
composer drupal-init
2232
```
2333

34+
To intialise a Drupal 7 website, run the following command:
35+
36+
```
37+
composer drupal-init --drupal-7
38+
```
39+
40+
### Specifying extensions (modules, themes, profiles)
41+
42+
Drupal extensions such as modules, themes, and profiles can be specified in the regular `require` or `require-dev` section of composer.json schema.
43+
44+
All Drupal extensions can be specified in the regular packages section with their drupal.org name prefixed by '`drupal/`'. For example, if you want to require panels module, specify `drupal/panels`.
45+
46+
```
47+
Define your dependencies.
48+
49+
Would you like to define your dependencies (require) now [yes]?
50+
Search for a package: drupal/panels
51+
Enter the version constraint to require (or leave blank to use the latest version):
52+
Using version ^4.2 for drupal/panels
53+
Search for a package: drupal/redirect
54+
Enter the version constraint to require (or leave blank to use the latest version):
55+
Using version ^1.0@beta for drupal/redirect
56+
Search for a package:
57+
```
58+
59+
### Additional Help
60+
2461
Run `composer help drupal-init` for more options.
2562

26-
More details coming soon...
63+
```
64+
Usage:
65+
drupal-init [options]
66+
67+
Options:
68+
--name=NAME Name of the package
69+
--description=DESCRIPTION Description of package
70+
--author=AUTHOR Author name of package
71+
--type[=TYPE] Type of package (e.g. library, project, metapackage, composer-plugin) [default: "project"]
72+
--homepage=HOMEPAGE Homepage of package
73+
--require=REQUIRE Package to require with a version constraint, e.g. foo/bar:1.0.0 or foo/bar=1.0.0 or "foo/bar 1.0.0" (multiple values allowed)
74+
--require-dev=REQUIRE-DEV Package to require for development with a version constraint, e.g. foo/bar:1.0.0 or foo/bar=1.0.0 or "foo/bar 1.0.0" (multiple values allowed)
75+
-c, --core=CORE Drupal Core or distribution, e.g. drupal/core or acquia/lightning [default: "drupal/core"]
76+
-s, --stability=STABILITY Minimum stability (empty or one of: stable, RC, beta, alpha, dev)
77+
-l, --license=LICENSE License of package
78+
--repository=REPOSITORY Add custom repositories, either by URL or using JSON arrays (multiple values allowed)
79+
-w, --web-dir=WEB-DIR Specify the docroot (defaults to web) [default: "web"]
80+
--drupal-7 Use Drupal 7 packagist instead of Drupal 8
81+
-h, --help Display this help message
82+
-q, --quiet Do not output any message
83+
-V, --version Display this application version
84+
--ansi Force ANSI output
85+
--no-ansi Disable ANSI output
86+
-n, --no-interaction Do not ask any interactive question
87+
--profile Display timing and memory usage information
88+
--no-plugins Whether to disable plugins.
89+
-d, --working-dir=WORKING-DIR If specified, use the given directory as working directory.
90+
-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
91+
92+
Help:
93+
The drupal-init command creates a composer.json file
94+
usable for Drupal projects in the current directory.
95+
96+
php composer.phar drupal-init
97+
```
98+
99+
## Contributing
100+
101+
Contributions are welcome. Please use the issue queue to describe the problem. Pull requests are welcome.

0 commit comments

Comments
 (0)