php/WP_CLI/Configurator.php
private static function load_yml( $yml_file ) {
		if ( ! $yml_file ) {
			return array();
		}

		$config = Spyc::YAMLLoad( $yml_file );

		// Make sure config-file-relative paths are made absolute.
		$yml_file_dir = dirname( $yml_file );

		if ( isset( $config['path'] ) ) {
			self::absolutize( $config['path'], $yml_file_dir );
		}

		if ( isset( $config['require'] ) ) {
			self::arrayify( $config['require'] );
			$config['require'] = \WP_CLI\Utils\expand_globs( $config['require'] );
			foreach ( $config['require'] as &$path ) {
				self::absolutize( $path, $yml_file_dir );
			}
		}

		// Backwards compat
		// Command 'core config' was moved to 'config create'.
		if ( isset( $config['core config'] ) ) {
			$config['config create'] = $config['core config'];
			unset( $config['core config'] );
		}
		// Command 'checksum core' was moved to 'core verify-checksums'.
		if ( isset( $config['checksum core'] ) ) {
			$config['core verify-checksums'] = $config['checksum core'];
			unset( $config['checksum core'] );
		}
		// Command 'checksum plugin' was moved to 'plugin verify-checksums'.
		if ( isset( $config['checksum plugin'] ) ) {
			$config['plugin verify-checksums'] = $config['checksum plugin'];
			unset( $config['checksum plugin'] );
		}

		return $config;
	}
private static function load_yml( $yml_file ) {
		if ( ! $yml_file ) {
			return array();
		}

		$config = Spyc::YAMLLoad( $yml_file );

		// Make sure config-file-relative paths are made absolute.
		$yml_file_dir = dirname( $yml_file );

		if ( isset( $config['path'] ) ) {
			self::absolutize( $config['path'], $yml_file_dir );
		}

		if ( isset( $config['require'] ) ) {
			self::arrayify( $config['require'] );
			$config['require'] = \WP_CLI\Utils\expand_globs( $config['require'] );
			foreach ( $config['require'] as &$path ) {
				self::absolutize( $path, $yml_file_dir );
			}
		}

		// Backwards compat
		// Command 'core config' was moved to 'config create'.
		if ( isset( $config['core config'] ) ) {
			$config['config create'] = $config['core config'];
			unset( $config['core config'] );
		}
		// Command 'checksum core' was moved to 'core verify-checksums'.
		if ( isset( $config['checksum core'] ) ) {
			$config['core verify-checksums'] = $config['checksum core'];
			unset( $config['checksum core'] );
		}
		// Command 'checksum plugin' was moved to 'plugin verify-checksums'.
		if ( isset( $config['checksum plugin'] ) ) {
			$config['plugin verify-checksums'] = $config['checksum plugin'];
			unset( $config['checksum plugin'] );
		}

		return $config;
	}
private static function load_yml ( $ yml_file ) { if ( ! $ yml_file ) { return array ( ) ; } $ config = Spyc :: YAMLLoad ( $ yml_file ) ; // Make sure config-file-relative paths are made absolute. $ yml_file_dir = dirname ( $ yml_file ) ; if ( isset ( $ config [ 'path' ] ) ) { self :: absolutize ( $ config [ 'path' ] , $ yml_file_dir ) ; } if ( isset ( $ config [ 'require' ] ) ) { self :: arrayify ( $ config [ 'require' ] ) ; $ config [ 'require' ] = \ WP_CLI \ Utils \ expand_globs ( $ config [ 'require' ] ) ; foreach ( $ config [ 'require' ] as & $ path ) { self :: absolutize ( $ path , $ yml_file_dir ) ; } } // Backwards compat // Command 'core config' was moved to 'config create'. if ( isset ( $ config [ 'core config' ] ) ) { $ config [ 'config create' ] = $ config [ 'core config' ] ; unset ( $ config [ 'core config' ] ) ; } // Command 'checksum core' was moved to 'core verify-checksums'. if ( isset ( $ config [ 'checksum core' ] ) ) { $ config [ 'core verify-checksums' ] = $ config [ 'checksum core' ] ; unset ( $ config [ 'checksum core' ] ) ; } // Command 'checksum plugin' was moved to 'plugin verify-checksums'. if ( isset ( $ config [ 'checksum plugin' ] ) ) { $ config [ 'plugin verify-checksums' ] = $ config [ 'checksum plugin' ] ; unset ( $ config [ 'checksum plugin' ] ) ; } return $ config ; }
Load values from a YAML file.

@param string $yml_file Path to the YAML file
@return array $config Declared configuration values
Load values from a YAML file .