Skip to content

Commit 07411e4

Browse files
Revert "Remove WP-CLI files unrelated to wp package *"
This reverts commit 749466f.
1 parent c5f04db commit 07411e4

File tree

11 files changed

+1164
-0
lines changed

11 files changed

+1164
-0
lines changed

.editorconfig

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# This file is for unifying the coding style for different editors and IDEs
2+
# editorconfig.org
3+
4+
# WordPress Coding Standards
5+
# http://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+
indent_size = 4
16+
17+
[*.{json,yml,feature}]
18+
indent_style = space
19+
indent_size = 2
20+
21+
[composer.json]
22+
indent_style = space
23+
indent_size = 4

.github/ISSUE_TEMPLATE

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<!--
2+
3+
Thanks for taking the time to help improve WP-CLI!
4+
5+
Found a bug or want to suggest an enhancement to an existing command? Before creating an issue, please review our best practices: http://wp-cli.org/docs/bug-reports/
6+
7+
But first, make sure you're running the most recent version of WP-CLI! The current version is the only officially supported version.
8+
9+
Need help with something? Github issues aren't for general support questions, but there are other venues you can try: http://wp-cli.org/#support
10+
11+
Want to suggest a feature? Check out the roadmap for how feature development happens: https://wp-cli.org/docs/roadmap/
12+
13+
You can safely delete this comment.
14+
15+
-->

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.DS_Store
2+
config.yml
3+
PHAR_BUILD_VERSION
4+
/cache
5+
/packages
6+
/vendor
7+
/*.phar
8+
/phpunit.xml.dist
9+
/codesniffer
10+
/PHP_Codesniffer-VariableAnalysis

CONTRIBUTING.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
Contributing
2+
============
3+
4+
Welcome and thanks!
5+
6+
We appreciate you taking the initiative to contribute to WP-CLI. It’s because of you, and the community around you, that WP-CLI is such a great project.
7+
8+
**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.
9+
10+
Please take a moment to read these guidelines at depth. Following the guidelines helps to communicate that you respect the time of the other contributors to the project. In turn, they’ll do their best to reciprocate that respect when working with you, across timezones and around the world.
11+
12+
### Reporting a bug
13+
14+
Think you’ve found a bug? We’d love for you to help us get it fixed.
15+
16+
Before you create a new issue, you should [search existing issues](https://github.com/wp-cli/wp-cli/issues?utf8=%E2%9C%93&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 of WP-CLI. You should also check our [documentation on common issues and their fixes](https://wp-cli.org/docs/common-issues/).
17+
18+
Once you’ve done a bit of searching and discovered there isn’t an open or fixed issue for your bug, please [follow our guidelines for submitting a bug report](http://wp-cli.org/docs/bug-reports/) to make sure it gets addressed in a timely manner.
19+
20+
### Creating a pull request
21+
22+
Want to contribute a new feature? WP-CLI is a mature project, and already chock-full of useful functionality. Please first [open a new issue](https://github.com/wp-cli/wp-cli/issues/new) to discuss whether the feature is a good fit for WP-CLI core, or might be better suited as a [community package](https://wp-cli.org/package-index/).
23+
24+
New to the WP-CLI codebase? Check out [issues labeled 'good-first-issue'](https://github.com/wp-cli/wp-cli/labels/good-first-issue) for a place to start. These issues are specially earmarked for new contributors.
25+
26+
Once you've decided to commit the time to seeing your pull request through, please [follow our guidelines for creating a pull request](https://wp-cli.org/docs/pull-requests/) to make sure it's a pleasant experience.
27+
28+
### Improving our documentation
29+
30+
Is documentation your strength? Take a look at the currently open [documentation issues](https://github.com/wp-cli/wp-cli/issues?q=is%3Aopen+is%3Aissue+label%3Ascope%3Adocumentation) and see if you can tackle any of those.
31+
32+
If you believe you’ve found an issue with the documentation, you should [search existing issues](https://github.com/wp-cli/wp-cli/issues?utf8=%E2%9C%93&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 of WP-CLI.
33+
34+
There are a couple different types of documentation currently part of WP-CLI:
35+
36+
* Documentation for individual WP-CLI commands (anything underneath [http://wp-cli.org/commands](http://wp-cli.org/commands)) is contained in the PHPDoc for each command. This means that to edit the documentation for a command, you will need to edit the file that actually provides the functionality for that command. The web documentation is generated from these files at the time of release, so you may not see your changes until the next release.
37+
* Individual documentation pages (anything under [http://wp-cli.org/docs/](http://wp-cli.org/docs/) can be edited by contributing to the [wp-cli.github.com repository on GitHub](https://github.com/wp-cli/wp-cli.github.com). You don't necessarily need to navigate the Github repo though; any page that is part of this repository will have an 'Edit' link in the top right of the page which will take you to the corresponding file on GitHub.
38+
39+
### Contributing in other ways
40+
41+
Feel free to [create an issue](https://github.com/wp-cli/wp-cli/issues/new) with your question, and we'll see if we can find an answer for it.
42+
43+
Alternatively, if you have a WordPress.org account, you may also consider joining the `#cli` channel on the [WordPress.org Slack organization](https://make.wordpress.org/chat/).

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/wp-cli/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: 193 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,193 @@
1+
WP-CLI
2+
======
3+
4+
[WP-CLI](https://wp-cli.org/) is a set of command-line tools for managing [WordPress](https://wordpress.org/) installations. You can update plugins, configure multisite installs and much more, without using a web browser.
5+
6+
For announcements, follow [@wpcli on Twitter](https://twitter.com/wpcli) or [sign up for email updates](https://make.wordpress.org/cli/subscribe/). [Check out the roadmap](https://wp-cli.org/docs/roadmap/) for an overview of what's planned for upcoming releases.
7+
8+
[![Build Status](https://travis-ci.org/wp-cli/wp-cli.svg?branch=master)](https://travis-ci.org/wp-cli/wp-cli) [![Dependency Status](https://gemnasium.com/badges/github.com/wp-cli/wp-cli.svg)](https://gemnasium.com/github.com/wp-cli/wp-cli) [![Average time to resolve an issue](https://isitmaintained.com/badge/resolution/wp-cli/wp-cli.svg)](https://isitmaintained.com/project/wp-cli/wp-cli "Average time to resolve an issue") [![Percentage of issues still open](https://isitmaintained.com/badge/open/wp-cli/wp-cli.svg)](https://isitmaintained.com/project/wp-cli/wp-cli "Percentage of issues still open")
9+
10+
Quick links: [Using](#using) &#124; [Installing](#installing) &#124; [Support](#support) &#124; [Extending](#extending) &#124; [Contributing](#contributing) &#124; [Credits](#credits)
11+
12+
## Using
13+
14+
WP-CLI's goal is to provide a command-line interface for any action you might want to perform in the WordPress admin. For instance, `wp plugin install --activate` ([doc](https://wp-cli.org/commands/plugin/install/)) lets you install and activate a WordPress plugin:
15+
16+
```bash
17+
$ wp plugin install rest-api --activate
18+
Installing WordPress REST API (Version 2) (2.0-beta13)
19+
Downloading install package from https://downloads.wordpress.org/plugin/rest-api.2.0-beta13.zip...
20+
Unpacking the package...
21+
Installing the plugin...
22+
Plugin installed successfully.
23+
Activating 'rest-api'...
24+
Success: Plugin 'rest-api' activated.
25+
```
26+
27+
WP-CLI also includes commands for many things you can't do in the WordPress admin. For example, `wp transient delete --all` ([doc](https://wp-cli.org/commands/transient/delete/)) lets you delete one or all transients:
28+
29+
```bash
30+
$ wp transient delete --all
31+
Success: 34 transients deleted from the database.
32+
```
33+
34+
For a more complete introduction to using WP-CLI, read the [Quick Start guide](https://wp-cli.org/docs/quick-start/). Or, catch up with [shell friends](https://wp-cli.org/docs/shell-friends/) to learn about helpful command line utilities.
35+
36+
Already feel comfortable with the basics? Jump into the [complete list of commands](https://wp-cli.org/commands/) for detailed information on managing themes and plugins, importing and exporting data, performing database search-replace operations and more.
37+
38+
## Installing
39+
40+
Downloading the Phar file is our recommended installation method. Should you need, see also our documentation on [alternative installation methods](https://wp-cli.org/docs/installing/).
41+
42+
Before installing WP-CLI, please make sure your environment meets the minimum requirements:
43+
44+
- UNIX-like environment (OS X, Linux, FreeBSD, Cygwin); limited support in Windows environment
45+
- PHP 5.3.29 or later
46+
- WordPress 3.7 or later
47+
48+
Once you've verified requirements, download the [wp-cli.phar](https://raw.github.com/wp-cli/builds/gh-pages/phar/wp-cli.phar) file using `wget` or `curl`:
49+
50+
```bash
51+
$ curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
52+
```
53+
54+
Next, check if it is working:
55+
56+
```bash
57+
$ php wp-cli.phar --info
58+
```
59+
60+
To use WP-CLI from the command line by typing `wp`, make the file executable and move it to somewhere in your PATH. For example:
61+
62+
```bash
63+
$ chmod +x wp-cli.phar
64+
$ sudo mv wp-cli.phar /usr/local/bin/wp
65+
```
66+
67+
If WP-CLI was installed successfully, you should see something like this when you run `wp --info`:
68+
69+
```bash
70+
$ wp --info
71+
PHP binary: /usr/bin/php5
72+
PHP version: 5.5.9-1ubuntu4.14
73+
php.ini used: /etc/php5/cli/php.ini
74+
WP-CLI root dir: /home/wp-cli/.wp-cli
75+
WP-CLI packages dir: /home/wp-cli/.wp-cli/packages/
76+
WP-CLI global config: /home/wp-cli/.wp-cli/config.yml
77+
WP-CLI project config:
78+
WP-CLI version: 1.1.0
79+
```
80+
81+
### Updating
82+
83+
You can update WP-CLI with `wp cli update` ([doc](https://wp-cli.org/commands/cli/update/)), or by repeating the installation steps.
84+
85+
If WP-CLI is owned by root or another system user, you'll need to run `sudo wp cli update`.
86+
87+
Want to live life on the edge? Run `wp cli update --nightly` to use the latest nightly build of WP-CLI. The nightly build is more or less stable enough for you to use in your development environment, and always includes the latest and greatest WP-CLI features.
88+
89+
### Tab completions
90+
91+
WP-CLI also comes with a tab completion script for Bash and ZSH. Just download [wp-completion.bash](https://raw.githubusercontent.com/wp-cli/wp-cli/master/utils/wp-completion.bash) and source it from `~/.bash_profile`:
92+
93+
```bash
94+
source /FULL/PATH/TO/wp-completion.bash
95+
```
96+
97+
Don't forget to run `source ~/.bash_profile` afterwards.
98+
99+
If using zsh for your shell, you may need to load and start `bashcompinit` before sourcing. Put the following in your `.zshrc`:
100+
101+
```bash
102+
autoload bashcompinit
103+
bashcompinit
104+
source /FULL/PATH/TO/wp-completion.bash
105+
```
106+
107+
## Support
108+
109+
WP-CLI's maintainers and project contributors have limited availability to address general support questions. The [current version of WP-CLI](https://wp-cli.org/docs/roadmap/) is the only officially supported version.
110+
111+
When looking for support, please first look for an answer in one of the following resources:
112+
113+
- [Common issues and their fixes](https://wp-cli.org/docs/common-issues/)
114+
- [Documentation portal](https://wp-cli.org/docs/)
115+
- [Open or closed issues on Github](https://github.com/wp-cli/wp-cli/issues?utf8=%E2%9C%93&q=is%3Aissue)
116+
- [runcommand tips](https://runcommand.io/tips/)
117+
- [WordPress StackExchange forums](https://wordpress.stackexchange.com/questions/tagged/wp-cli)
118+
119+
You can also join the `#cli` channel on the [WordPress.org Slack organization](https://make.wordpress.org/chat/) to see if a community member might have an answer for you.
120+
121+
Github issues are meant for tracking enhancements and bugs of existing commands, not general support. Before submitting a bug report, please [review our best practices](https://wp-cli.org/docs/bug-reports/) to help ensure your issue is addressed in a timely manner.
122+
123+
Please do not ask support questions on Twitter. Twitter isn't an acceptable venue for support because: 1) it's hard to hold conversations in under 140 characters, and 2) Twitter isn't a place where someone with your same question can search for an answer in a prior conversation.
124+
125+
Remember, libre != gratis; the open source license grants you the freedom to use and modify, but not commitments of other people's time. Please be respectful, and set your expectations accordingly.
126+
127+
## Extending
128+
129+
A **command** is an atomic unit of WP-CLI functionality. `wp plugin install` ([doc](https://wp-cli.org/commands/plugin/install/)) is one command. `wp plugin activate` ([doc](https://wp-cli.org/commands/plugin/activate/)) is another.
130+
131+
WP-CLI supports registering any callable class, function, or closure as a command. It reads usage details from the callback's PHPdoc. `WP_CLI::add_command()` ([doc](https://wp-cli.org/docs/internal-api/wp-cli-add-command/)) is used for both internal and third-party command registration.
132+
133+
```php
134+
/**
135+
* Delete an option from the database.
136+
*
137+
* Returns an error if the option didn't exist.
138+
*
139+
* ## OPTIONS
140+
*
141+
* <key>
142+
* : Key for the option.
143+
*
144+
* ## EXAMPLES
145+
*
146+
* $ wp option delete my_option
147+
* Success: Deleted 'my_option' option.
148+
*/
149+
$delete_option_cmd = function( $args ) {
150+
list( $key ) = $args;
151+
152+
if ( ! delete_option( $key ) ) {
153+
WP_CLI::error( "Could not delete '$key' option. Does it exist?" );
154+
} else {
155+
WP_CLI::success( "Deleted '$key' option." );
156+
}
157+
};
158+
WP_CLI::add_command( 'option delete', $delete_option_cmd );
159+
```
160+
161+
WP-CLI comes with dozens of commands. It's easier than it looks to create a custom WP-CLI command. Read the [commands cookbook](https://wp-cli.org/docs/commands-cookbook/) to learn more. Browse the [internal API docs](https://wp-cli.org/docs/internal-api/) to discover a variety of helpful functions you can use in your custom WP-CLI command.
162+
163+
## Contributing
164+
165+
Welcome and thanks!
166+
167+
We appreciate you taking the initiative to contribute to WP-CLI. It’s because of you, and the community around you, that WP-CLI is such a great project.
168+
169+
**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.
170+
171+
Please take a moment to [read these guidelines at depth](https://wp-cli.org/docs/contributing/). Following them helps to communicate that you respect the time of the other contributors to the project. In turn, they’ll do their best to reciprocate that respect when working with you, across timezones and around the world.
172+
173+
## Leadership
174+
175+
WP-CLI is led by these individuals:
176+
177+
* [Daniel Bachhuber](https://github.com/danielbachhuber/) - current maintainer
178+
* [Cristi Burcă](https://github.com/scribu) - previous maintainer
179+
* [Andreas Creten](https://github.com/andreascreten) - founder
180+
181+
Read more about the project's [governance](https://wp-cli.org/docs/governance/) and view a [complete list of contributors](https://github.com/wp-cli/wp-cli/contributors).
182+
183+
## Credits
184+
185+
Besides the libraries defined in [composer.json](composer.json), we have used code or ideas from the following projects:
186+
187+
* [Drush](https://github.com/drush-ops/drush) for... a lot of things
188+
* [wpshell](https://code.trac.wordpress.org/browser/wpshell) for `wp shell`
189+
* [Regenerate Thumbnails](https://wordpress.org/plugins/regenerate-thumbnails/) for `wp media regenerate`
190+
* [Search-Replace-DB](https://github.com/interconnectit/Search-Replace-DB) for `wp search-replace`
191+
* [WordPress-CLI-Exporter](https://github.com/Automattic/WordPress-CLI-Exporter) for `wp export`
192+
* [WordPress-CLI-Importer](https://github.com/Automattic/WordPress-CLI-Importer) for `wp import`
193+
* [wordpress-plugin-tests](https://github.com/benbalter/wordpress-plugin-tests/) for `wp scaffold plugin-tests`

composer.json

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{
2+
"name": "wp-cli/wp-cli",
3+
"description": "A command line interface for WordPress",
4+
"keywords": [ "cli", "wordpress" ],
5+
"homepage": "http://wp-cli.org",
6+
"license": "MIT",
7+
"support": {
8+
"issues": "https://github.com/wp-cli/wp-cli/issues",
9+
"source": "https://github.com/wp-cli/wp-cli",
10+
"docs": "https://make.wordpress.org/cli/handbook/"
11+
},
12+
"bin": [
13+
"bin/wp.bat", "bin/wp"
14+
],
15+
"require": {
16+
"php": ">=5.3.29",
17+
"wp-cli/php-cli-tools": "~0.11.2",
18+
"mustache/mustache": "~2.4",
19+
"mustangostang/spyc": "~0.5",
20+
"composer/semver": "~1.0",
21+
"ramsey/array_column": "~1.1",
22+
"rmccue/requests" : "~1.6",
23+
"symfony/finder": "~2.7",
24+
"symfony/yaml": "~2.7",
25+
"symfony/filesystem": "~2.7",
26+
"symfony/config": "~2.7",
27+
"symfony/console": "~2.7",
28+
"symfony/debug": "~2.7",
29+
"symfony/dependency-injection": "~2.7",
30+
"symfony/event-dispatcher": "~2.7",
31+
"symfony/process": "~2.1",
32+
"symfony/translation": "~2.7",
33+
"composer/composer": "^1.2.0",
34+
"wp-cli/cron-command": "^1.0",
35+
"wp-cli/import-command": "^1.0",
36+
"wp-cli/db-command": "^1.0",
37+
"wp-cli/media-command": "^1.0",
38+
"wp-cli/export-command": "^1.0"
39+
},
40+
"require-dev": {
41+
"phpunit/phpunit": "3.7.*",
42+
"behat/behat": "2.5.*",
43+
"roave/security-advisories": "dev-master"
44+
},
45+
"suggest": {
46+
"psy/psysh": "Enhanced `wp shell` functionality"
47+
},
48+
"autoload": {
49+
"psr-0": { "WP_CLI": "php" }
50+
}
51+
}

0 commit comments

Comments
 (0)