PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 6.0.4
Jetpack – WP Security, Backup, Speed, & Growth v6.0.4
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
138 lines 3.6 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 public function post_meta_checksum( $min_id = null, $max_id = null );
35
36 // comments
37 public function comment_count( $status = null, $min_id = null, $max_id = null );
38
39 public function get_comments( $status = null, $min_id = null, $max_id = null );
40
41 public function get_comment( $id );
42
43 public function upsert_comment( $comment );
44
45 public function trash_comment( $comment_id );
46
47 public function spam_comment( $comment_id );
48
49 public function delete_comment( $comment_id );
50
51 public function trashed_post_comments( $post_id, $statuses );
52
53 public function untrashed_post_comments( $post_id );
54
55 public function comments_checksum( $min_id = null, $max_id = null );
56 public function comment_meta_checksum( $min_id = null, $max_id = null );
57
58 // options
59 public function update_option( $option, $value );
60
61 public function get_option( $option, $default = false );
62
63 public function delete_option( $option );
64
65 // themes
66 public function set_theme_support( $theme_support );
67
68 public function current_theme_supports( $feature );
69
70 // meta
71 public function get_metadata( $type, $object_id, $meta_key = '', $single = false );
72
73 public function upsert_metadata( $type, $object_id, $meta_key, $meta_value, $meta_id );
74
75 public function delete_metadata( $type, $object_id, $meta_ids );
76
77 // constants
78 public function get_constant( $constant );
79
80 public function set_constant( $constant, $value );
81
82 // updates
83 public function get_updates( $type );
84
85 public function set_updates( $type, $updates );
86
87 // functions
88 public function get_callable( $callable );
89
90 public function set_callable( $callable, $value );
91
92 // network options
93 public function get_site_option( $option );
94
95 public function update_site_option( $option, $value );
96
97 public function delete_site_option( $option );
98
99 // terms
100 public function get_terms( $taxonomy );
101
102 public function get_term( $taxonomy, $term_id, $is_term_id = true );
103
104 public function update_term( $term_object );
105
106 public function delete_term( $term_id, $taxonomy );
107
108 public function get_the_terms( $object_id, $taxonomy );
109
110 public function update_object_terms( $object_id, $taxonomy, $terms, $append );
111
112 public function delete_object_terms( $object_id, $tt_ids );
113
114 // users
115 public function user_count();
116
117 public function get_user( $user_id );
118
119 public function upsert_user( $user );
120
121 public function delete_user( $user_id );
122
123 public function upsert_user_locale( $user_id, $locale );
124
125 public function delete_user_locale( $user_id );
126
127 public function get_user_locale( $user_id );
128
129 public function get_allowed_mime_types( $user_id );
130
131
132 // full checksum
133 public function checksum_all();
134
135 // histogram
136 public function checksum_histogram( $object_type, $buckets, $start_id = null, $end_id = null );
137 }
138