function do_root_main($data) { dprintr("Remote: "); dprintr($data); return do_remote($data); }
function remote_main() { global $gbl, $sgbl, $login, $ghtml, $g_dbf; global $argv; ob_start(); $args = parse_opt($argv); $gbl->is_master = false; $gbl->is_slave = false; if (isset($args['install-type']) && $args['install-type'] === 'master') { $login = new Client(null, null, 'master'); $gbl->is_master = true; $login->get(); } else { $login = new Client(null, null, 'slave'); //$login->initThisDef(); $gbl->is_slave = true; $rmt = unserialize(lfile_get_contents("__path_slave_db")); $login->password = $rmt->password; } $login->cttype = 'admin'; // This is to prevent the socket already used error. If use a strict single interface, the socket operations happen through our own functions, and we can set the reuse option. $rmt = unserialize(base64_decode($ghtml->frm_rmt)); $res = do_remote($rmt); print_time('full', 'timing'); $res->message = ob_get_contents(); $val = base64_encode(serialize($res)); while (@ob_end_clean()) { } print $val; exit; }