Skip to content

Commit 692a258

Browse files
Use PSR-4 autoloading of existing classes; add remaining test files
1 parent 749466f commit 692a258

21 files changed

Lines changed: 2432 additions & 2 deletions

‎.distignore‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.DS_Store
2+
.git
3+
.gitignore
4+
.gitlab-ci.yml
5+
.editorconfig
6+
.travis.yml
7+
behat.yml
8+
circle.yml
9+
bin/
10+
features/
11+
utils/
12+
*.zip
13+
*.tar.gz

‎.editorconfig‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# This file is for unifying the coding style for different editors and IDEs
2+
# editorconfig.org
3+
4+
# WordPress Coding Standards
5+
# https://make.wordpress.org/core/handbook/coding-standards/
6+
7+
root = true
8+
9+
[*]
10+
charset = utf-8
11+
end_of_line = lf
12+
insert_final_newline = true
13+
trim_trailing_whitespace = true
14+
indent_style = tab
15+
16+
[{.jshintrc,*.json,*.yml,*.feature}]
17+
indent_style = space
18+
indent_size = 2
19+
20+
[{*.txt,wp-config-sample.php}]
21+
end_of_line = crlf
22+
23+
[composer.json]
24+
indent_style = space
25+
indent_size = 4

‎.gitignore‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.DS_Store
2+
wp-cli.local.yml
3+
node_modules/
4+
vendor/
5+
*.zip
6+
*.tar.gz
7+
composer.lock

‎.travis.yml‎

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
sudo: false
2+
3+
language: php
4+
5+
notifications:
6+
email:
7+
on_success: never
8+
on_failure: change
9+
10+
branches:
11+
only:
12+
- master
13+
14+
cache:
15+
- composer
16+
- $HOME/.composer/cache
17+
18+
env:
19+
global:
20+
- WP_CLI_BIN_DIR=/tmp/wp-cli-phar
21+
22+
matrix:
23+
include:
24+
- php: 7.1
25+
env: WP_VERSION=latest
26+
- php: 7.0
27+
env: WP_VERSION=latest
28+
- php: 5.6
29+
env: WP_VERSION=latest
30+
- php: 5.6
31+
env: WP_VERSION=trunk
32+
- php: 5.3
33+
env: WP_VERSION=latest
34+
35+
before_script:
36+
- phpenv config-rm xdebug.ini
37+
- composer validate
38+
- bash bin/install-package-tests.sh
39+
40+
script: ./vendor/bin/behat --format progress --strict

‎LICENSE‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (C) 2011-2017 WP-CLI Development Group (https://github.com/wp-cli/package-command/contributors)
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

‎README.md‎

Lines changed: 270 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,270 @@
1+
wp-cli/package-command
2+
======================
3+
4+
Manage WP-CLI packages.
5+
6+
[![Build Status](https://travis-ci.org/wp-cli/package-command.svg?branch=master)](https://travis-ci.org/wp-cli/package-command)
7+
8+
Quick links: [Using](#using) | [Installing](#installing) | [Contributing](#contributing)
9+
10+
## Using
11+
12+
This package implements the following commands:
13+
14+
### wp package browse
15+
16+
Browse WP-CLI packages available for installation.
17+
18+
~~~
19+
wp package browse [--fields=<fields>] [--format=<format>]
20+
~~~
21+
22+
Lists packages available for installation from the [Package Index](http://wp-cli.org/package-index/).
23+
24+
**OPTIONS**
25+
26+
[--fields=<fields>]
27+
Limit the output to specific fields. Defaults to all fields.
28+
29+
[--format=<format>]
30+
Render output in a particular format.
31+
---
32+
default: table
33+
options:
34+
- table
35+
- csv
36+
- ids
37+
- json
38+
- yaml
39+
---
40+
41+
**AVAILABLE FIELDS**
42+
43+
These fields will be displayed by default for each package:
44+
45+
* name
46+
* description
47+
* authors
48+
* version
49+
50+
There are no optionally available fields.
51+
52+
**EXAMPLES**
53+
54+
$ wp package browse --format=yaml
55+
---
56+
10up/mu-migration:
57+
name: 10up/mu-migration
58+
description: A set of WP-CLI commands to support the migration of single WordPress instances to multisite
59+
authors: Nícholas André
60+
version: dev-master, dev-develop
61+
aaemnnosttv/wp-cli-dotenv-command:
62+
name: aaemnnosttv/wp-cli-dotenv-command
63+
description: Dotenv commands for WP-CLI
64+
authors: Evan Mattson
65+
version: v0.1, v0.1-beta.1, v0.2, dev-master, dev-dev, dev-develop, dev-tests/behat
66+
aaemnnosttv/wp-cli-http-command:
67+
name: aaemnnosttv/wp-cli-http-command
68+
description: WP-CLI command for using the WordPress HTTP API
69+
authors: Evan Mattson
70+
version: dev-master
71+
72+
73+
74+
### wp package install
75+
76+
Install a WP-CLI package.
77+
78+
~~~
79+
wp package install <name|git|path|zip>
80+
~~~
81+
82+
Packages are required to be a valid Composer package, and can be
83+
specified as:
84+
85+
* Package name from WP-CLI's package index.
86+
* Git URL accessible by the current shell user.
87+
* Path to a directory on the local machine.
88+
* Local or remote .zip file.
89+
90+
When installing a local directory, WP-CLI simply registers a
91+
reference to the directory. If you move or delete the directory, WP-CLI's
92+
reference breaks.
93+
94+
When installing a .zip file, WP-CLI extracts the package to
95+
`~/.wp-cli/packages/local/<package-name>`.
96+
97+
**OPTIONS**
98+
99+
<name|git|path|zip>
100+
Name, git URL, directory path, or .zip file for the package to install.
101+
Names can optionally include a version constraint
102+
(e.g. wp-cli/server-command:@stable).
103+
104+
**EXAMPLES**
105+
106+
# Install the latest development version from the package index.
107+
$ wp package install wp-cli/server-command
108+
Installing package wp-cli/server-command (dev-master)
109+
Updating /home/person/.wp-cli/packages/composer.json to require the package...
110+
Using Composer to install the package...
111+
---
112+
Loading composer repositories with package information
113+
Updating dependencies
114+
Resolving dependencies through SAT
115+
Dependency resolution completed in 0.005 seconds
116+
Analyzed 732 packages to resolve dependencies
117+
Analyzed 1034 rules to resolve dependencies
118+
- Installing package
119+
Writing lock file
120+
Generating autoload files
121+
---
122+
Success: Package installed.
123+
124+
# Install the latest stable version.
125+
$ wp package install wp-cli/server-command:@stable
126+
127+
# Install a package hosted at a git URL.
128+
$ wp package install git@github.com:runcommand/hook.git
129+
130+
# Install a package in a .zip file.
131+
$ wp package install google-sitemap-generator-cli.zip
132+
133+
134+
135+
### wp package list
136+
137+
List installed WP-CLI packages.
138+
139+
~~~
140+
wp package list [--fields=<fields>] [--format=<format>]
141+
~~~
142+
143+
**OPTIONS**
144+
145+
[--fields=<fields>]
146+
Limit the output to specific fields. Defaults to all fields.
147+
148+
[--format=<format>]
149+
Render output in a particular format.
150+
---
151+
default: table
152+
options:
153+
- table
154+
- csv
155+
- ids
156+
- json
157+
- yaml
158+
---
159+
160+
**AVAILABLE FIELDS**
161+
162+
These fields will be displayed by default for each package:
163+
164+
* name
165+
* authors
166+
* version
167+
* update
168+
* update_version
169+
170+
These fields are optionally available:
171+
172+
* description
173+
174+
**EXAMPLES**
175+
176+
$ wp package list
177+
+-----------------------+------------------------------------------+---------+------------+
178+
| name | description | authors | version |
179+
+-----------------------+------------------------------------------+---------+------------+
180+
| wp-cli/server-command | Start a development server for WordPress | | dev-master |
181+
+-----------------------+------------------------------------------+---------+------------+
182+
183+
184+
185+
### wp package update
186+
187+
Update all installed WP-CLI packages to their latest version.
188+
189+
~~~
190+
wp package update
191+
~~~
192+
193+
**EXAMPLES**
194+
195+
$ wp package update
196+
Using Composer to update packages...
197+
---
198+
Loading composer repositories with package information
199+
Updating dependencies
200+
Resolving dependencies through SAT
201+
Dependency resolution completed in 0.074 seconds
202+
Analyzed 1062 packages to resolve dependencies
203+
Analyzed 22383 rules to resolve dependencies
204+
Writing lock file
205+
Generating autoload files
206+
---
207+
Success: Packages updated.
208+
209+
210+
211+
### wp package uninstall
212+
213+
Uninstall a WP-CLI package.
214+
215+
~~~
216+
wp package uninstall <name>
217+
~~~
218+
219+
**OPTIONS**
220+
221+
<name>
222+
Name of the package to uninstall.
223+
224+
**EXAMPLES**
225+
226+
$ wp package uninstall wp-cli/server-command
227+
Removing require statement from /home/person/.wp-cli/packages/composer.json
228+
Deleting package directory /home/person/.wp-cli/packages/vendor/wp-cli/server-command
229+
Regenerating Composer autoload.
230+
Success: Uninstalled package.
231+
232+
## Installing
233+
234+
Installing this package requires WP-CLI v0.23.0 or greater. Update to the latest stable release with `wp cli update`.
235+
236+
Once you've done so, you can install this package with `wp package install wp-cli/package-command`.
237+
238+
## Contributing
239+
240+
We appreciate you taking the initiative to contribute to this project.
241+
242+
Contributing isn’t limited to just code. We encourage you to contribute in the way that best fits your abilities, by writing tutorials, giving a demo at your local meetup, helping other users with their support questions, or revising our documentation.
243+
244+
### Reporting a bug
245+
246+
Think you’ve found a bug? We’d love for you to help us get it fixed.
247+
248+
Before you create a new issue, you should [search existing issues](https://github.com/wp-cli/package-command/issues?q=label%3Abug%20) to see if there’s an existing resolution to it, or if it’s already been fixed in a newer version.
249+
250+
Once you’ve done a bit of searching and discovered there isn’t an open or fixed issue for your bug, please [create a new issue](https://github.com/wp-cli/package-command/issues/new) with the following:
251+
252+
1. What you were doing (e.g. "When I run `wp post list`").
253+
2. What you saw (e.g. "I see a fatal about a class being undefined.").
254+
3. What you expected to see (e.g. "I expected to see the list of posts.")
255+
256+
Include as much detail as you can, and clear steps to reproduce if possible.
257+
258+
### Creating a pull request
259+
260+
Want to contribute a new feature? Please first [open a new issue](https://github.com/wp-cli/package-command/issues/new) to discuss whether the feature is a good fit for the project.
261+
262+
Once you've decided to commit the time to seeing your pull request through, please follow our guidelines for creating a pull request to make sure it's a pleasant experience:
263+
264+
1. Create a feature branch for each contribution.
265+
2. Submit your pull request early for feedback.
266+
3. Include functional tests with your changes. [Read the WP-CLI documentation](https://wp-cli.org/docs/pull-requests/#functional-tests) for an introduction.
267+
4. Follow the [WordPress Coding Standards](http://make.wordpress.org/core/handbook/coding-standards/).
268+
269+
270+
*This README.md is generated dynamically from the project's codebase using `wp scaffold package-readme` ([doc](https://github.com/wp-cli/scaffold-package-command#wp-scaffold-package-readme)). To suggest changes, please submit a pull request against the corresponding part of the codebase.*

0 commit comments

Comments
 (0)