<?php
+use \WP_CLI\Utils;
+
/**
* Download, install, update and otherwise manage WordPress proper.
*
$silent = WP_CLI::get_config('quiet') ? '--silent ' : '';
$cmd = "curl -f $silent %s | tar xz --strip-components=1 --directory=%s";
- WP_CLI::launch( \WP_CLI\Utils\create_cmd( $cmd, $download_url, ABSPATH ) );
+ WP_CLI::launch( Utils\create_cmd( $cmd, $download_url, ABSPATH ) );
WP_CLI::success( 'WordPress downloaded.' );
}
}
private static function modify_wp_config( $content ) {
- $wp_config_path = WP_CLI\Utils\locate_wp_config();
+ $wp_config_path = Utils\locate_wp_config();
$token = "/* That's all, stop editing!";
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
- $result = WP_CLI\Utils\get_upgrader( $upgrader )->upgrade( $update );
+ $result = Utils\get_upgrader( $upgrader )->upgrade( $update );
if ( is_wp_error($result) ) {
$msg = WP_CLI::error_to_string( $result );
// Create the database
$query = sprintf( 'CREATE DATABASE IF NOT EXISTS `%s`', $assoc_args['dbname'] );
- \WP_CLI\Utils\run_mysql_query( $query, array(
+ Utils\run_mysql_query( $query, array(
'host' => 'localhost',
'user' => $assoc_args['dbuser'],
'pass' => $assoc_args['dbpass'],