11.08.2017 Views

codebright

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

The Primers 21<br />

1 "require": {<br />

2 "xmen/gambit": "dev-master"<br />

3 },<br />

4 "require-dev": {<br />

5 "codeception/codeception": "1.6.0.3"<br />

6 }<br />

The codeception/codeception package will now only be installed if we use the --dev switch with<br />

Composer. There will be more on this topic in the installation and usage section.<br />

As you can see above, the require-dev section uses exactly the same format as the require section.<br />

In fact, there are other sections which use the same format. Let’s have a quick look at what’s<br />

available.<br />

1 "conflict": {<br />

2 "marvel/spiderman": "1.0.0"<br />

3 }<br />

The conflict section contains a list of packages that would not work happily alongside our package.<br />

Composer will not let you install these packages side by side.<br />

1 "replace": {<br />

2 "xmen/gambit": "1.0.0"<br />

3 }<br />

The replace section informs you that this package can be used as a replacement for another package.<br />

This is useful for packages that have been forked from another, but provide the same functionality.<br />

1 "provide": {<br />

2 "xmen/gambit": "1.0.0"<br />

3 }<br />

This section indicates packages that have been provided within the codebase of your package. If the<br />

Gambit packages source was included within our main package then it would be of little use to install<br />

it again. Use this section to let Composer know which packages have been embedded within your<br />

primary package. Remember, you need not list your package dependencies here. Anything found in<br />

require doesn’t count.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!