Skip to content

Commit 73f8488

Browse files
authored
Merge pull request roots#3 from jstoone/allow-composer-v2
Allow composer v2
2 parents 0a5edbb + 69f8b58 commit 73f8488

File tree

7 files changed

+265
-182
lines changed

7 files changed

+265
-182
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@ composer.lock
22
vendor
33
phpunit.xml
44
clover.xml
5+
.phpunit.result.cache
6+
.idea/

.travis.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
language: php
2-
matrix:
3-
include:
4-
- php: 5.3
5-
dist: precise
62
php:
7-
- '5.4'
8-
- '5.5'
93
- '5.6'
104
- '7.0'
115
- '7.1'
126
- '7.2'
7+
- '7.3'
8+
- '7.4'
139
before_script:
1410
- composer update
1511
script: composer test

README.md

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,24 +16,26 @@ For more information on this site setup and using Composer to manage a whole Wor
1616
### Usage
1717
To set up a custom WordPress build package to use this as a custom installer, add the following to your package's composer file:
1818

19-
```
19+
```json
2020
"type": "wordpress-core",
2121
"require": {
22-
"roots/wordpress-core-installer": "^1.0"
22+
"roots/wordpress-core-installer": "^2.0"
2323
}
2424
```
2525

26+
If you need to maintain support for PHP versions lower than 5.6 (not recommended!), use `^1.0` as your version constraint in the above.
27+
2628
By default, this package will install a `wordpress-core` type package in the `wordpress` directory. To change this you can add the following to either your custom WordPress core type package or the root composer package:
2729

28-
```
30+
```json
2931
"extra": {
3032
"wordpress-install-dir": "custom/path"
3133
}
3234
```
3335

3436
The root composer package can also declare custom paths as an object keyed by package name:
3537

36-
```
38+
```json
3739
"extra": {
3840
"wordpress-install-dir": {
3941
"wordpress/wordpress": "wordpress",
@@ -44,3 +46,16 @@ The root composer package can also declare custom paths as an object keyed by pa
4446

4547
### License
4648
This is licensed under the GPL version 2 or later.
49+
50+
### Changelog
51+
52+
##### 2.0.0
53+
- Added support for Composer v2. Special thanks to @Ayesh for the original pull request to add this support.
54+
- Bumped minimum required PHP version to 5.6 (same as WP). If you need to stick with an older PHP version, you're probably ok with also sticking with an older version of Composer and can continue to use `^1.0` as your version constraint.
55+
- Other various fixes and improvements to README, tests, etc.
56+
57+
##### 1.0.0
58+
- Initial stable release
59+
- Added tests and CI
60+
- Support added for custom vendor directories
61+
- Added sanity check for overwriting sensitive directories

composer.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,12 @@
3232
"class": "Roots\\Composer\\WordPressCorePlugin"
3333
},
3434
"require": {
35-
"composer-plugin-api": "^1.0"
35+
"composer-plugin-api": "^1.0 || ^2.0",
36+
"php": ">=5.6.0"
3637
},
3738
"require-dev": {
38-
"composer/composer": "^1.0",
39-
"phpunit/phpunit": ">=4.8.35"
39+
"composer/composer": "^1.0 || ^2.0",
40+
"phpunit/phpunit": ">=5.7.27"
4041
},
4142
"conflict": {
4243
"composer/installers": "<1.0.6"

src/WordPressCorePlugin.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,16 @@ public function activate( Composer $composer, IOInterface $io ) {
3838
$composer->getInstallationManager()->addInstaller( $installer );
3939
}
4040

41+
/**
42+
* {@inheritDoc}
43+
*/
44+
public function deactivate( Composer $composer, IOInterface $io ) {
45+
}
46+
47+
/**
48+
* {@inheritDoc}
49+
*/
50+
public function uninstall( Composer $composer, IOInterface $io ) {
51+
}
52+
4153
}

0 commit comments

Comments
 (0)