/* 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'); $file->removeDir('./xampp/perl'); $file->removeDir('./xampp/sendmail'); $file->removeDir('./xampp/security'); $file->removeDir('./xampp/webdav'); $file->removeDir('./xampp/FileZillaFTP'); $file->removeDir('./xampp/MercuryMail'); $file->removeDir('./xampp/webalizer'); $file->removeDir('./xampp/tomcat'); $file->batchRemoveFile('./xampp/tmp/*');
/* set xampp package and 7-zip command. */ if (count($argv) != 4) { die("php build.php xampp.7z 7zip output.\n"); } $xampp = $argv[1] . '\\xampp.7z'; $phpmyadmin = $argv[1] . '\\phpmyadmin.7z'; $sevenz = $argv[2]; $output = $argv[3]; chdir($output); /* extract the xampp package. */ echo "extracting xampp package ..."; echo `{$sevenz} x -y {$xampp}`; echo `{$sevenz} x -y {$phpmyadmin}`; /* 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'); $file->removeDir('./xampp/perl'); $file->removeDir('./xampp/sendmail'); $file->removeDir('./xampp/security'); $file->batchRemoveFile('./xampp/tmp/*'); $file->removeDir('./xampp/webdav'); $file->batchRemoveFile('./xampp/*.txt'); $file->batchRemoveFile('./xampp/*.bat'); $file->batchRemoveFile('./xampp/*.exe'); $file->batchRemoveFile('./xampp/*.ini');