示例#1
0
$stage = 5;
if ($stage == $jumpstop) {
    echo "stop by -S\n";
    exit(0);
}
cli_msglog("ps%90");
if ($stage >= $jump) {
    // 產生 pdf
    require_once "lib/print_pdf.inc.php";
    $pdf = new print_pdf(array('title' => $title, 'subject' => basename($outfile_prefix), 'outfile' => $outpdf, 'infiles' => $simage));
    $pdf->print_cmd = 0;
    $pdf->doit();
    cli_msglog("save pdf for print...");
    echo "{$outimage} done";
}
showmem("after stage 5");
$stage = 6;
if ($stage == $jumpstop) {
    echo "stop by -S\n";
    exit(0);
}
cli_msglog("ps%95");
cli_msglog("almost done,cleanup...");
// 如果有給 -s, 就不刪圖檔
if ($stage >= $jump && !isset($opt['s'])) {
    foreach ($simage as $simage_file) {
        unlink($simage_file);
    }
    unlink($outimage_gray);
}
// not register db yet
示例#2
0
if ($inp['gps'] == 1 || $inp['gps'] == 2) {
    @mkdir(dirname($outgpx), 0755, true);
    if (!copy($tmp_gpx, $outgpx)) {
        if ($inp['gps'] == 1) {
            @unlink($_FILES['gpxfile']['tmp_file']);
            @unlink($tmp_gpx);
        }
        error_out("存入上傳檔案失敗");
    }
    @unlink($_FILES['gpxfile']['tmp_file']);
    @unlink($tmp_gpx);
    $svg_params = sprintf("-g %s:%d:%d", $outgpx, isset($inp['trk_label']) ? 1 : 0, $inp['wpt_label']);
}
// 呼叫 cmd_line make, 他也需要 gpx aware
// -l 傳入 email:formid 作為識別 channel 與 msg owner
showmem("before call cmd_make.php");
$cmd = sprintf("php cmd_make2.php -r %d:%d:%d:%d -O %s -v %d -t '%s' -i %s -p %d %s -l %s:%s %s %s %s", $startx, $starty, $shiftx, $shifty, $outpath, $version, addslashes($title), $_SERVER['REMOTE_ADDR'], $ph, $svg_params, $_SESSION['mylogin']['email'], $inp['formid'], isset($inp['grid_100M']) ? '-e' : '', isset($inp['inc_trace']) ? '-G' : '', isset($inp['keep_color']) ? '-c' : '');
// 是否輸出彩圖
msglog($cmd);
exec($cmd, $output, $ret);
if ($ret != 0) {
    foreach ($output as $line) {
        if (strstr($line, "err:")) {
            $errline .= substr($line, 4) . "\n";
        }
    }
    error_out($errline);
}
// before register, check count again
if (map_full($_SESSION['uid'], $user['limit'], $recreate_flag)) {
    $files = map_files($outimage);