@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | * Wrapper for unix-utilities zip, gzip and bz2 |
| 14 | 14 | ***************************************************************************/ |
| 15 | 15 | |
| 16 | -require_once __DIR__ . '/../../htdocs/lib/settings.inc.php'; |
|
| 16 | +require_once __DIR__.'/../../htdocs/lib/settings.inc.php'; |
|
| 17 | 17 | |
| 18 | 18 | $basedir = $zip_basedir; |
| 19 | 19 | |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | $zipper['bzip2'] = 'nice --adjustment=19 bzip2 -1 -c {src} > {dst}'; |
| 23 | 23 | |
| 24 | 24 | if ($argc < 4 || $argv[1] == '--help') { |
| 25 | - echo $argv[0] . " --type=<ziptype> --src=<source> --dst=<destination> |
|
| 25 | + echo $argv[0]." --type=<ziptype> --src=<source> --dst=<destination> |
|
| 26 | 26 | --type can be zip, gzip or bzip2 |
| 27 | 27 | --src relative* path to source file |
| 28 | 28 | --dst relative* path to destination file |
@@ -36,11 +36,11 @@ discard block |
||
| 36 | 36 | (substr($argv[2], 0, 6) != '--src=') || |
| 37 | 37 | (substr($argv[3], 0, 6) != '--dst=') |
| 38 | 38 | ) { |
| 39 | - die("wrong paramter\nuse " . $argv[0] . " --help\n"); |
|
| 39 | + die("wrong paramter\nuse ".$argv[0]." --help\n"); |
|
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | if (isset($argv[4])) { |
| 43 | - die("wrong paramter\nuse " . $argv[0] . " --help\n"); |
|
| 43 | + die("wrong paramter\nuse ".$argv[0]." --help\n"); |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | $type = substr($argv[1], 7); |
@@ -48,26 +48,26 @@ discard block |
||
| 48 | 48 | $dst = substr($argv[3], 6); |
| 49 | 49 | |
| 50 | 50 | if (!isset($zipper[$type])) { |
| 51 | - die("invaild zip type\nuse " . $argv[0] . " --help\n"); |
|
| 51 | + die("invaild zip type\nuse ".$argv[0]." --help\n"); |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | if (checkpath($src) == false) { |
| 55 | - die("invaild src\nuse " . $argv[0] . " --help\n"); |
|
| 55 | + die("invaild src\nuse ".$argv[0]." --help\n"); |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | if (checkpath($dst) == false) { |
| 59 | - die("invaild dst\nuse " . $argv[0] . " --help\n"); |
|
| 59 | + die("invaild dst\nuse ".$argv[0]." --help\n"); |
|
| 60 | 60 | } |
| 61 | 61 | |
| 62 | -$src = $basedir . $src; |
|
| 63 | -$dst = $basedir . $dst; |
|
| 62 | +$src = $basedir.$src; |
|
| 63 | +$dst = $basedir.$dst; |
|
| 64 | 64 | |
| 65 | 65 | if (!file_exists($src)) { |
| 66 | - die("error: source not exist\nuse " . $argv[0] . " --help\n"); |
|
| 66 | + die("error: source not exist\nuse ".$argv[0]." --help\n"); |
|
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | if (file_exists($dst)) { |
| 70 | - die("error: destination already exists\nuse " . $argv[0] . " --help\n"); |
|
| 70 | + die("error: destination already exists\nuse ".$argv[0]." --help\n"); |
|
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | $cmd = $zipper[$type]; |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | return false; |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | - for ($i = 0; $i < count($parts); $i ++) { |
|
| 87 | + for ($i = 0; $i < count($parts); $i++) { |
|
| 88 | 88 | if (($parts[$i] == '..') || ($parts[$i] == '.')) { |
| 89 | 89 | return false; |
| 90 | 90 | } |