Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow composer v2 #3

Merged
merged 23 commits into from
Aug 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
d73a01c
Syntax highlight JSON in README
szepeviktor Feb 24, 2019
a42f43d
Use annotations to reset installer paths
johnpbloch Feb 24, 2019
b08cdc1
Ignore phpunit result cache
johnpbloch Feb 24, 2019
eea9992
Ignore phpstorm config
johnpbloch Feb 24, 2019
b2ae675
Stop using exception annotations
johnpbloch Feb 24, 2019
78c0e1a
Fix annotation
johnpbloch Feb 24, 2019
3590928
Add php 7.3 to the list of PHP versions to test against
johnpbloch Feb 24, 2019
9a7cb23
Whitespace
johnpbloch Feb 24, 2019
5dd0e54
Use correct exception expectation for given version of phpunit
johnpbloch Feb 24, 2019
683ef60
Merge pull request #23 from szepeviktor/patch-1
johnpbloch Feb 24, 2019
ec541ae
Merge pull request #24 from johnpbloch/fix/update-tests
johnpbloch Feb 24, 2019
12a8074
Add support for Composer version 2
Ayesh Apr 15, 2020
368fafa
Add 7.4 to test matrix
johnpbloch Apr 16, 2020
479acb6
Remove unsupported versions from matrix
johnpbloch Apr 16, 2020
be7312e
Bump minimum phpunit version and remove exception expectation conditions
johnpbloch Apr 16, 2020
674f153
Require php 5.6+
johnpbloch Apr 16, 2020
597a3d8
Update test helpers to get regex matching working on latest version o…
johnpbloch Apr 16, 2020
d2ada95
Update plugin and tests to work correctly with composer v2 plugin api
johnpbloch Apr 16, 2020
4813d51
Add support for composer 2.0
johnpbloch Apr 16, 2020
bb894f3
Add a changelog and bump documented version to 2.0
johnpbloch Apr 16, 2020
7410911
Merge branch 'master' into composer2
johnpbloch Apr 16, 2020
237faae
Merge pull request #27 from Ayesh/composer2
johnpbloch Apr 16, 2020
69f8b58
Merge remote-tracking branch 'upstream/master' into allow-composer-v2
jstoone Aug 11, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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/
austinpray marked this conversation as resolved.
Show resolved Hide resolved
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