Пример #1
0
use Parse\ParseUser;
use Parse\ParseInstallation;
use Parse\ParseException;
use Parse\ParseAnalytics;
use Parse\ParseFile;
use Parse\ParseCloud;
use Parse\ParseClient;
$app_id = 'rLfiUPlbIE5orN0Al07gpotnvIpqwTUpoQlkhjO0';
$rest_key = 'LnIgqdYSz8krs6iKBdH5XtGqglkyjzuSEHTnNbEC';
$master_key = 'jtNDkVGTpaVeregAuvlTYOUCErbKnSMgE7F6x9Fo';
$source_url = 'https://api.parse.com/1';
$dest_url = 'https://liketochiku-server.herokuapp.com/parse';
ParseClient::initialize($app_id, $rest_key, $master_key);
$query = new ParseQuery("Ad");
//$query->AddDescending("updateAt");
$query->AddAscending("objectId");
// All results:
$results_src = $query->find();
ParseClient::setServerURL($dest_url);
// All results:
$results_dst = $query->find();
// Verify
if (count($results_src) != count($results_dst)) {
    echo "Count is not equal, aborting...\n";
    exit(1);
}
for ($i = 0; $i < count($results_src); $i++) {
    $id_src = $results_src[$i]->getObjectId();
    $id_dst = $results_dst[$i]->getObjectId();
    if ($id_src != $id_dst) {
        echo "ID is not equal, aborting...\n";