From c848c9c3bc39c1ed161d716808b0b5579b0b863d Mon Sep 17 00:00:00 2001 From: scribu Date: Thu, 24 Oct 2013 03:34:03 +0300 Subject: [PATCH] arrayify require: key --- php/WP_CLI/Runner.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/php/WP_CLI/Runner.php b/php/WP_CLI/Runner.php index 498815bd..42a943da 100644 --- a/php/WP_CLI/Runner.php +++ b/php/WP_CLI/Runner.php @@ -399,6 +399,7 @@ class Runner { self::absolutize( $config['path'], $yml_file_dir ); if ( isset( $config['require'] ) ) { + self::arrayify( $config['require'] ); foreach ( $config['require'] as &$path ) { self::absolutize( $path, $yml_file_dir ); } @@ -407,6 +408,12 @@ class Runner { return $config; } + private static function arrayify( &$val ) { + if ( !is_array( $val ) ) { + $val = array( $val ); + } + } + private static function absolutize( &$path, $base ) { if ( !empty( $path ) && !\WP_CLI\Utils\is_path_absolute( $path ) ) { $path = $base . DIRECTORY_SEPARATOR . $path; -- 2.11.0