require_once('../include/orm.php'); require_once('../include/globals.php'); require_once('../include/util.php'); require_once("../include/mysqldump/src/Ifsnop/Mysqldump/Mysqldump.php"); $_install_replicate_db_connected = $Link == ''; if($_install_replicate_db_connected) $Link = connectDb(); define('DBCONNECTED', 1); debugstartpage(); if( isset($_x) ) { //if( $_x != '' ) { $_x = $_x == '' ? array() : StringTokenize($_x, ","); $_result = array(); $_result['version'] = array('actual' => 22); $_result['visibility'] = array(); $_initialvars = arrayExclude(get_defined_vars(), array("_*", "form_*", "s_*", "GLOBALS", "Link", "thisname")); } // isbasewindow: // On Open while( ($__action == "" or $__action == "executedonopen") and (empty($_x) or in('onopen', $_x)) ) { $__action = "executedonopen"; if( !isset($riuulkjkljfe) ) die(""); $cfgfile = "servers/$server.cfg"; if( file_exists($cfgfile) ) { $slaves = readProperty($cfgfile, "replicate_slaves"); $tables = readProperty($cfgfile, "replicate_tables"); $aslaves = StringTokenize($slaves, ','); $atables = StringTokenize($tables, ','); } if( isset($all) ) { error_reporting(E_ALL); ini_set('display_errors', 1); //$dumper = new Ifsnop\Mysqldump\Mysqldump("mysql:host=localhost;dbname=" + MYSQL_DB, MYSQL_USER, MYSQL_PASS); $dumpsettings = array( "include-tables" => array("cmvehiculo"), "complete-insert" => true, "no-create-info" => true, "skip-comments" => true, "skip-dump-date" => true, "skip-triggers" => true, "skip-definer" => true ); //print_r($dumpsettings); $dumper = new Ifsnop\Mysqldump\Mysqldump("mysql:host=localhost;dbname=fconsorcios", MYSQL_USER, MYSQL_PASS, $dumpsettings); $dumper->setTableWheres(array( "cmvehiculo" => "unidad in (select id from Unidades where emprendimientoid = 'Dorrego') and patente is not null and patente != ''" )); $filename = "replicate-" . rand(1, 10000) . ".sql"; $dumper->start($filename); //print(file_get_contents($filename)); $handle = fopen($filename, "r"); if ($handle) { while (($line = fgets($handle)) !== false) { // process the line read. if( startsWith($line, "INSERT ") ) print($line . chr(13) . chr(10)); } fclose($handle); } unlink($filename); exit(0); } print("