OSDN Git Service

wvm/wvm.git
11 years agomake `wp db query` optionally read from STDIN
scribu [Mon, 29 Apr 2013 15:36:25 +0000 (18:36 +0300)]
make `wp db query` optionally read from STDIN

11 years agosince it's called dev-build, install the development dependencies
scribu [Mon, 29 Apr 2013 17:41:03 +0000 (20:41 +0300)]
since it's called dev-build, install the development dependencies

11 years agorename create_cmd() to esc_cmd()
scribu [Mon, 29 Apr 2013 16:38:51 +0000 (19:38 +0300)]
rename create_cmd() to esc_cmd()

Matches WP escaping functions: esc_sql(), esc_html() etc.

11 years agocore command: "use WP_CLI\Utils;"
scribu [Mon, 29 Apr 2013 16:31:45 +0000 (19:31 +0300)]
core command: "use WP_CLI\Utils;"

11 years agocore download: refactor curl + tar into a single command string
scribu [Mon, 29 Apr 2013 16:29:55 +0000 (19:29 +0300)]
core download: refactor curl + tar into a single command string

11 years agocore download: remove duplicate code for creating the directory
scribu [Mon, 29 Apr 2013 16:22:31 +0000 (19:22 +0300)]
core download: remove duplicate code for creating the directory

11 years agoUse `wp core download` in Travis tests too.
scribu [Mon, 29 Apr 2013 15:58:33 +0000 (18:58 +0300)]
Use `wp core download` in Travis tests too.

11 years agoRename `wp db connect` back to `wp db cli`
scribu [Mon, 29 Apr 2013 15:16:26 +0000 (18:16 +0300)]
Rename `wp db connect` back to `wp db cli`

`db connect` is rather ambigous: you connect to the database, and then
what?!

`db cli` is more explicit: connect to the database and open a MySQL command-line session

11 years agoMerge pull request #422 from wp-cli/post-list-status
Cristi Burcă [Mon, 29 Apr 2013 11:50:50 +0000 (04:50 -0700)]
Merge pull request #422 from wp-cli/post-list-status

Ensure `wp post list` returns posts of all statuses by default

11 years agoadd post_status to `wp post list` output
scribu [Mon, 29 Apr 2013 11:45:00 +0000 (14:45 +0300)]
add post_status to `wp post list` output

11 years agoTest: `wp post list` should contain both 'draft' and 'publish' posts
Daniel Bachhuber [Mon, 29 Apr 2013 02:38:22 +0000 (19:38 -0700)]
Test: `wp post list` should contain both 'draft' and 'publish' posts

11 years agoRefactor checkThatCsvStringContainsCsvString() such that:
Daniel Bachhuber [Mon, 29 Apr 2013 02:34:06 +0000 (19:34 -0700)]
Refactor checkThatCsvStringContainsCsvString() such that:
* expected CSV can be in any row of the actual CSV
* actual CSV must contain all expected CSV data rows

11 years agoBehat step for checking a CSV contains string
Daniel Bachhuber [Mon, 29 Apr 2013 01:44:39 +0000 (18:44 -0700)]
Behat step for checking a CSV contains string

11 years agoFix typo
Daniel Bachhuber [Mon, 29 Apr 2013 01:07:39 +0000 (18:07 -0700)]
Fix typo

11 years agoMerge pull request #421 from wp-cli/update-composer-lock
Cristi Burcă [Sun, 28 Apr 2013 20:33:33 +0000 (13:33 -0700)]
Merge pull request #421 from wp-cli/update-composer-lock

Update composer.lock to latest

11 years agoUpdate composer.lock to latest
Daniel Bachhuber [Sun, 28 Apr 2013 00:17:31 +0000 (17:17 -0700)]
Update composer.lock to latest

11 years agoEnsure `wp post list` returns posts of all statuses by default, as WP_Query behaves...
Daniel Bachhuber [Sat, 27 Apr 2013 23:57:55 +0000 (16:57 -0700)]
Ensure `wp post list` returns posts of all statuses by default, as WP_Query behaves differently in the WP_ADMIN context.

See #412

11 years agovalidate --post_id only once and issue warning
scribu [Sat, 27 Apr 2013 10:38:17 +0000 (13:38 +0300)]
validate --post_id only once and issue warning

see #367

11 years agonested ternary operators are bad, mkay...
scribu [Sat, 27 Apr 2013 10:33:55 +0000 (13:33 +0300)]
nested ternary operators are bad, mkay...

see #367

11 years agoShorten description for `wp media import`
scribu [Sat, 27 Apr 2013 10:32:13 +0000 (13:32 +0300)]
Shorten description for `wp media import`

see #367

11 years agoMerge pull request #367 from goldenapples/goldenapples/media-import
Cristi Burcă [Sat, 27 Apr 2013 09:34:46 +0000 (02:34 -0700)]
Merge pull request #367 from goldenapples/goldenapples/media-import

Implement `wp media import` command

11 years agoUse variables in feature steps for readability
goldenapples [Fri, 26 Apr 2013 23:55:36 +0000 (16:55 -0700)]
Use variables in feature steps for readability

Rewrote the feature step so that it displays the actual command being
run, and uses variable substitution.

* I had to modify the definition of the "file should exist" step to
  allow variable substitution. All of the existing tests still pass, but
  I'm not sure if this is best practice. I can write a new step instead,
  if that makes more sense.

11 years agoadd functional test for --require flag
scribu [Fri, 26 Apr 2013 22:38:49 +0000 (01:38 +0300)]
add functional test for --require flag

11 years agoAdd behat features to test against local files
goldenapples [Fri, 26 Apr 2013 22:32:50 +0000 (15:32 -0700)]
Add behat features to test against local files

One test for failure on trying to import non-existant image,
and one to make sure that local images are not removed on import

11 years agoFor local media imports, copy to tempfile before importing
goldenapples [Fri, 26 Apr 2013 21:39:04 +0000 (14:39 -0700)]
For local media imports, copy to tempfile before importing

Apparently `wp_handle_sideload` performs a`rename()` operation on the
file it's sideloading. In this case thats an unexpected side effect -
you don't want the original image to go away when importing it to
WordPress.

11 years agodev-build: check that 'php' is available before doing anything else
scribu [Fri, 26 Apr 2013 19:29:00 +0000 (22:29 +0300)]
dev-build: check that 'php' is available before doing anything else

see #419

11 years agoMerge pull request #396 from wp-cli/uniform-cmd-add
Cristi Burcă [Fri, 26 Apr 2013 19:23:17 +0000 (12:23 -0700)]
Merge pull request #396 from wp-cli/uniform-cmd-add

Don't instantiate single command classes

11 years agomerge MethodSubcommand into Subcommand
scribu [Fri, 26 Apr 2013 18:50:59 +0000 (21:50 +0300)]
merge MethodSubcommand into Subcommand

11 years agoinstantiate MethodSubcommand instead of Subcommand
scribu [Fri, 26 Apr 2013 18:32:28 +0000 (21:32 +0300)]
instantiate MethodSubcommand instead of Subcommand

11 years agoremove unnecessary WP_CLI\Commands namespace
scribu [Fri, 26 Apr 2013 18:27:09 +0000 (21:27 +0300)]
remove unnecessary WP_CLI\Commands namespace

11 years agocheck for __invoke() method instead of parameter type
scribu [Fri, 26 Apr 2013 17:43:10 +0000 (20:43 +0300)]
check for __invoke() method instead of parameter type

11 years agoUpdate man page for `wp media import`
goldenapples [Thu, 25 Apr 2013 20:22:03 +0000 (13:22 -0700)]
Update man page for `wp media import`

Add option description for `--featured_image`, and briefly explain examples

11 years agoAdd `--featured_image` associative arg
goldenapples [Thu, 25 Apr 2013 19:40:29 +0000 (12:40 -0700)]
Add `--featured_image` associative arg

This flag will set the uploaded image to be the post thumbnail of the
post its attached to.

Also, fix the success message and the Behat feature, so that tests don't
fail on environments that use a different tmp path.

11 years agoAdd Behat feature for `wp media import`
goldenapples [Thu, 18 Apr 2013 00:01:53 +0000 (17:01 -0700)]
Add Behat feature for `wp media import`

11 years agoRename arguments to make more logical sense
goldenapples [Thu, 28 Mar 2013 17:21:07 +0000 (10:21 -0700)]
Rename arguments to make more logical sense

Use the same field labels as are used by the admin media uploader, to
avoid confusion: title / caption / alt / description; rather than the
variable names used internally, where 'description' is really title and
so on.

11 years agoRemove filename completion for wp media import
goldenapples [Thu, 28 Mar 2013 17:19:28 +0000 (10:19 -0700)]
Remove filename completion for wp media import

Filtering bash completions breaks bash's default filename globbing,
which is a more useful feature here.

11 years agoAdd capability to download files from URL
goldenapples [Thu, 28 Mar 2013 00:24:51 +0000 (17:24 -0700)]
Add capability to download files from URL

If a recognizable scheme is passed in the <file> argument, `wp media
import` will attempt to download the file to a temp directory before
importing it.

11 years agoInitial implementation of wp media import
goldenapples [Wed, 27 Mar 2013 22:03:45 +0000 (15:03 -0700)]
Initial implementation of wp media import

Introduces `wp media import` command to sideload images and import
them as attachments. Needs tests, second opinion, etc.

11 years agoDefine WP_ADMIN before loading WordPress
scribu [Tue, 23 Apr 2013 16:39:21 +0000 (19:39 +0300)]
Define WP_ADMIN before loading WordPress

... where "loading WordPress" also includes loading plugins and themes.

Also, define WP_NETWORK_ADMIN and WP_USER_ADMIN, for completeness.

see #385

11 years agoMerge pull request #407 from wp-cli/term-create-porcelain
Cristi Burcă [Tue, 23 Apr 2013 14:07:19 +0000 (07:07 -0700)]
Merge pull request #407 from wp-cli/term-create-porcelain

Improvements to `wp term` output

11 years agoSimulate and announce a /wp-admin/ page load
scribu [Tue, 23 Apr 2013 13:42:50 +0000 (16:42 +0300)]
Simulate and announce a /wp-admin/ page load

Most of the built-in commands need access to code from
wp-admin/includes/ so it makes sense to load it upfront.

Since we're already doing that, it seems like a good idea to also
announce this fact to plugins, by setting WP_ADMIN to true.

And since we're setting WP_ADMIN to true, we don't need to set up the
global $wp_query instance anymore, because the only admin screen where
it's set is the post list screen (wp-admin/edit.php).

See #385

11 years agoMerge pull request #409 from mwilliamson/download-tmp-dir
Cristi Burcă [Mon, 22 Apr 2013 10:02:59 +0000 (03:02 -0700)]
Merge pull request #409 from mwilliamson/download-tmp-dir

Don't create temporary wordpress directory during "wp core download"

11 years agoDon't create temporary wordpress directory during "wp core download"
Michael Williamson [Sun, 21 Apr 2013 21:36:04 +0000 (22:36 +0100)]
Don't create temporary wordpress directory during "wp core download"

11 years agoBalance ze curly braces to meet WP standards
Daniel Bachhuber [Sun, 21 Apr 2013 14:32:11 +0000 (07:32 -0700)]
Balance ze curly braces to meet WP standards

https://github.com/wp-cli/wp-cli/pull/407/files#r3886566

11 years agoImprovements to `wp term` output
Daniel Bachhuber [Sun, 21 Apr 2013 04:27:00 +0000 (21:27 -0700)]
Improvements to `wp term` output

* Add `--porcelain` argument to `wp term create`
* `wp term create` should include term ID in success message
* `wp term delete` includes the term ID of the deleted term
* Updated tests / doc

See https://github.com/wp-cli/wp-cli/issues/399#issuecomment-16685216

11 years agoMerge pull request #405 from wp-cli/format-ids
Cristi Burcă [Fri, 19 Apr 2013 23:14:31 +0000 (16:14 -0700)]
Merge pull request #405 from wp-cli/format-ids

Add `--ids` support to `wp term list`, but convert `--ids` to `--format=ids`

11 years agouse --format=ids in user.feature
scribu [Fri, 19 Apr 2013 23:01:41 +0000 (02:01 +0300)]
use --format=ids in user.feature

11 years agoupdate `wp post delete` example
scribu [Fri, 19 Apr 2013 23:01:10 +0000 (02:01 +0300)]
update `wp post delete` example

11 years agotransparently convert --ids to --format=ids
scribu [Fri, 19 Apr 2013 22:57:24 +0000 (01:57 +0300)]
transparently convert --ids to --format=ids

this keeps the back-compat code separate from the command implementation

11 years agoUpdate man for `wp post list`
Daniel Bachhuber [Fri, 19 Apr 2013 22:32:16 +0000 (15:32 -0700)]
Update man for `wp post list`

11 years agoConvert `wp post list --ids` to `wp post list --format=ids`
Daniel Bachhuber [Fri, 19 Apr 2013 22:27:20 +0000 (15:27 -0700)]
Convert `wp post list --ids` to `wp post list --format=ids`

11 years agoJSON format test for `wp user list`
Daniel Bachhuber [Fri, 19 Apr 2013 21:43:17 +0000 (14:43 -0700)]
JSON format test for `wp user list`

Also, fix the CSV used in the setup of the scenario as it originally caused the test to fail

11 years agoConvert `wp user list --ids` to `wp user list --format=ids`
Daniel Bachhuber [Fri, 19 Apr 2013 21:27:20 +0000 (14:27 -0700)]
Convert `wp user list --ids` to `wp user list --format=ids`

Also, dropped the formatting of the `$output_items`, as a user is already a WP_User object and the formatting is handled within our `format_items()` util

11 years agoRefactor to allow 'ids' be passed to `format_items()` as a formatting argument
Daniel Bachhuber [Fri, 19 Apr 2013 21:08:31 +0000 (14:08 -0700)]
Refactor to allow 'ids' be passed to `format_items()` as a formatting argument

11 years agowp term list: Support for `--ids` argument
Daniel Bachhuber [Fri, 19 Apr 2013 04:04:17 +0000 (21:04 -0700)]
wp term list: Support for `--ids` argument

11 years agoadd man page for scaffold child-theme. see #339
scribu [Fri, 19 Apr 2013 21:26:38 +0000 (00:26 +0300)]
add man page for scaffold child-theme. see #339

11 years agoLand `wp scaffold child-theme`
scribu [Fri, 19 Apr 2013 21:19:20 +0000 (00:19 +0300)]
Land `wp scaffold child-theme`

closes #339

11 years agostyle fixes for scaffold child-theme
scribu [Fri, 19 Apr 2013 21:19:08 +0000 (00:19 +0300)]
style fixes for scaffold child-theme

11 years agomake --parent_theme mandatory
scribu [Fri, 19 Apr 2013 21:14:37 +0000 (00:14 +0300)]
make --parent_theme mandatory

11 years agorename `scaffold child_theme` to `scaffold child-theme`
scribu [Fri, 19 Apr 2013 21:10:28 +0000 (00:10 +0300)]
rename `scaffold child_theme` to `scaffold child-theme`

11 years agoSimplify expression of the run with errors condition
Daniel Bachhuber [Fri, 19 Apr 2013 20:33:52 +0000 (13:33 -0700)]
Simplify expression of the run with errors condition

See https://github.com/wp-cli/wp-cli/pull/398/files#r3869578

11 years agoSkip checking these numeric fields, as they might change during the tests
Daniel Bachhuber [Fri, 19 Apr 2013 20:30:55 +0000 (13:30 -0700)]
Skip checking these numeric fields, as they might change during the tests

See https://github.com/wp-cli/wp-cli/pull/398/files#r3869915

11 years agoMove declaration of compareContents() outside of a function, to avoid fatals when...
Daniel Bachhuber [Fri, 19 Apr 2013 20:28:03 +0000 (13:28 -0700)]
Move declaration of compareContents() outside of a function, to avoid fatals when the function is declared twice

See https://github.com/wp-cli/wp-cli/pull/398/files#r3869537

11 years agoMerge pull request #397 from wp-cli/composer-ignore
Cristi Burcă [Fri, 19 Apr 2013 08:21:41 +0000 (01:21 -0700)]
Merge pull request #397 from wp-cli/composer-ignore

Ignore composer.phar, as it's installed separately from the project

11 years agoActually fix failing tests.
Daniel Bachhuber [Fri, 19 Apr 2013 03:35:29 +0000 (20:35 -0700)]
Actually fix failing tests.

Functions defined inside of functions cause everything to fatal when the parent function is called twice.

11 years agoNewline fix for failed test
Daniel Bachhuber [Fri, 19 Apr 2013 02:14:15 +0000 (19:14 -0700)]
Newline fix for failed test

11 years agoFunctional test for creating / listing a term
Daniel Bachhuber [Fri, 19 Apr 2013 02:03:11 +0000 (19:03 -0700)]
Functional test for creating / listing a term

11 years agoIgnore composer.phar, as it's installed separately from the project
Daniel Bachhuber [Fri, 19 Apr 2013 01:24:58 +0000 (18:24 -0700)]
Ignore composer.phar, as it's installed separately from the project

11 years agoMerge pull request #391 from linepress/scaffold-fix
Cristi Burcă [Wed, 17 Apr 2013 09:10:13 +0000 (02:10 -0700)]
Merge pull request #391 from linepress/scaffold-fix

Scaffold tax queryvar fix

11 years agoFixed query_var using slug instead of boolean TRUE
jmslbam [Tue, 16 Apr 2013 23:12:09 +0000 (01:12 +0200)]
Fixed query_var using slug instead of boolean TRUE

11 years agoMerge pull request #378 from j3lamp/master
Cristi Burcă [Mon, 15 Apr 2013 20:30:10 +0000 (13:30 -0700)]
Merge pull request #378 from j3lamp/master

`post get` command

11 years agoRefactored the poorly named `compareJson()` function into the more accurate `checkTha...
John Lamp [Mon, 15 Apr 2013 02:29:30 +0000 (22:29 -0400)]
Refactored the poorly named `compareJson()` function into the more accurate `checkThatJsonStringContainsJsonString()` function which encapsulates the calls to `json_decode()`.

11 years agomark some iterator methods as private
scribu [Sun, 14 Apr 2013 23:38:23 +0000 (02:38 +0300)]
mark some iterator methods as private

see #390

11 years agomake query string mandatory first parameter in Iterators\Query constructor
scribu [Sun, 14 Apr 2013 23:37:32 +0000 (02:37 +0300)]
make query string mandatory first parameter in Iterators\Query constructor

see #390

11 years agoMerge pull request #390 from wp-cli/refactor-iterators
Cristi Burcă [Sun, 14 Apr 2013 22:00:50 +0000 (15:00 -0700)]
Merge pull request #390 from wp-cli/refactor-iterators

Move iterators to inner namespace

11 years agoadd smoke test for wp user import-csv
scribu [Sun, 14 Apr 2013 21:57:16 +0000 (00:57 +0300)]
add smoke test for wp user import-csv

11 years agofix class reference in Iterators/Table.php
scribu [Sun, 14 Apr 2013 20:17:07 +0000 (23:17 +0300)]
fix class reference in Iterators/Table.php

11 years agoadd smoke test for search-replace
scribu [Sun, 14 Apr 2013 20:13:56 +0000 (23:13 +0300)]
add smoke test for search-replace

11 years agoon OS X, wc -l inexplicably outputs whitespace before the result
scribu [Sun, 14 Apr 2013 19:18:42 +0000 (22:18 +0300)]
on OS X, wc -l inexplicably outputs whitespace before the result

11 years agomove iterators to separate namespace
scribu [Sun, 14 Apr 2013 19:11:05 +0000 (22:11 +0300)]
move iterators to separate namespace

11 years agoRemoved CSV format from `post get`, with JSON format it is redundent, etc.
John Lamp [Sun, 14 Apr 2013 00:46:32 +0000 (20:46 -0400)]
Removed CSV format from `post get`, with JSON format it is redundent, etc.
Removed the `post_content` field from the table format output as the table becomes unweildy and the extremely long value of the content or the content itself causes problems with the table processing. Besides, chances are if one wanted the contents and the other fields JSON would be easier anyway.

11 years agoMerge pull request #386 from wp-cli/post-list-format
Cristi Burcă [Sat, 13 Apr 2013 18:52:54 +0000 (11:52 -0700)]
Merge pull request #386 from wp-cli/post-list-format

Support for `--format` when using `wp post list`

11 years agoMerge pull request #387 from twisty/master
Cristi Burcă [Sat, 13 Apr 2013 18:45:21 +0000 (11:45 -0700)]
Merge pull request #387 from twisty/master

Example in man page for 'core is-installed' doesn't work

11 years agoAdded the `--feature` option for `post get`.
John Lamp [Sat, 13 Apr 2013 01:21:33 +0000 (21:21 -0400)]
Added the `--feature` option for `post get`.

11 years agoFix example for 'core is-installed'
Tim Brayshaw [Fri, 12 Apr 2013 23:10:15 +0000 (00:10 +0100)]
Fix example for 'core is-installed'

11 years agoSupport for `--format` when using `wp post list`
Daniel Bachhuber [Fri, 12 Apr 2013 17:06:16 +0000 (10:06 -0700)]
Support for `--format` when using `wp post list`

11 years agoRevert a134ce6e46561e9f36ee5efeb33e69ad97b97141
Daniel Bachhuber [Fri, 12 Apr 2013 16:47:39 +0000 (09:47 -0700)]
Revert a134ce6e46561e9f36ee5efeb33e69ad97b97141

See https://github.com/wp-cli/wp-cli/commit/a134ce6e46561e9f36ee5efeb33e69ad97b97141#commitcomment-3001898

11 years agoCorrect file permissions to 755
Daniel Bachhuber [Fri, 12 Apr 2013 15:59:13 +0000 (08:59 -0700)]
Correct file permissions to 755

11 years agobe more explicit about which code is covered by the MIT license
Cristi Burcă [Fri, 12 Apr 2013 14:24:02 +0000 (17:24 +0300)]
be more explicit about which code is covered by the MIT license

11 years agoMerge pull request #379 from wp-cli/ignore-db-defaults
Cristi Burcă [Tue, 9 Apr 2013 18:01:27 +0000 (11:01 -0700)]
Merge pull request #379 from wp-cli/ignore-db-defaults

Fixes #377

11 years agotests: add IF NOT EXISTS to create_db()
scribu [Tue, 9 Apr 2013 17:39:44 +0000 (20:39 +0300)]
tests: add IF NOT EXISTS to create_db()

11 years agoRemoved the <filename> argument from `post get`.
John Lamp [Fri, 5 Apr 2013 21:23:23 +0000 (17:23 -0400)]
Removed the <filename> argument from `post get`.

11 years agouse run_mysql_query() in functional tests too
scribu [Fri, 5 Apr 2013 19:05:15 +0000 (22:05 +0300)]
use run_mysql_query() in functional tests too

11 years agoadd --defaults-file=/dev/null to mysql commands
scribu [Fri, 5 Apr 2013 18:21:20 +0000 (21:21 +0300)]
add --defaults-file=/dev/null to mysql commands

11 years agoMerge pull request #365 from linepress/scaffold-label
Cristi Burcă [Fri, 5 Apr 2013 14:06:10 +0000 (07:06 -0700)]
Merge pull request #365 from linepress/scaffold-label

Scaffold cpt / tax with label

11 years agoRemoved feature tag
jmslbam [Fri, 5 Apr 2013 10:27:45 +0000 (12:27 +0200)]
Removed feature tag

11 years agoAdded `post get` command.
John Lamp [Fri, 5 Apr 2013 02:26:36 +0000 (22:26 -0400)]
Added `post get` command.

11 years agoReorder tests
jmslbam [Thu, 4 Apr 2013 21:54:12 +0000 (23:54 +0200)]
Reorder tests

11 years agoAdded label scaffold behat test
jmslbam [Thu, 4 Apr 2013 21:51:02 +0000 (23:51 +0200)]
Added label scaffold behat test

11 years agoMerge pull request #374 from wp-cli/tests-db
Cristi Burcă [Thu, 4 Apr 2013 02:16:27 +0000 (19:16 -0700)]
Merge pull request #374 from wp-cli/tests-db

`wp core init-tests` should create the database