Skip to content

Commit

Permalink
Merge branch 'docs/6'
Browse files Browse the repository at this point in the history
Close #6
  • Loading branch information
michalbundyra committed Jan 24, 2020
2 parents ac43510 + 69ed723 commit 3f7e962
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 98 deletions.
96 changes: 0 additions & 96 deletions docs/book/index.html

This file was deleted.

1 change: 0 additions & 1 deletion docs/book/index.md

This file was deleted.

73 changes: 73 additions & 0 deletions docs/book/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Installation

```bash
$ composer require laminas/laminas-skeleton-installer
```

## Optional Packages

To define an optional package, you will add an object under a
`extra.laminas-skeleton-installer` array in your `composer.json`. The
object **must** contain the following properties:

* **name**: the name of the package to install
* **constraint**: the package constraint to use
* **prompt**: a textual prompt (e.g., "Do you want to install console tooling?"

You may also define two boolean flags:

* **module**: when true, indicates that the component represents a Laminas
module. This flag will not dictate whether or not the component installer
prompts to install the package as a module, but will affect hints provided by
Composer during installation.
* **dev**: when true, indicates the package should be installed as a development
requirement (`require-dev`). Additionally, the installer will prompt you to
choose a development configuration file in which to install the component if
it is a module.

## Example

```json
{
"name": "laminas/laminas-skeleton-application",
"type": "project",
"require": {
"php": "^5.6 || ^7.0",
"laminas/laminas-component-installer": "^1.0 || ^0.7 || ^1.0.0-dev@dev",
"laminas/laminas-skeleton-installer": "^1.0 || ^0.1.3 || ^1.0.0-dev@dev",
"laminas/laminas-mvc": "^3.0.4"
},
"extra": {
"laminas-skeleton-installer": [
{
"name": "laminas/laminas-mvc-console",
"constraint": "^1.1.11",
"prompt": "Would you like to install MVC console tooling?",
"module": true
},
{
"name": "laminas/laminas-mvc-i18n",
"constraint": "^1.0",
"prompt": "Would you like to install i18n support?",
"module": true
},
{
"name": "laminas/laminas-test",
"constraint": "^3.0.2",
"prompt": "Would you like to install MVC testing support?",
"dev": true
}
]
}
}
```

The above will:

* Prompt if you want to do a minimal install; if so, the plugin will remove
the `extra.laminas-skeleton-installer` section on completion, and then delete
itself from the installation.
* Prompt for each of the listed components, as noted, awaiting a y/n
answer (with "n" as the default).
* Install the selections, updating the `composer.json`.
* Remove itself from the installation on completion.
3 changes: 2 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ site_dir: docs/html
nav:
- Home: index.md
site_name: laminas-skeleton-installer
site_description: 'Skeleton Installer: Composer plugin for initial laminas-mvc-skeleton application installation'
site_description: 'Composer plugin for providing and prompting for optional components in skeleton projects.'
repo_url: 'https://github.com/laminas/laminas-skeleton-installer'
extra:
project: Components
show_special_homepage: true

0 comments on commit 3f7e962

Please sign in to comment.