Skip to content

Commit

Permalink
Merge pull request #3 from jstoone/allow-composer-v2
Browse files Browse the repository at this point in the history
Allow composer v2
  • Loading branch information
austinpray authored Aug 20, 2020
2 parents 0a5edbb + 69f8b58 commit 73f8488
Show file tree
Hide file tree
Showing 7 changed files with 265 additions and 182 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ composer.lock
vendor
phpunit.xml
clover.xml
.phpunit.result.cache
.idea/
8 changes: 2 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
language: php
matrix:
include:
- php: 5.3
dist: precise
php:
- '5.4'
- '5.5'
- '5.6'
- '7.0'
- '7.1'
- '7.2'
- '7.3'
- '7.4'
before_script:
- composer update
script: composer test
Expand Down
23 changes: 19 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,26 @@ For more information on this site setup and using Composer to manage a whole Wor
### Usage
To set up a custom WordPress build package to use this as a custom installer, add the following to your package's composer file:

```
```json
"type": "wordpress-core",
"require": {
"roots/wordpress-core-installer": "^1.0"
"roots/wordpress-core-installer": "^2.0"
}
```

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.

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:

```
```json
"extra": {
"wordpress-install-dir": "custom/path"
}
```

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

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

### License
This is licensed under the GPL version 2 or later.

### Changelog

##### 2.0.0
- Added support for Composer v2. Special thanks to @Ayesh for the original pull request to add this support.
- 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.
- Other various fixes and improvements to README, tests, etc.

##### 1.0.0
- Initial stable release
- Added tests and CI
- Support added for custom vendor directories
- Added sanity check for overwriting sensitive directories
7 changes: 4 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,12 @@
"class": "Roots\\Composer\\WordPressCorePlugin"
},
"require": {
"composer-plugin-api": "^1.0"
"composer-plugin-api": "^1.0 || ^2.0",
"php": ">=5.6.0"
},
"require-dev": {
"composer/composer": "^1.0",
"phpunit/phpunit": ">=4.8.35"
"composer/composer": "^1.0 || ^2.0",
"phpunit/phpunit": ">=5.7.27"
},
"conflict": {
"composer/installers": "<1.0.6"
Expand Down
12 changes: 12 additions & 0 deletions src/WordPressCorePlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,16 @@ public function activate( Composer $composer, IOInterface $io ) {
$composer->getInstallationManager()->addInstaller( $installer );
}

/**
* {@inheritDoc}
*/
public function deactivate( Composer $composer, IOInterface $io ) {
}

/**
* {@inheritDoc}
*/
public function uninstall( Composer $composer, IOInterface $io ) {
}

}
Loading

0 comments on commit 73f8488

Please sign in to comment.