summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUrban Müller2007-05-30 12:16:43 +0000
committerUrban Müller2007-05-30 12:16:43 +0000
commitf11576b2077d5d95a2d0dd59c523d655326eed0c (patch)
tree2e157368a47446ce44c6d10fa221334c9e57c4e3
parentffe6e66c50dd9c27088f242e7c4fe8fa55875c49 (diff)
downloaditools-f11576b2077d5d95a2d0dd59c523d655326eed0c.tar.gz
itools-f11576b2077d5d95a2d0dd59c523d655326eed0c.tar.bz2
itools-f11576b2077d5d95a2d0dd59c523d655326eed0c.zip
create log links, support noexec
-rw-r--r--it.class11
1 files changed, 9 insertions, 2 deletions
diff --git a/it.class b/it.class
index 04022e7..2258c7d 100644
--- a/it.class
+++ b/it.class
@@ -38,11 +38,18 @@ function log($name /* ... */)
$line = date("Y-m-d H:i:s") . "\t" . implode("\t", array_slice($args, 1)) . "\n";
$fn = $GLOBALS['ULTRAHOME'] . "/log/$name-" . date('Ymd');
+ $existed = file_exists($fn);
+
if ($fh = fopen($fn, "a"))
{
fputs($fh, $line);
fclose($fh);
- @chgrp($fn, "www");
+
+ if (!$existed)
+ {
+ @chgrp($fn, "www");
+ @symlink($fn, $GLOBALS['ULTRAHOME'] . "/log/$name");
+ }
}
}
@@ -319,7 +326,7 @@ function exec(/* $cmd, $values1 = array(), ... */)
it::log('exec', $cmd);
- return (string)shell_exec($cmd);
+ return EDC('noexec') ? "" : (string)shell_exec($cmd);
}
function _exec_quotevalue($value)