Automattic\WooCommerce\Blueprint\ResourceStorages

ResourceStorage{}interfaceWC 1.0

Interface ResourceStorage

ResourceStorage is an abstraction layer for various storages for WordPress files such as plugins and themes. It provides a common interface for downloading the files whether they are stored locally or remotely.

No Hooks.

Usage

$ResourceStorage = new ResourceStorage();
// use class methods

Methods

  1. public download( $slug )
  2. public get_supported_resource()

Notes

  • Package: Automattic\WooCommerce\Blueprint\ResourceStorages

ResourceStorage{} code WC 9.9.5

interface ResourceStorage {
	/**
	 * Return supported resource type.
	 *
	 * @return string
	 */
	public function get_supported_resource(): string;

	/**
	 * Download the resource.
	 *
	 * @param string $slug resource slug.
	 *
	 * @return string|null downloaded local path.
	 */
	public function download( $slug ): ?string;
}