Example #1
0
 public function __toString()
 {
     try {
         ob_start();
         extract((array) $this);
         require SP . $this->__view . EXT;
         return ob_get_clean();
     } catch (Exception $exc) {
         Error::exception($exc);
         return '';
     }
 }
 /**
  * Return the view's HTML
  *
  * @return string
  */
 public function __toString()
 {
     try {
         ob_start();
         extract((array) $this);
         require static::$directory . $this->__view . static::$ext;
         return ob_get_clean();
     } catch (\Exception $e) {
         \Micro\Error::exception($e);
         return '';
     }
 }
$x = FALSE;
if ($backtrace = $exception->getTrace()) {
    foreach ($backtrace as $id => $line) {
        if (!isset($line['file'], $line['line'])) {
            continue;
        }
        $x = TRUE;
        print '<div class="box">';
        //Skip the first element
        if ($id !== 0) {
            // If this is a class include the class name
            print '<b>Called by ' . (isset($line['class']) ? $line['class'] . $line['type'] : '');
            print $line['function'] . '()</b>';
        }
        // Print file, line, and source
        print ' in ' . $line['file'] . ' [' . $line['line'] . ']';
        print '<code class="source">' . \Micro\Error::source($line['file'], $line['line']) . '</code>';
        if (isset($line['args'])) {
            print '<b>Function Arguments</b>';
            print dump($line['args']);
        }
        print '</div>';
    }
}
if (!$x) {
    print '<p><b>' . $exception->getFile() . '</b> (' . $exception->getLine() . ')</p>';
}
?>

</div>
<?php

/**
 * Index
 *
 * This file defines the basic processing logic flow for the system
 *
 * @package		MicroMVC
 * @author		David Pennington
 * @copyright	(c) 2011 MicroMVC Framework
 * @license		http://micromvc.com/license
 ********************************** 80 Columns *********************************
 */
// Include bootstrap
require '../Bootstrap.php';
try {
    // Anything else before we start?
    event('system.startup');
    // Load controller dispatch passing URL routes
    $dispatch = new \Micro\Dispatch(config('Route')->routes);
    // Run controller based on URL path and HTTP request method
    $controller = $dispatch->controller(PATH, getenv('REQUEST_METHOD'));
    // Send the controller response
    $controller->send();
    // One last chance to do something
    event('system.shutdown', $controller);
} catch (Exception $e) {
    \Micro\Error::exception($e);
}
</style>

<div class="system_error">

	<b style="color: #990000">Error</b>
	<p><?php 
echo $error;
?>
</p>

	<?php 
//print dump(debug_backtrace());
?>

	<?php 
if ($backtrace = \Micro\Error::backtrace(1)) {
    foreach ($backtrace as $id => $line) {
        print '<div class="box">';
        //Skip the first element
        if ($id !== 0) {
            // If this is a class include the class name
            print '<b>Called by ' . (isset($line['class']) ? $line['class'] . $line['type'] : '');
            print $line['function'] . '()</b>';
        }
        // Print file, line, and source
        print ' in ' . $line['file'] . ' [' . $line['line'] . ']';
        print '<code class="source">' . $line['source'] . '</code>';
        if (isset($line['args'])) {
            print '<b>Function Arguments</b>';
            print dump($line['args']);
        }