예제 #1
0
파일: plaintext.php 프로젝트: horros/agavi
    $lines = explode("\n", trim($e->getMessage()));
    foreach ($lines as $line) {
        ?>
  <?php 
        echo $cols ? wordwrap($line, $cols - 2, "\n  ", true) : $line;
        ?>

<?php 
    }
    ?>

  Stack Trace
  -----------
<?php 
    $i = 0;
    $traceLines = AgaviException::getFixedTrace($e, isset($exceptions[$ei + 1]) ? $exceptions[$ei + 1] : null);
    $traceCount = count($traceLines);
    foreach ($traceLines as $trace) {
        $i++;
        echo sprintf("  %" . strlen($traceCount) . "s: ", $i);
        if (isset($trace['file'])) {
            $msg = $trace['file'] . (isset($trace['line']) ? ':' . $trace['line'] : '');
            echo $cols ? wordwrap($msg, $cols - 4 - strlen($traceCount), "\n" . str_repeat(' ', 4 + strlen($traceCount)), true) : $msg;
        } else {
            echo "Unknown file";
        }
        echo "\n";
    }
}
?>
예제 #2
0
        echo $msg;
        ?>
				</div>
<?php 
    }
    ?>
				<h3>Stack Trace</h3>
				<ol>
<?php 
    $i = 0;
    $highlights = array();
    $filepaths = array();
    foreach (array('core.module_dir', 'core.template_dir', 'core.config_dir', 'core.cache_dir', 'core.lib_dir', 'core.app_dir', 'core.agavi_dir') as $directive) {
        $filepaths['#^' . preg_quote(AgaviConfig::get($directive)) . '(?<=.)#'] = sprintf('<abbr title="%s">%s</abbr>', htmlspecialchars(AgaviConfig::get($directive)), $directive);
    }
    foreach (AgaviException::getFixedTrace($e, isset($exceptions[$ei + 1]) ? $exceptions[$ei + 1] : null) as $trace) {
        $i++;
        if (isset($trace['file']) && !isset($highlights[$trace['file']])) {
            $highlights[$trace['file']] = AgaviException::highlightFile($trace['file']);
        }
        ?>
					<li id="exception<?php 
        echo $ei;
        ?>
frame<?php 
        echo $i;
        ?>
"<?php 
        if ($i != 2) {
            ?>
 class="closed"<?php