예제 #1
0
파일: wp-cli.php 프로젝트: bytewang/wp-cli
} else {
    define('WP_ROOT', $_SERVER['PWD'] . '/');
}
if (!is_readable(WP_ROOT . 'wp-load.php')) {
    if (array('core', 'download') == $arguments) {
        WP_CLI::run_command($arguments, $assoc_args);
    } else {
        WP_CLI::error('This does not seem to be a WordPress install. Pass --path=`path/to/wordpress` or run `wp core download`.');
        exit;
    }
}
if (array('core', 'config') == $arguments) {
    WP_CLI::run_command($arguments, $assoc_args);
}
// Handle --url and --blog parameters
WP_CLI::_set_url($assoc_args);
// Set installer flag before loading any WP files
if (count($arguments) >= 2 && $arguments[0] == 'core' && $arguments[1] == 'install') {
    define('WP_INSTALLING', true);
}
// Load WordPress
require WP_ROOT . 'wp-load.php';
require ABSPATH . 'wp-admin/includes/admin.php';
// Load the right info into the global wp_query
if (isset($assoc_args['url'])) {
    if (isset($GLOBALS['wp_query']) && isset($GLOBALS['wp'])) {
        $GLOBALS['wp']->parse_request();
        $GLOBALS['wp_query']->query($GLOBALS['wp']->query_vars);
    }
}
// Set the user