1 | <?php |
||
5 | class Jetpack_Sync_Settings { |
||
6 | const SETTINGS_OPTION_PREFIX = 'jetpack_sync_settings_'; |
||
7 | |||
8 | static $valid_settings = array( |
||
|
|||
9 | 'dequeue_max_bytes' => true, |
||
10 | 'upload_max_bytes' => true, |
||
11 | 'upload_max_rows' => true, |
||
12 | 'sync_wait_time' => true, |
||
13 | 'sync_wait_threshold' => true, |
||
14 | 'max_queue_size' => true, |
||
15 | 'max_queue_lag' => true, |
||
16 | 'queue_max_writes_sec' => true, |
||
17 | 'post_types_blacklist' => true, |
||
18 | 'meta_blacklist' => true, |
||
19 | ); |
||
20 | |||
21 | static $is_importing; |
||
22 | |||
23 | static $settings_cache = array(); // some settings can be expensive to compute - let's cache them |
||
24 | |||
25 | static function get_settings() { |
||
33 | |||
34 | // Fetches the setting. It saves it if the setting doesn't exist, so that it gets |
||
35 | // autoloaded on page load rather than re-queried every time. |
||
36 | static function get_setting( $setting ) { |
||
71 | |||
72 | static function update_settings( $new_settings ) { |
||
79 | |||
80 | // returns escapted SQL that can be injected into a WHERE clause |
||
81 | static function get_blacklisted_post_types_sql() { |
||
84 | |||
85 | static function reset_data() { |
||
93 | |||
94 | static function set_importing( $is_importing ) { |
||
98 | |||
99 | static function is_importing() { |
||
106 | } |
||
107 |
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.