1 | <?php |
||
28 | class Jetpack_Sitemap_State { |
||
29 | |||
30 | /** |
||
31 | * Initial state for the sitemap generator. |
||
32 | * |
||
33 | * @access public |
||
34 | * @since 4.7.0 |
||
35 | * |
||
36 | * @param string $type The initial sitemap type. |
||
37 | * |
||
38 | * @return array $args { |
||
39 | * @type string sitemap-type The type of sitemap to be generated. |
||
40 | * @type int last-added The largest index to be added to a generated sitemap page. |
||
41 | * @type int number The index of the last sitemap to be generated. |
||
42 | * @type string last-modified The latest timestamp seen. |
||
43 | * @type array max The latest index of each sitemap type seen. |
||
44 | * } |
||
45 | */ |
||
46 | private static function initial( $type = '' ) { |
||
55 | |||
56 | /** |
||
57 | * Reset the sitemap state. |
||
58 | * |
||
59 | * @param string $type The initial sitemap type. |
||
60 | * |
||
61 | * @access public |
||
62 | * @since 4.7.0 |
||
63 | */ |
||
64 | public static function reset( $type ) { |
||
71 | |||
72 | /** |
||
73 | * Store a sitemap state, and unlock it. |
||
74 | * |
||
75 | * @access public |
||
76 | * @since 4.7.0 |
||
77 | * |
||
78 | * @param array $state { |
||
79 | * @type string sitemap-type The type of sitemap to be generated. |
||
80 | * @type int last-added The largest index to be added to a generated sitemap page. |
||
81 | * @type int number The index of the last sitemap to be generated. |
||
82 | * @type string last-modified The latest timestamp seen. |
||
83 | * } |
||
84 | */ |
||
85 | public static function check_in( $state ) { |
||
95 | |||
96 | /** |
||
97 | * Unlock the sitemap state. |
||
98 | * |
||
99 | * @access public |
||
100 | * @since 4.7.0 |
||
101 | */ |
||
102 | public static function unlock() { |
||
105 | |||
106 | /** |
||
107 | * Read the stored sitemap state. Returns false if the state is locked. |
||
108 | * |
||
109 | * @access public |
||
110 | * @since 4.7.0 |
||
111 | * |
||
112 | * @return bool|array $args { |
||
113 | * @type string sitemap-type The type of sitemap to be generated. |
||
114 | * @type int last-added The largest index to be added to a generated sitemap page. |
||
115 | * @type int number The index of the last sitemap to be generated. |
||
116 | * @type string last-modified The latest timestamp seen. |
||
117 | * @type array max The latest index of each sitemap type seen. |
||
118 | * } |
||
119 | */ |
||
120 | public static function check_out() { |
||
131 | |||
132 | /** |
||
133 | * Delete the stored state and lock. |
||
134 | * |
||
135 | * @access public |
||
136 | * @since 4.7.0 |
||
137 | */ |
||
138 | public static function delete() { |
||
142 | |||
143 | } |
||
144 |