diff options
author | Urban Müller | 2007-05-30 12:16:43 +0000 |
---|---|---|
committer | Urban Müller | 2007-05-30 12:16:43 +0000 |
commit | f11576b2077d5d95a2d0dd59c523d655326eed0c (patch) | |
tree | 2e157368a47446ce44c6d10fa221334c9e57c4e3 /it.class | |
parent | ffe6e66c50dd9c27088f242e7c4fe8fa55875c49 (diff) | |
download | itools-f11576b2077d5d95a2d0dd59c523d655326eed0c.tar.gz itools-f11576b2077d5d95a2d0dd59c523d655326eed0c.tar.bz2 itools-f11576b2077d5d95a2d0dd59c523d655326eed0c.zip |
create log links, support noexec
Diffstat (limited to 'it.class')
-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) |