PluginProbe
Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF / 2.3.1
Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF v2.3.1
2.3.4 2.3.3 2.3.2 2.3.1 2.3.0 2.2.9 2.2.8 trunk 1.10 1.3.3 1.3.4 1.3.5 1.3.5.1 1.3.5.2 1.3.6 1.3.6.1 1.4 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.5 All 103 releases
imagify / classes / CDN / PushCDNInterface.php

PushCDNInterface.php in Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF 2.3.1, at classes/CDN/PushCDNInterface.php

95 lines 2.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Imagify\CDN;
3
4 /**
5 * Interface to use for Push CDNs.
6 *
7 * @since 1.9
8 * @author Grégory Viguier
9 */
10 interface PushCDNInterface {
11
12 /**
13 * Tell if the CDN is ready (not necessarily reachable).
14 *
15 * @since 1.9
16 * @access public
17 * @author Grégory Viguier
18 *
19 * @return bool
20 */
21 public function is_ready();
22
23 /**
24 * Tell if the media is on the CDN.
25 *
26 * @since 1.9
27 * @access public
28 * @author Grégory Viguier
29 *
30 * @return bool
31 */
32 public function media_is_on_cdn();
33
34 /**
35 * Get files from the CDN.
36 *
37 * @since 1.9
38 * @access public
39 * @author Grégory Viguier
40 *
41 * @param array $file_paths A list of file paths.
42 * @return bool|\WP_Error True on success. A \WP_error object on failure.
43 */
44 public function get_files_from_cdn( $file_paths );
45
46 /**
47 * Remove files from the CDN.
48 * Don't use this to empty a folder.
49 *
50 * @since 1.9
51 * @access public
52 * @author Grégory Viguier
53 *
54 * @param array $file_paths A list of file paths. Those paths are not necessary absolute, and can be also file names.
55 * @return bool|\WP_Error True on success. A \WP_error object on failure.
56 */
57 public function remove_files_from_cdn( $file_paths );
58
59 /**
60 * Send all files from a media to the CDN.
61 *
62 * @since 1.9
63 * @access public
64 * @author Grégory Viguier
65 *
66 * @param bool $is_new_upload Tell if the current media is a new upload. If not, it means it's a media being regenerated, restored, etc.
67 * @return bool|\WP_Error True/False if sent or not. A \WP_error object on failure.
68 */
69 public function send_to_cdn( $is_new_upload );
70
71 /**
72 * Get a file URL.
73 *
74 * @since 1.9
75 * @access public
76 * @author Grégory Viguier
77 *
78 * @param string $file_name Name of the file. Leave empty for the full size file.
79 * @return string URL to the file.
80 */
81 public function get_file_url( $file_name = '' );
82
83 /**
84 * Get a file path.
85 *
86 * @since 1.9
87 * @access public
88 * @author Grégory Viguier
89 *
90 * @param string $file_name Name of the file. Leave empty for the full size file. Use 'original' to get the path to the original file.
91 * @return string Path to the file.
92 */
93 public function get_file_path( $file_name = '' );
94 }
95