コード例 #1
0
 protected function result()
 {
     $args = $this->query_args();
     if (isset($args['columns'])) {
         $columns = array_map('trim', explode(',', $args['columns']));
     } else {
         $columns = null;
         // go with defaults
     }
     require_once JETPACK__PLUGIN_DIR . 'sync/class.jetpack-sync-wp-replicastore.php';
     $store = new Jetpack_Sync_WP_Replicastore();
     return $store->checksum_histogram($args['object_type'], $args['buckets'], $args['start_id'], $args['end_id'], $columns, $args['strip_non_ascii']);
 }
コード例 #2
0
 protected function result()
 {
     require_once JETPACK__PLUGIN_DIR . 'sync/class.jetpack-sync-sender.php';
     $sender = Jetpack_Sync_Sender::get_instance();
     $sync_queue = $sender->get_sync_queue();
     // lock sending from the queue while we compare checksums with the server
     $result = $sync_queue->lock(30);
     // tries to acquire the lock for up to 30 seconds
     if (!$result) {
         $sync_queue->unlock();
         return new WP_Error('unknown_error', 'Unknown error trying to lock the sync queue');
     }
     if (is_wp_error($result)) {
         $sync_queue->unlock();
         return $result;
     }
     $args = $this->query_args();
     if (isset($args['columns'])) {
         $columns = array_map('trim', explode(',', $args['columns']));
     } else {
         $columns = null;
         // go with defaults
     }
     require_once JETPACK__PLUGIN_DIR . 'sync/class.jetpack-sync-wp-replicastore.php';
     $store = new Jetpack_Sync_WP_Replicastore();
     $result = $store->checksum_histogram($args['object_type'], $args['buckets'], $args['start_id'], $args['end_id'], $columns, $args['strip_non_ascii']);
     $sync_queue->unlock();
     return $result;
 }