WP_CLI

Extractor::extract()public staticWP-CLI 1.0

Extract the archive file to a specific destination.

Метод класса: Extractor{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

$result = Extractor::extract( $tarball_or_zip, $dest );
$tarball_or_zip (обязательный)
-
$dest(строка) (обязательный)
-

Код Extractor::extract() WP-CLI 2.8.0-alpha

public static function extract( $tarball_or_zip, $dest ) {
	if ( preg_match( '/\.zip$/', $tarball_or_zip ) ) {
		return self::extract_zip( $tarball_or_zip, $dest );
	}

	if ( preg_match( '/\.tar\.gz$/', $tarball_or_zip ) ) {
		return self::extract_tarball( $tarball_or_zip, $dest );
	}

	throw new Exception( "Extraction only supported for '.zip' and '.tar.gz' file types." );
}