Exemplo n.º 1
0
 /**
  * Returns a stacktrace in the form of a string
  */
 public static function trace_string($trace)
 {
     $string = "";
     // Setup the stack trace
     $string .= Eight_Exception::trace_string_line("Stack trace:");
     $string .= Eight_Exception::trace_string_line("");
     $x = 0;
     foreach (Eight_Exception::trace($trace) as $i => $step) {
         $msg_line = "#" . str_pad($x, 2, "0", STR_PAD_LEFT) . "  ";
         if ($step['file']) {
             $source_id = $error_id . 'source' . $i;
             $msg_line .= Eight_Exception::debug_path($step['file']) . '(' . $step['line'] . "):  ";
         } else {
             $msg_line .= "{" . __('PHP internal call') . "}:  ";
         }
         $msg_line .= $step['function'] . '(';
         $print_able_args = array();
         if ($step['args']) {
             $args_id = $error_id . 'args' . $i;
             foreach ($step['args'] as $arg) {
                 $arg_name = "";
                 if (is_object($arg)) {
                     $arg_name = get_class($arg);
                 } else {
                     if (is_array($arg)) {
                         $arg_name = "Array(" . count($arg) . ")";
                     } else {
                         if (is_null($arg)) {
                             $arg_name = "NULL";
                         } else {
                             if (is_string($arg)) {
                                 $arg_name = $arg;
                             } else {
                                 $arg_name = strval($arg);
                             }
                         }
                     }
                 }
                 $arg_name = preg_replace("#\\s+#", " ", $arg_name);
                 $print_able_args[] = str::limit_chars($arg_name, 50, "");
             }
         }
         $msg_line .= implode(", ", $print_able_args);
         $msg_line .= ")";
         $string .= Eight_Exception::trace_string_line($msg_line);
         $x++;
     }
     return $string;
 }
Exemplo n.º 2
0
echo count($included);
?>
)</h3>
		<div id="<?php 
echo $env_id;
?>
" class="collapsed">
			<table cellspacing="0">
				<?php 
foreach ($included as $file) {
    ?>
				<tr>
					<td>
						<code>
<?php 
    echo Eight_Exception::debug_path($file);
    ?>
						</code>
					</td>
				</tr>
				<?php 
}
?>
			</table>
		</div>
		<?php 
foreach (array('_DEFINED', '_SESSION', '_GET', '_POST', '_FILES', '_COOKIE', '_SERVER') as $var) {
    ?>
		<?php 
    if (empty($GLOBALS[$var]) or !is_array($GLOBALS[$var])) {
        continue;
Exemplo n.º 3
0
add_line("Line: " . $line);
add_break();
add_line("Message:");
foreach (explode("\n", $message) as $msg_line) {
    add_line(trim($msg_line));
}
add_break();
if (Eight_Exception::$trace_output) {
    add_line("Stack trace:");
    add_line("");
    $x = 0;
    foreach (Eight_Exception::trace($trace) as $i => $step) {
        $msg_line = "#" . str_pad($x, 2, "0", STR_PAD_LEFT) . "  ";
        if ($step['file']) {
            $source_id = $error_id . 'source' . $i;
            $msg_line .= Eight_Exception::debug_path($step['file']) . '(' . $step['line'] . "):  ";
        } else {
            $msg_line .= "{" . __('PHP internal call') . "}:  ";
        }
        $msg_line .= $step['function'] . '(';
        $print_able_args = array();
        if ($step['args']) {
            $args_id = $error_id . 'args' . $i;
            foreach ($step['args'] as $arg) {
                $arg_name = "";
                if (is_object($arg)) {
                    $arg_name = get_class($arg);
                } else {
                    if (is_array($arg)) {
                        $arg_name = "Array(" . count($arg) . ")";
                    } else {