1 | <?php |
||
10 | class Jetpack_Sync { |
||
11 | static $client = null; |
||
|
|||
12 | |||
13 | static function init() { |
||
29 | |||
30 | static function send_data( $data ) { |
||
42 | |||
43 | static function schedule_full_sync() { |
||
46 | |||
47 | // static function get_data_to_sync() { |
||
48 | // $send['current_user_id'] = get_current_user_id(); |
||
49 | // $send['options'] = Jetpack_Sync_Options::get_to_sync(); |
||
50 | // $send['options_delete'] = Jetpack_Sync_Options::get_to_delete(); |
||
51 | // $send['constants'] = self::sync_if_has_changed( Jetpack_Sync_Constants::$check_sum_id, Jetpack_Sync_Constants::get_all() ); |
||
52 | |||
53 | // $send['actions'] = self::get_actions_to_sync(); |
||
54 | |||
55 | // $send['post_meta'] = Jetpack_Sync_Meta::meta_to_sync( 'post' ); |
||
56 | // $send['post_meta_delete'] = Jetpack_Sync_Meta::meta_to_delete( 'post' ); |
||
57 | |||
58 | // $send['comments'] = Jetpack_Sync_Comments::comments_to_sync(); |
||
59 | // $send['delete_comments'] = Jetpack_Sync_Comments::comments_to_delete(); |
||
60 | // $send['comment_meta'] = Jetpack_Sync_Meta::meta_to_sync( 'comment' ); |
||
61 | // $send['comment_meta_delete'] = Jetpack_Sync_Meta::meta_to_delete( 'comment' ); |
||
62 | |||
63 | // $send['updates'] = Jetpack_Sync_Updates::get_to_sync(); |
||
64 | // $send['themes'] = Jetpack_Sync_Themes::get_to_sync(); |
||
65 | |||
66 | // if ( false === ( $do_check = get_transient( 'jetpack_sync_functions' ) ) ) { |
||
67 | // $send['functions'] = self::sync_if_has_changed( Jetpack_Sync_Functions::$check_sum_id, Jetpack_Sync_Functions::get_all() ); |
||
68 | // set_transient( 'jetpack_sync_functions', true, MINUTE_IN_SECONDS ); |
||
69 | // } |
||
70 | // if ( is_multisite() ) { |
||
71 | // $send['network_options'] = Jetpack_Sync_Network_Options::get_to_sync(); |
||
72 | // $send['network_options_delete'] = Jetpack_Sync_Network_Options::get_to_delete(); |
||
73 | // } |
||
74 | |||
75 | // return array_filter( $send ); |
||
76 | // } |
||
77 | |||
78 | |||
79 | // TODO: use these for full sync |
||
80 | |||
81 | // static function get_all_data() { |
||
82 | // $send['options'] = Jetpack_Sync_Options::get_all(); |
||
83 | // $send['constants'] = Jetpack_Sync_Constants::get_all(); |
||
84 | // $send['functions'] = Jetpack_Sync_Functions::get_all(); |
||
85 | // $send['updates'] = Jetpack_Sync_Updates::get_all(); |
||
86 | // $send['themes'] = Jetpack_Sync_Themes::get_all(); |
||
87 | // if ( is_multisite() ) { |
||
88 | // $send['network_options'] = Jetpack_Sync_Network_Options::get_all(); |
||
89 | // } |
||
90 | |||
91 | // return $send; |
||
92 | // } |
||
93 | } |
||
94 | |||
96 |
The PSR-2 coding standard requires that all properties in a class have their visibility explicitly declared. If you declare a property using
the property is implicitly global.
To learn more about the PSR-2, please see the PHP-FIG site on the PSR-2.