Skip to content

Commit 6a98e5a

Browse files
committed
Merge branch 'develop'
2 parents d029930 + a0c9cc3 commit 6a98e5a

38 files changed

Lines changed: 3343 additions & 443 deletions

.editorconfig

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,11 @@ trim_trailing_whitespace = true
1010
indent_style = space
1111
indent_size = 4
1212

13-
[{.jshintrc,*.json,*.yml}]
13+
[*.{jshintrc,json,yml,feature}]
1414
indent_size = 2
1515

1616
[{*.txt,wp-config-sample.php}]
1717
end_of_line = crlf
18+
19+
[composer.json]
20+
indent_size = 4

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ composer.lock
33
node_modules/
44
vendor/
55
.idea
6+
/wordpress

.travis.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
language: php
2+
3+
php:
4+
- 5.5
5+
- 5.6
6+
- 7.0
7+
8+
install: composer install
9+
10+
before_script:
11+
- composer validate --strict
12+
- mysql -e 'CREATE DATABASE wp_cli_test;' -uroot
13+
- mysql -e 'GRANT ALL PRIVILEGES ON wp_cli_test.* TO "wp_cli_test"@"localhost" IDENTIFIED BY "password1"' -uroot
14+
15+
script: composer run-behat
16+
17+
cache:
18+
directories:
19+
- vendor
20+
21+
notifications:
22+
email:
23+
on_success: never
24+
on_failure: change

PREREQUISITES.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
### Prerequisites
2+
3+
This command leverages [Laravel Valet](https://laravel.com/docs/5.2/valet#installation) -- the development environment for Mac minimalists.
4+
Because of this **support is unfortunately limited to Mac only**.
5+
6+
Follow the [installation instructions](https://laravel.com/docs/5.2/valet#installation) on the Laravel documentation to get started.
7+
This is what makes it possible to load a site in your browser immediately after creating it, without any other configuration.
8+
9+
You will also need some understanding of how Valet works, especially the portion on [Serving Sites](https://laravel.com/docs/5.2/valet#serving-sites).

README.md

Lines changed: 144 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,170 @@
1-
WP-CLI Valet Command
2-
====================
1+
# WP-CLI Valet Command
32

4-
Quick links: [Installing](#installing) | [Contributing](#contributing)
3+
White-glove services for turn-key installs in seconds.
54

6-
## Overview
7-
```
8-
NAME
5+
[![Build Status](https://travis-ci.org/aaemnnosttv/wp-cli-valet-command.svg?branch=master)](https://travis-ci.org/aaemnnosttv/wp-cli-valet-command)
96

10-
wp valet
7+
Quick links: [Using](#using) | [Installing](#installing) | [Contributing](#contributing)
118

12-
DESCRIPTION
9+
## Using
1310

14-
Zonda is golden.
11+
This package implements the following commands:
1512

16-
SYNOPSIS
13+
### wp valet new
1714

18-
wp valet <command>
15+
Create a new WordPress install -- fast
1916

20-
SUBCOMMANDS
17+
~~~
18+
wp valet new <name> [--project=<project>] [--version=<version>] [--locale=<locale>] [--db=<db>] [--dbname=<dbname>] [--dbuser=<dbuser>] [--dbpass=<dbpass>] [--dbprefix=<dbprefix>] [--admin_user=<username>] [--admin_password=<password>] [--admin_email=<email>] [--unsecure] [--portable]
19+
~~~
2120

22-
new Create a new WordPress install -- fast
21+
This command will spin up a new WordPress installation -- complete with database and https
22+
_ready-to-use in your browser_ faster than you can put your pants on.
2323

24-
```
24+
**OPTIONS**
2525

26-
## `new`
26+
<name>
27+
Site domain name without TLD. This will become the directory name of the project root.
28+
Eg: To create an install for example.dev, `wp valet new example`
2729

28-
Currently the only valet subcommand, this command can spin up a new WordPress installation, complete with DB, and ready to use in your browser over https faster than you can put your pants on.
30+
[--project=<project>]
31+
The WordPress project to install. Choose from any project supported by Laravel Valet.
32+
---
33+
default: wp
34+
options:
35+
- wp
36+
- bedrock
37+
---
2938

30-
You should have some understanding of how Valet works, especially the portion on [Serving Sites](https://laravel.com/docs/5.2/valet#serving-sites)
39+
[--version=<version>]
40+
WordPress version to install.
41+
---
42+
default: latest
43+
---
3144

32-
From the terminal, within a Valet "parked" directory, you can now run `wp valet new my-project`
33-
Once complete, you can now view your new site at https://my-project.dev.
45+
[--locale=<locale>]
46+
Select which language you want to install.
47+
48+
[--db=<db>]
49+
Database driver to provision the site with.
50+
---
51+
default: mysql
52+
options:
53+
- mysql
54+
- sqlite
55+
---
56+
57+
[--dbname=<dbname>]
58+
Database name (MySQL only).
59+
Defaults to 'wp_<name>'.
60+
61+
[--dbuser=<dbuser>]
62+
Database User (MySQL only).
63+
---
64+
default: root
65+
---
66+
67+
[--dbpass=<dbpass>]
68+
Set the database user password (MySQL only).
69+
---
70+
Default: ''
71+
---
72+
73+
[--dbprefix=<dbprefix>]
74+
Set the database table prefix.
75+
---
76+
default: 'wp_'
77+
---
78+
79+
[--admin_user=<username>]
80+
The username to create for the WordPress admin user.
81+
---
82+
default: admin
83+
---
84+
85+
[--admin_password=<password>]
86+
The password to create for the WordPress admin user.
87+
---
88+
default: admin
89+
---
90+
91+
[--admin_email=<email>]
92+
The email to use for the WordPress admin user.
93+
94+
[--unsecure]
95+
Provision the site for http rather than https.
96+
97+
[--portable]
98+
Provision the site to be portable. Implies --unsecure and --db=sqlite.
99+
100+
101+
102+
### wp valet destroy
103+
104+
Completely remove an installation.
105+
106+
~~~
107+
wp valet destroy <name> [--yes]
108+
~~~
109+
110+
This will drop the database, and delete all of the files as well as
111+
remove any self-signed TLS certificate that was generated for serving
112+
this install over https.
113+
114+
**OPTIONS**
115+
116+
<name>
117+
Site domain name without TLD. It should match the directory name of the project root.
118+
119+
[--yes]
120+
Pre-approve the confirmation to delete all files and drop the database.
34121

35122
## Installing
36123

37124
### Prerequisites
38-
This command leverages [Laravel Valet](https://laravel.com/docs/5.2/valet#installation) which is installed globally via Composer.
125+
126+
This command leverages [Laravel Valet](https://laravel.com/docs/5.2/valet#installation) -- the development environment for Mac minimalists.
127+
Because of this **support is unfortunately limited to Mac only**.
128+
39129
Follow the [installation instructions](https://laravel.com/docs/5.2/valet#installation) on the Laravel documentation to get started.
130+
This is what makes it possible to load a site in your browser immediately after creating it, without any other configuration.
131+
132+
You will also need some understanding of how Valet works, especially the portion on [Serving Sites](https://laravel.com/docs/5.2/valet#serving-sites).
40133

41134
Installing this package requires WP-CLI v0.23.0 or greater. Update to the latest stable release with `wp cli update`.
42-
Once you've done so, you can install this package with `wp package install aaemnnosttv/wp-cli-valet-command`
43135

44-
## Database Options
45-
New sites create a new MySQL database by default, but the `new` command also supports using [SQLite](https://www.sqlite.org/) for a completely portable install. Simply add `--db=sqlite` when running `wp valet new`.
136+
Once you've done so, you can install this package with `wp package install aaemnnosttv/wp-cli-valet-command`.
46137

47138
## Contributing
48139

49-
Code and ideas are more than welcome.
140+
We appreciate you taking the initiative to contribute to this project.
141+
142+
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.
143+
144+
### Reporting a bug
145+
146+
Think you’ve found a bug? We’d love for you to help us get it fixed.
147+
148+
Before you create a new issue, you should [search existing issues](https://github.com/aaemnnosttv/wp-cli-valet-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.
149+
150+
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/aaemnnosttv/wp-cli-valet-command/issues/new) with the following:
151+
152+
1. What you were doing (e.g. "When I run `wp post list`").
153+
2. What you saw (e.g. "I see a fatal about a class being undefined.").
154+
3. What you expected to see (e.g. "I expected to see the list of posts.")
155+
156+
Include as much detail as you can, and clear steps to reproduce if possible.
157+
158+
### Creating a pull request
159+
160+
Want to contribute a new feature? Please first [open a new issue](https://github.com/aaemnnosttv/wp-cli-valet-command/issues/new) to discuss whether the feature is a good fit for the project.
161+
162+
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:
163+
164+
1. Create a feature branch for each contribution.
165+
2. Submit your pull request early for feedback.
166+
3. Include functional tests with your changes. [Read the WP-CLI documentation](https://wp-cli.org/docs/pull-requests/#functional-tests) for an introduction.
167+
4. Follow the [WordPress Coding Standards](http://make.wordpress.org/core/handbook/coding-standards/).
168+
50169

51-
Please [open an issue](https://github.com/aaemnnosttv/wp-cli-valet-command/issues) with questions, feedback, and violent dissent.
170+
*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.*

bin/install-package-tests.sh

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/usr/bin/env bash
2+
3+
set -ex
4+
5+
PACKAGE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )"/../ && pwd )"
6+
7+
download() {
8+
if [ `which curl` ]; then
9+
curl -s "$1" > "$2";
10+
elif [ `which wget` ]; then
11+
wget -nv -O "$2" "$1"
12+
fi
13+
}
14+
15+
install_wp_cli() {
16+
17+
# the Behat test suite will pick up the executable found in $WP_CLI_BIN_DIR
18+
mkdir -p $WP_CLI_BIN_DIR
19+
download https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli-nightly.phar $WP_CLI_BIN_DIR/wp
20+
chmod +x $WP_CLI_BIN_DIR/wp
21+
22+
}
23+
24+
download_behat() {
25+
26+
cd $PACKAGE_DIR
27+
download https://getcomposer.org/installer installer
28+
php installer
29+
php composer.phar require --dev behat/behat='~2.5'
30+
31+
}
32+
33+
install_db() {
34+
mysql -e 'CREATE DATABASE IF NOT EXISTS wp_cli_test;' -uroot
35+
mysql -e 'GRANT ALL PRIVILEGES ON wp_cli_test.* TO "wp_cli_test"@"localhost" IDENTIFIED BY "password1"' -uroot
36+
}
37+
38+
install_wp_cli
39+
download_behat
40+
install_db

command.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
use WP_CLI_Valet\ValetCommand;
4+
35
if (defined('WP_CLI') && WP_CLI) {
4-
WP_CLI::add_command('valet', WP_CLI_Valet\Valet_Command::class);
6+
ValetCommand::register();
57
}

composer.json

Lines changed: 35 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,50 @@
11
{
22
"name": "aaemnnosttv/wp-cli-valet-command",
3-
"description": "Harness the power of Laravel Valet for creating fully functional WordPress installs in seconds.",
3+
"description": "White-glove services for turn-key installs in seconds.",
44
"keywords": ["wordpress", "laravel", "valet", "zonda"],
55
"license": "MIT",
66
"authors": [
7-
{
8-
"name": "Evan Mattson",
9-
"email": "me@aaemnnost.tv",
10-
"homepage": "https://aaemnnost.tv"
11-
}
7+
{
8+
"name": "Evan Mattson",
9+
"email": "me@aaemnnost.tv",
10+
"homepage": "https://aaemnnost.tv"
11+
}
1212
],
13-
"homepage": "https://github.com/aaemnnosttv/wp-cli-valet-command",
13+
"homepage": "https://aaemnnost.tv/wp-cli-commands/valet/",
1414
"support": {
15-
"issues": "https://github.com/aaemnnosttv/wp-cli-valet-command/issues"
15+
"issues": "https://github.com/aaemnnosttv/wp-cli-valet-command/issues"
1616
},
1717
"autoload": {
18-
"psr-4": {"WP_CLI_Valet\\": "src"},
19-
"files": ["command.php"]
18+
"psr-4": {
19+
"WP_CLI_Valet\\": "src"
20+
},
21+
"files": [
22+
"command.php"
23+
]
2024
},
2125
"require": {
22-
"php": "^5.5|^7.0"
26+
"php": "^5.5|^7.0",
27+
"illuminate/container": "^5.1",
28+
"symfony/filesystem": "^2.7 | ^3.0"
2329
},
2430
"require-dev": {
25-
"wp-cli/wp-cli": "^0.24.1"
31+
"wp-cli/wp-cli": "^0.24.1",
32+
"behat/behat": "~2.5",
33+
"johnpbloch/wordpress": "^4.6"
34+
},
35+
"scripts": {
36+
"update-readme": "wp scaffold package-readme . --force",
37+
"run-behat": "WP_CLI_BIN_DIR=$PWD/vendor/bin vendor/bin/behat --ansi --format=progress"
38+
},
39+
"extra": {
40+
"commands": [
41+
"valet new",
42+
"valet destroy"
43+
],
44+
"readme": {
45+
"installing": {
46+
"pre": "PREREQUISITES.md"
47+
}
48+
}
2649
}
2750
}

0 commit comments

Comments
 (0)