Automattic\WooCommerce\Blocks

AssetsController::get_file_version()protectedWC 1.0

Get the file modified time as a cache buster if we're in dev mode.

Method of the class: AssetsController{}

No Hooks.

Return

String. The cache buster value to use for the given file.

Usage

// protected - for code of main (parent) or child class
$result = $this->get_file_version( $file );
$file(string) (required)
Local path to the file.

AssetsController::get_file_version() code WC 9.0.1

protected function get_file_version( $file ) {
	if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG && file_exists( \Automattic\WooCommerce\Blocks\Package::get_path() . $file ) ) {
		return filemtime( \Automattic\WooCommerce\Blocks\Package::get_path() . $file );
	}
	return $this->api->wc_version;
}