Changeset 2382
- Timestamp:
- 10/12/06 18:20:48 (2 years ago)
- Files:
-
- tools/pake/trunk/lib/pake/pakeColor.class.php (modified) (1 diff)
- tools/pake/trunk/lib/pake/pakeException.class.php (modified) (3 diffs)
- tools/pake/trunk/lib/pake/pakeFunction.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
tools/pake/trunk/lib/pake/pakeColor.class.php
r2042 r2382 30 30 } 31 31 32 static function colorize($text = '', $parameters = array() )32 static function colorize($text = '', $parameters = array(), $stream = STDOUT) 33 33 { 34 34 // disable colors if not supported (windows or non tty console) 35 if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN' || !function_exists('posix_isatty') || !@posix_isatty( STDOUT))35 if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN' || !function_exists('posix_isatty') || !@posix_isatty($stream)) 36 36 { 37 37 return $text; tools/pake/trunk/lib/pake/pakeException.class.php
r1868 r2382 42 42 $messages[] = str_repeat(' ', $len); 43 43 44 echo "\n";44 fwrite(STDERR, "\n"); 45 45 foreach ($messages as $message) 46 46 { 47 echo pakeColor::colorize($message, 'ERROR')."\n";47 fwrite(STDERR, pakeColor::colorize($message, 'ERROR', STDERR)."\n"); 48 48 } 49 echo "\n";49 fwrite(STDERR, "\n"); 50 50 51 51 $pake = pakeApp::get_instance(); … … 53 53 if ($pake->get_trace()) 54 54 { 55 echo "exception trace:\n";55 fwrite(STDERR, "exception trace:\n"); 56 56 57 57 $trace = $this->trace($e); … … 64 64 $line = isset($trace[$i]['line']) ? $trace[$i]['line'] : 'n/a'; 65 65 66 echo sprintf(" %s%s%s at %s:%s\n", $class, $type, $function, pakeColor::colorize($file, 'INFO'), pakeColor::colorize($line, 'INFO'));66 fwrite(STDERR, sprintf(" %s%s%s at %s:%s\n", $class, $type, $function, pakeColor::colorize($file, 'INFO', STDERR), pakeColor::colorize($line, 'INFO', STDERR))); 67 67 } 68 68 } 69 69 70 echo "\n";70 fwrite(STDERR, "\n"); 71 71 } 72 72 tools/pake/trunk/lib/pake/pakeFunction.php
r2006 r2382 393 393 $e = new pakeException(); 394 394 $e->render($exception); 395 exit(1); 395 396 } 396 397 set_exception_handler('pake_exception_default_handler');