Exemplo n.º 1
0
<?php

/**
	Links page builder 6/10/2015
**/
include 'config.php';
require_once 'log_data_service.php';
require_once 'pov_data_service.php';
require_once 'replication_data_service.php';
set_time_limit(0);
$error = '';
$logService = new LogDataService();
$ds = new PovDataService($conf['rep_source_dsn'], $conf['rep_source_dbname'], $conf['rep_source_dbpassword'], array(PDO::ATTR_PERSISTENT => false));
$rds = new ReplicationDataService($conf['rep_target_dsn'], $conf['rep_target_dbname'], $conf['rep_target_dbpassword'], array(PDO::ATTR_PERSISTENT => false));
for ($i = 0; $i < 1000; $i++) {
    $x = $ds->getNextXfer();
    if (!$x) {
        sleep(60);
        exit;
    }
    $table = $x['table'];
    $xid = $x['xid'];
    $action = $x['action'];
    $id = $x['id'];
    if ($action < 3) {
        $row = $ds->getXferRow($table, $xid);
        if (!$row) {
            $ds->deleteXfer($id);
            continue;
        }
    }