Automattic\WooCommerce\Internal\TransientFiles

TransientFilesEngine::get_transient_file_path()publicWC 1.0

Get the full physical path of a transient file given its name.

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

Хуков нет.

Возвращает

Строку|null. The full physical path of the file, or null if the files doesn't exist.

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

$TransientFilesEngine = new TransientFilesEngine();
$TransientFilesEngine->get_transient_file_path( $filename ): ?string;
$filename(строка) (обязательный)
The name of the transient file to locate.

Код TransientFilesEngine::get_transient_file_path() WC 9.6.1

public function get_transient_file_path( string $filename ): ?string {
	$expiration_date = self::get_expiration_date( $filename );
	if ( is_null( $expiration_date ) ) {
		return null;
	}

	$file_path = $this->get_transient_files_directory() . '/' . $expiration_date . '/' . substr( $filename, 6 );

	return is_file( $file_path ) ? $file_path : null;
}