Пример #1
0
 function mainDiff($quiet = false)
 {
     $app = gp('gp_app');
     $file = gp('gpfile');
     $d1 = AppDir($app);
     $f1 = $d1 . $file;
     $f2 = $d1 . '/ref/' . $file;
     $diff = shell_exec("diff -u {$f2} {$f1}");
     if ($quiet) {
         return $diff;
     }
     // If not in quiet mode, they want to view the diff
     x_EchoFlush("<h1>File Diff</h1>");
     x_EchoFlush("Application {$app}");
     x_EchoFlush("Local file is: {$f1}");
     x_EchoFlush("Reference file is: {$f2}");
     echo "<pre>";
     echo htmlentities($diff);
     echo "</pre>";
 }
Пример #2
0
 function ServDel()
 {
     $dir = AppDir(gp('gp_app'));
     $gpfile = gp('gpfile');
     if (!file_exists($dir . $gpfile)) {
         echo "File {$dir}{$gpfile} does not exist on server, please refresh your reference files";
         return;
     }
     unlink($dir . $gpfile);
 }