OSDN Git Service

define WP_DEBUG in Utils\wp_debug_mode()
authorscribu <mail@scribu.net>
Thu, 9 May 2013 20:23:58 +0000 (23:23 +0300)
committerscribu <mail@scribu.net>
Thu, 9 May 2013 21:08:54 +0000 (00:08 +0300)
php/WP_CLI/Runner.php
php/utils-wp.php
php/wp-cli.php

index 4af9554..fba607a 100644 (file)
@@ -335,13 +335,6 @@ class Runner {
                }
        }
 
-       public function after_wp_config_load() {
-               if ( $this->config['debug'] ) {
-                       if ( !defined( 'WP_DEBUG' ) )
-                               define( 'WP_DEBUG', true );
-               }
-       }
-
        public function after_wp_load() {
                add_filter( 'filesystem_method', function() { return 'direct'; }, 99 );
 
index 1821f7f..a50be47 100644 (file)
@@ -14,6 +14,9 @@ function wp_not_installed() {
 
 function wp_debug_mode() {
        if ( \WP_CLI::get_config( 'debug' ) ) {
+               if ( !defined( 'WP_DEBUG' ) )
+                       define( 'WP_DEBUG', true );
+
                error_reporting( E_ALL & ~E_DEPRECATED & ~E_STRICT );
                ini_set( 'display_errors', true );
        } else {
index f002341..74db413 100644 (file)
@@ -20,8 +20,6 @@ WP_CLI::$runner->before_wp_load();
 // Load wp-config.php code, in the global scope
 eval( WP_CLI::$runner->get_wp_config_code() );
 
-WP_CLI::$runner->after_wp_config_load();
-
 // Simulate a /wp-admin/ page load
 $_SERVER['PHP_SELF'] = '/wp-admin/index.php';
 define( 'WP_ADMIN', true );