OSDN Git Service
(root)
/
wvm
/
wvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3977c84
)
Output WP-CLI error if config file couldn't be created
author
Taylor Lovett
<admin@taylorlovett.com>
Tue, 22 Oct 2013 02:27:19 +0000
(
02:27
+0000)
committer
Taylor Lovett
<admin@taylorlovett.com>
Tue, 22 Oct 2013 02:27:19 +0000
(
02:27
+0000)
php/commands/core.php
patch
|
blob
|
history
diff --git
a/php/commands/core.php
b/php/commands/core.php
index
9965db4
..
22c5136
100644
(file)
--- a/
php/commands/core.php
+++ b/
php/commands/core.php
@@
-196,9
+196,13
@@
class Core_Command extends WP_CLI_Command {
}
$out = Utils\mustache_render( 'wp-config.mustache', $assoc_args );
- file_put_contents( ABSPATH . 'wp-config.php', $out );
- WP_CLI::success( 'Generated wp-config.php file.' );
+ $bytes_written = file_put_contents( ABSPATH . 'wp-config.php', $out );
+ if ( ! $bytes_written ) {
+ WP_CLI::error( 'Could not create new config file.' );
+ } else {
+ WP_CLI::success( 'Generated wp-config.php file.' );
+ }
}
/**