Files
whoops/index.html
T
2013-04-10 09:57:54 +01:00

145 lines
5.5 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>whoops! - php errors for cool kids</title>
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/normalize/2.1.0/normalize.min.css">
<link rel="stylesheet" href="whoops.css">
</head>
<body>
<a href="https://github.com/filp/whoops"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_gray_6d6d6d.png" alt="Fork me on GitHub"></a>
<div class="container">
<header class="hero">
<div class="screenshot">
<a href="screen.png">
<img src="screen.png" alt="whoops error handler for PHP">
</a>
</div>
<h1 class="branding">whoops</h1>
<p class="description">
php errors for cool kids
</p>
<p class="subtext">
<b>whoops</b> is a nice little library that helps you develop and maintain
your projects better, by helping you deal with errors and exceptions in a less
painful way.
</p>
<p class="download-links">
<a href="https://github.com/filp/whoops" class="button">view on github</a>
<a href="https://github.com/filp/whoops/tags" class="button">download a stable version</a>
<a href="https://packagist.org/packages/filp/whoops" class="button">view on packagist</a>
</p>
</header>
<div class="content">
<h2 id="features">Features</h2>
<ul class="simple">
<li>Included providers for <b>Silex</b> and <b>Laravel 4</b>, with community-provided support for other platforms and frameworks</li>
<li>Detailed &amp; intuitive page for errors and exceptions <code>(PrettyPageHandler)</code></li>
<li>Code view for all frames in a stack trace with line highlights <code>(PrettyPageHandler)</code></li>
<li>Frame comments &amp; analysis through custom middle-ware/handlers <code>(PrettyPageHandler)</code></li>
<li>Request &amp; app-specific information through custom middle-ware/handlers <code>(PrettyPageHandler)</code></li>
<li>JSON &amp; AJAX support <code>(JsonResponseHandler)</code></li>
<li>Clean and tested code-base that's easy to extend and build on to make it work just right for your project</li>
</ul>
<h2 id="download">Download</h2>
<p>
With <a href="http://getcomposer.org">Composer</a>:<br>
<pre class="prettyprint"><code>{
"require": {
"filp": "1.*"
}
}</code></pre>
<pre class="prettyprint"><code>$ cd my_project
$ composer install</code></pre>
</p>
<h2 id="usage">Use</h2>
<p>
<p>
In your <a href="http://silex.sensiolabs.org/">Silex</a> project, register the bundled Service Provider:
</p>
<pre class="prettyprint"><code class="language-php">$app->register(new Whoops\Provider\Silex\WhoopsServiceProvider);</code></pre>
</p>
<p>
<p>
In your <a href="http://four.laravel.com/">Laravel 4</a> project, add the following to your <code>'providers'</code>
array, in your <code>app/config/app.php</code> file:
</p>
<pre class="prettyprint"><code class="language-php">'Whoops\Provider\Illuminate\WhoopsServiceProvider'</code></pre>
</p>
<p>
<p>
Or if you'd rather take control, integrate it manually and tweak it to fit your needs:
</p>
<pre class="prettyprint"><code class="language-php">require __DIR__ . "/vendor/autoload.php";
use Whoops\Handler\PrettyPageHandler;
use Whoops\Handler\JsonResponseHandler;
$run = new Whoops\Run;
$handler = new PrettyPageHandler;
// Add some custom tables with relevant info about your application,
// that could prove useful in the error page:
$handler->addDataTable(array(
"Important Data" => $myApp->getImportantData(),
"Thingamajig-id" => $someId
));
// Set the title of the error page:
$handler->setPageTitle("We're all going to be fired!");
$run->pushHandler($hanlder);
// Add a special handler to deal with AJAX requests with an
// equally-informative JSON response. Since this handler is
// first in the stack, it will be executed before the error
// page handler, and will have a chance to decide if anything
// needs to be done.
$run->pushHandler(new JsonResponseHandler);
// Register the handler with PHP, and you're set!
$run->register();
</code></pre>
</p>
<h2 id="learn-more">Learn More &amp; Contribute</h2>
<p>
Documentation is still scarce. Find available information and give us a hand with the
project in the official repository:
<p class="center">
<a class="button" href="https://github.com/filp/whoops"><b>whoops</b> on github</a>
</p>
</p>
<p class="subtext center">
Thank you for stopping by!
</p>
</div>
</div>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/prettify/r224/prettify.js"></script>
<script>
$(function() {
// Force the .hero to use up all available window space,
// with a minimum 600px and a maximum of 1100px height
var $hero = $('.hero');
var windowHeight = Math.min(Math.max(800, $(window).height()), 1100);
$hero.height(windowHeight);
// Enable google code prettify
prettyPrint();
});
</script>
</body>
</html>