Example #1
0
<?php

$buildDir = dirname(__FILE__);
chdir($buildDir);
/* If zfile.class.php not found, try to download it from github. */
if (!is_file('zfile.class.php')) {
    $zfile = 'https://raw.github.com/easysoft/zentaopms/master/lib/zfile/zfile.class.php';
    file_put_contents('zfile.class.php', file_get_contents($zfile));
}
/* Include the file class. */
include './zfile.class.php';
$file = new zfile();
/* set xampp package and 7-zip command. */
if (count($argv) != 3) {
    die("php build.php sourceDir product=zentao|chanzhi|common.\n");
}
$sourceDir = $argv[1];
$product = $argv[2];
$xampp = $sourceDir . '\\xampp';
$phpmyadmin = $sourceDir . '\\phpmyadmin';
$output = $sourceDir . '\\release';
chdir($sourceDir);
/* rm useless files. */
error_reporting(E_ALL);
$file->removeDir('./xampp/cgi-bin');
$file->removeDir('./xampp/contrib');
$file->removeDir('./xampp/install');
$file->removeDir('./xampp/licenses');
$file->removeDir('./xampp/locale');
$file->removeDir('./xampp/mailoutput');
$file->removeDir('./xampp/mailtodisk');