if ( 'multisite-install' == $this->arguments[1] ) {
// need to fake some globals to skip the checks in wp-includes/ms-settings.php
- $url_parts = \WP_CLI::parse_url( $url );
+ $url_parts = Utils\parse_url( $url );
self::fake_current_site_blog( $url_parts );
if ( !defined( 'COOKIEHASH' ) ) {
* Set the context in which WP-CLI should be run
*/
static function set_url( $url ) {
- $url_parts = self::parse_url( $url );
+ $url_parts = Utils\parse_url( $url );
self::set_url_params( $url_parts );
}
- static function parse_url( $url ) {
- $url_parts = parse_url( $url );
-
- if ( !isset( $url_parts['scheme'] ) ) {
- $url_parts = parse_url( 'http://' . $url );
- }
-
- return $url_parts;
- }
-
private static function set_url_params( $url_parts ) {
$f = function( $key ) use ( $url_parts ) {
return isset( $url_parts[ $key ] ) ? $url_parts[ $key ] : '';
return new \cli\progress\Bar( $message, $count );
}
+function parse_url( $url ) {
+ $url_parts = \parse_url( $url );
+
+ if ( !isset( $url_parts['scheme'] ) ) {
+ $url_parts = parse_url( 'http://' . $url );
+ }
+
+ return $url_parts;
+}
+