PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 4.2.5
Jetpack – WP Security, Backup, Speed, & Growth v4.2.5
16.2-beta 12.0.3 12.1.3 12.2.3 12.3.2 12.4.2 12.5.2 12.6.4 12.7.3 12.8.3 12.9.5 13.0.2 13.1.5 13.2.4 13.3.3 13.4.5 13.5.2 13.6.2 13.7.2 13.8.3 13.9.2 14.0.1 14.1.1 14.2.2 14.3.1 All 501 releases
jetpack / sync / interface.jetpack-sync-replicastore.php
interface.jetpack-sync-replicastore.php
130 lines 3.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Sync architecture prototype
4 * @author Dan Walmsley
5 * To run tests: phpunit --testsuite sync --filter New_Sync
6 */
7
8 /**
9 * A high-level interface for objects that store synced WordPress data
10 * Useful for ensuring that different storage mechanisms implement the
11 * required semantics for storing all the data that we sync
12 */
13 interface iJetpack_Sync_Replicastore {
14 // remove all data
15 public function reset();
16
17 // trigger setup for sync start/end
18 public function full_sync_start( $config );
19
20 public function full_sync_end( $checksum );
21
22 // posts
23 public function post_count( $status = null, $min_id = null, $max_id = null );
24
25 public function get_posts( $status = null, $min_id = null, $max_id = null );
26
27 public function get_post( $id );
28
29 public function upsert_post( $post, $silent = false );
30
31 public function delete_post( $post_id );
32
33 public function posts_checksum( $min_id = null, $max_id = null );
34
35 // comments
36 public function comment_count( $status = null, $min_id = null, $max_id = null );
37
38 public function get_comments( $status = null, $min_id = null, $max_id = null );
39
40 public function get_comment( $id );
41
42 public function upsert_comment( $comment );
43
44 public function trash_comment( $comment_id );
45
46 public function spam_comment( $comment_id );
47
48 public function delete_comment( $comment_id );
49
50 public function trashed_post_comments( $post_id, $statuses );
51
52 public function untrashed_post_comments( $post_id );
53
54 public function comments_checksum( $min_id = null, $max_id = null );
55
56 // options
57 public function update_option( $option, $value );
58
59 public function get_option( $option, $default = false );
60
61 public function delete_option( $option );
62
63 // themes
64 public function set_theme_support( $theme_support );
65
66 public function current_theme_supports( $feature );
67
68 // meta
69 public function get_metadata( $type, $object_id, $meta_key = '', $single = false );
70
71 public function upsert_metadata( $type, $object_id, $meta_key, $meta_value, $meta_id );
72
73 public function delete_metadata( $type, $object_id, $meta_ids );
74
75 // constants
76 public function get_constant( $constant );
77
78 public function set_constant( $constant, $value );
79
80 // updates
81 public function get_updates( $type );
82
83 public function set_updates( $type, $updates );
84
85 // functions
86 public function get_callable( $callable );
87
88 public function set_callable( $callable, $value );
89
90 // network options
91 public function get_site_option( $option );
92
93 public function update_site_option( $option, $value );
94
95 public function delete_site_option( $option );
96
97 // terms
98 public function get_terms( $taxonomy );
99
100 public function get_term( $taxonomy, $term_id, $is_term_id = true );
101
102 public function update_term( $term_object );
103
104 public function delete_term( $term_id, $taxonomy );
105
106 public function get_the_terms( $object_id, $taxonomy );
107
108 public function update_object_terms( $object_id, $taxonomy, $terms, $append );
109
110 public function delete_object_terms( $object_id, $tt_ids );
111
112 // users
113 public function user_count();
114
115 public function get_user( $user_id );
116
117 public function upsert_user( $user );
118
119 public function delete_user( $user_id );
120
121 public function get_allowed_mime_types( $user_id );
122
123
124 // full checksum
125 public function checksum_all();
126
127 // histogram
128 public function checksum_histogram( $object_type, $buckets, $start_id = null, $end_id = null );
129 }
130