Skip to content

Commit 55a7fe2

Browse files
Merge branch 'master' into falt-tolerant-install
2 parents 01dd52e + be1e346 commit 55a7fe2

99 files changed

Lines changed: 3615 additions & 559 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# Auto detect text files and perform EOL normalization
2-
* text=auto
2+
* text=auto eol=lf

.mailmap

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1+
Alex Mills <git@viper007bond.com>
12
andreascreten <andreas@madewithlove.be>
23
bartaakos <akos@netpositive.hu>
34
bendoh <ben@thinkoomph.com>
45
BoiteAWeb <juliobosk@gmail.com>
56
boonebgorges <boonebgorges@gmail.com>
7+
Borek Bernard <borekb@gmail.com>
8+
borekb <borekb@gmail.com>
9+
Brad Parbs <brad@bradparbs.com>
610
builtbylane <lanegoldberg@gmail.com>
711
c10b10 <alex.ciobica@gmail.com>
812
clemens-tolboom <clemens@build2be.com>
@@ -13,8 +17,8 @@ dangardner <dan@web.nearest.to>
1317
danielbachhuber <d@danielbachhuber.com>
1418
danielbachhuber <daniel@handbuilt.co>
1519
danielbachhuber <danielbachhuber@gmail.com>
16-
dlh01 <david@alleyinteractive.com>
1720
dd32 <contact-atlassian@dd32.id.au>
21+
dlh01 <david@alleyinteractive.com>
1822
drrobotnik <B@Brandons-Mac-Pro-4.local>
1923
dwightjack <marco.solazzi@gmail.com>
2024
ericandrewlewis <eric.andrew.lewis@gmail.com>
@@ -27,6 +31,7 @@ glebis <glebis@gmail.com>
2731
goldenapples <ntaintor@janrain.com>
2832
itsananderson <will@itsananderson.com>
2933
j3lamp <j3lamp@gmail.com>
34+
jeichorn <joshua.eichorn@pagely.com>
3035
jghazally <jeff@bigfish.co.uk>
3136
jghazally <jghazally@gmail.com>
3237
jmslbam <jmslbam@gmail.com>
@@ -36,12 +41,10 @@ johnpbloch <johnpbloch@gmail.com>
3641
jonathanbardo <jonathanbardo@users.noreply.github.com>
3742
joshbetz <j@joshbetz.com>
3843
joshlevinson <joshalevinson@gmail.com>
39-
jeichorn <joshua.eichorn@pagely.com>
4044
Kevinlearynet <info@kevinleary.net>
4145
kidfiction <ejdanderson@gmail.com>
4246
lackingpenguin <benjamin.j.brooks@gmail.com>
4347
leewillis77 <leewillis77@gmail.com>
44-
santagada <santagada@gmail.com>
4548
lkwdwrd <woodward.lucas@gmail.com>
4649
marcoceppi <marco@ceppi.net>
4750
matiskay <matiskay@gmail.com>
@@ -50,8 +53,10 @@ mattheu <matthew@matth.eu>
5053
mboynes <mboynes@alleyinteractive.com>
5154
mgburns <mgburns@bu.edu>
5255
mgburns <mike@grady-etc.com>
56+
mikey dubs <mike@herebox.org>
5357
milesj <mileswjohnson@gmail.com>
5458
MiteshShah <Mitesh.Shah@rtCamp.com>
59+
miya0001 <miya@wpist.me>
5560
mwilliamson <michael.williamson@red-gate.com>
5661
mwilliamson <mike@zwobble.org>
5762
nacin <andrewnacin@gmail.com>
@@ -67,24 +72,31 @@ ocean90 <dominikschilling+git@gmail.com>
6772
oknoway <nate@oknoway.com>
6873
om4james <james@jamesc.id.au>
6974
om4james <james@om4.com.au>
75+
oneumyvakin <oneumyvakin@gmail.com>
76+
ozh <ozh@ozh.org>
7077
phh <phh@peytz.dk>
78+
Pippin Williamson <pippin@pippinsplugins.com>
7179
Rarst <contact@rarst.net>
7280
robertboloc <robertboloc@gmail.com>
73-
rodrigoprimo <rodrigosprimo@gmail.com>
7481
rodrigoprimo <rodrigo@hacklab.com.br>
82+
rodrigoprimo <rodrigosprimo@gmail.com>
7583
roelven <roel@soundcloud.com>
7684
ryanduff <ryan@fusionized.com>
85+
santagada <santagada@gmail.com>
7786
sboisvert <stephane.boisvert@automattic.com>
7887
scribu <mail@scribu.net>
7988
scribu <scribu@gmail.com>
8089
sebastiaandegeus <sebastiaan@hoppinger.com>
8190
sibprogrammer <ayuzhakov@parallels.com>
8291
simonwheatley <simonw@codeforthepeople.com>
8392
soulou <leo@soulou.fr>
93+
spacedmonkey <spacedmonkey2@gmail.com>
8494
SpikesDivZero <wesley.spikes@gmail.com>
8595
spuriousdata <spuriousdata@gmail.com>
96+
Stephen Edgar <stephen@netweb.com.au>
8697
stianlik <stianlik@gmail.com>
8798
svaj <chris@chrisbot.(none)>
99+
Svetoslav Marinov (Slavi) <slavi@orbisius.com>
88100
szepeviktor <viktor@szepe.net>
89101
taupecat <tracy@taupecat.com>
90102
tddewey <td@tddewey.com>
@@ -99,6 +111,7 @@ twisty <tim@brayshaw.com>
99111
twratajczak <tomasz.ratajczak@espeo.pl>
100112
westonruter <weston@x-team.com>
101113
westonruter <westonruter@gmail.com>
114+
William Turrell <william@wturrell.co.uk>
102115
willmot <tom@humanmade.co.uk>
103116
wopr42 <john@zippykid.com>
104117
ziz <justin@crowdfavorite.com>

.travis.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
sudo: false
2+
13
language: php
24

35
php:
@@ -32,7 +34,7 @@ env:
3234
- secure: "TVMYSuxuZojZUHn3R9me8FCA1V6RaOTNE6A5gta7LSTtqZFLAQOer6tfLVof5fB3SHh2ANcOYPpjO729Mcrg195p1I/0nS18WZ0BVYvsN0Dob1I79rqYvsaW8syxCd/6TZvr7XZYdd1fDtt7kxsv74SljkliYwI2mTniQDxMONE="
3335
- secure: "OqbgLy6Rn+NvhjpYygNZDWf6rj8sVejRZJBmssNi5fHRXopEtfIHids2FjSXZUVPs3ShqNuczo1jzgt7N3JHbcSaiedHlc7ONqDK0SyyOcsv1oKOR81bvYcL/KIoGiMRvkQI5IW01YWfSZlS0wgL2NYdJvYanCnSUUv6nNZAF7E="
3436
matrix:
35-
- WP_VERSION=4.0
37+
- WP_VERSION=4.1
3638
- WP_VERSION=3.5.2 DEPLOY_BRANCH=master
3739

3840
matrix:
@@ -46,6 +48,10 @@ script: ./ci/test.sh
4648

4749
after_success: ./ci/deploy.sh
4850

51+
cache:
52+
directories:
53+
- vendor
54+
4955
notifications:
5056
email:
5157
on_success: never

VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0.18.0

ci/deploy.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,15 @@ git config user.name "Travis CI"
3030
git config user.email "travis@travis-ci.org"
3131
git config push.default "current"
3232

33-
mv $WP_CLI_BIN_DIR/wp phar/wp-cli-nightly.phar
34-
chmod -x phar/wp-cli-nightly.phar
33+
fname="phar/wp-cli-nightly.phar"
3534

36-
git add phar/wp-cli-nightly.phar
35+
mv $WP_CLI_BIN_DIR/wp $fname
36+
chmod -x $fname
37+
38+
md5sum $fname | cut -d ' ' -f 1 > $fname.md5
39+
sha512sum $fname | cut -d ' ' -f 1 > $fname.sha512
40+
41+
git add $fname $fname.md5 $fname.sha512
3742
git commit -m "phar build: $TRAVIS_REPO_SLUG@$TRAVIS_COMMIT"
3843

3944
git push

ci/set-behat-tags.sh

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,26 +32,24 @@ vercomp() {
3232
return 0
3333
}
3434

35+
# Skip Github API tests by default because of rate limiting. See https://github.com/wp-cli/wp-cli/issues/1612
36+
skip_tags="--tags='~@github-api&&"
3537
if [[ ! -z "$WP_VERSION" ]]; then
3638

37-
skip_tags="--tags='"
3839
requires=($(grep "@require-wp-[0-9\.]*" -h -o features/*.feature | uniq))
3940
for (( i = 0; i < ${#requires[@]}; i++ )); do
4041
version=${requires[$i]:12}
4142
require=${requires[$i]}
4243
vercomp $version $WP_VERSION
4344
compare="$?"
4445
if [[ 1 == $compare ]]; then
45-
skip_tags="$skip_tags~$require,"
46+
skip_tags="$skip_tags~$require&&"
4647
fi
4748
done
48-
if [[ "--tags='" != $skip_tags ]]; then
49-
skip_tags=$(echo $skip_tags| sed 's/\,$//') # trim trailing ','
50-
skip_tags="$skip_tags'" # close the argument
51-
else
52-
skip_tags=''
53-
fi
5449

5550
fi
5651

57-
echo export behat_tags=$skip_tags
52+
skip_tags=$(echo $skip_tags| sed 's/&&$//') # trim trailing '&&'
53+
skip_tags="$skip_tags'" # close the argument
54+
55+
echo export behat_tags=$skip_tags

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
{
22
"name": "wp-cli/wp-cli",
33
"description": "A command line interface for WordPress",
4-
"keywords": [ "cli", "wordpress" ],
4+
"keywords": [ "cli", "wordpress" ],
55
"homepage": "http://wp-cli.org",
66
"license": "MIT",
77
"bin": [
88
"bin/wp.bat", "bin/wp"
99
],
1010
"require": {
1111
"php": ">=5.3.2",
12-
"wp-cli/php-cli-tools": "0.10.1",
12+
"wp-cli/php-cli-tools": "0.10.4",
1313
"mustache/mustache": "~2.4",
14-
"rhumsaa/array_column": "~1.1",
14+
"ramsey/array_column": "~1.1",
1515
"rmccue/requests": "~1.6",
1616
"symfony/finder": "~2.3",
1717
"nb/oxymel": "0.1.0"

features/bootstrap/FeatureContext.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,13 @@ public static function afterSuite( SuiteEvent $event ) {
7878
}
7979
}
8080

81+
/**
82+
* @BeforeScenario
83+
*/
84+
public function beforeScenario( $event ) {
85+
$this->variables['SRC_DIR'] = realpath( __DIR__ . '/../..' );
86+
}
87+
8188
/**
8289
* @AfterScenario
8390
*/
@@ -138,6 +145,21 @@ public function create_run_dir() {
138145
}
139146
}
140147

148+
public function build_phar( $version = 'same' ) {
149+
$this->variables['PHAR_PATH'] = $this->variables['RUN_DIR'] . '/' . uniqid( "wp-cli-build-", TRUE ) . '.phar';
150+
151+
Process::create(
152+
Utils\esc_cmd(
153+
'php -dphar.readonly=0 %1$s %2$s --version=%3$s && chmod +x %2$s',
154+
__DIR__ . '/../../utils/make-phar.php',
155+
$this->variables['PHAR_PATH'],
156+
$version
157+
),
158+
null,
159+
self::get_process_env_variables()
160+
)->run_check();
161+
}
162+
141163
private function set_cache_dir() {
142164
$path = sys_get_temp_dir() . '/wp-cli-test-cache';
143165
Process::create( Utils\esc_cmd( 'mkdir -p %s', $path ), null, self::get_process_env_variables() )->run_check();

features/cli.feature

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
@github-api
2+
Feature: `wp cli` tasks
3+
4+
Scenario: Ability to set a custom version when building
5+
Given an empty directory
6+
And save the {SRC_DIR}/VERSION file as {TRUE_VERSION}
7+
And a new Phar with version "1.2.3"
8+
9+
When I run `{PHAR_PATH} cli version`
10+
Then STDOUT should be:
11+
"""
12+
WP-CLI 1.2.3
13+
"""
14+
And the {SRC_DIR}/VERSION file should be:
15+
"""
16+
{TRUE_VERSION}
17+
"""
18+
19+
Scenario: Check for updates
20+
Given an empty directory
21+
And a new Phar with version "0.0.0"
22+
23+
When I run `{PHAR_PATH} cli check-update`
24+
Then STDOUT should contain:
25+
"""
26+
package_url
27+
"""
28+
And STDERR should be empty
29+
30+
Scenario: Do WP-CLI Update
31+
Given an empty directory
32+
And a new Phar with version "0.0.0"
33+
34+
When I run `{PHAR_PATH} cli update --yes`
35+
Then STDOUT should contain:
36+
"""
37+
Success:
38+
"""
39+
And STDERR should be empty
40+
And the return code should be 0
41+
42+
Scenario: Patch update from 0.14.0 to 0.14.1
43+
Given an empty directory
44+
And a new Phar with version "0.14.0"
45+
46+
When I run `{PHAR_PATH} cli update --patch --yes`
47+
Then STDOUT should contain:
48+
"""
49+
Success: Updated WP-CLI to 0.14.1
50+
"""
51+
And STDERR should be empty
52+
And the return code should be 0
53+
54+
Scenario: Not a patch update from 0.14.0
55+
Given an empty directory
56+
And a new Phar with version "0.14.0"
57+
58+
When I run `{PHAR_PATH} cli update --no-patch --yes`
59+
Then STDOUT should contain:
60+
"""
61+
Success:
62+
"""
63+
And STDOUT should not contain:
64+
"""
65+
0.14.1
66+
"""
67+
And STDERR should be empty
68+
And the return code should be 0

features/command.feature

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Feature: WP-CLI Commands
2+
3+
Scenario: Invalid class is specified for a command
4+
Given an empty directory
5+
And a custom-cmd.php file:
6+
"""
7+
<?php
8+
9+
WP_CLI::add_command( 'command example', 'Non_Existent_Class' );
10+
"""
11+
12+
When I try `wp --require=custom-cmd.php help`
13+
Then the return code should be 1
14+
And STDERR should contain:
15+
"""
16+
Class 'Non_Existent_Class' does not exist.
17+
"""

0 commit comments

Comments
 (0)