Changeset 272
- Timestamp:
- 08/01/08 09:23:17 (4 months ago)
- Files:
-
- trunk/Phergie/Plugin/Quit.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/Phergie/Plugin/Quit.php
r232 r272 81 81 } 82 82 $file = trim($file); 83 if ( is_file($path . $file)) {83 if (@is_file($path . $file)) { 84 84 $phpPath = $path . $file; 85 85 break 2; 86 } else if ( is_file(dirname($path) . DIRECTORY_SEPARATOR . $file)) {86 } else if (@is_file(dirname($path) . DIRECTORY_SEPARATOR . $file)) { 87 87 $phpPath = dirname($path) . DIRECTORY_SEPARATOR . $file; 88 88 break 2; … … 95 95 * PHP executable 96 96 */ 97 if (strtolower(substr(PHP_OS, 0, 3)) !== 'win') { 98 $exec = trim(exec('which php')); 99 if (!empty($exec) && is_file($exec)) { 100 $phpPath = $exec; 101 } 97 if (strtolower(substr(PHP_OS, 0, 3)) !== 'win' && function_exists('exec')) { 98 $func = new ReflectionFunction('exec'); 99 // skip this if exec is disabled by safe_mode or whatever 100 if (!$func->isDisabled()) { 101 $exec = trim(exec('which php')); 102 if (!empty($exec) && is_file($exec)) { 103 $phpPath = $exec; 104 } 105 } 106 unset($func); 102 107 } 103 108 unset($files, $file, $paths, $path, $exec);