diff options
-rw-r--r-- | it.class | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -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) |