mirror of
https://github.com/filp/whoops.git
synced 2026-09-15 20:26:44 +00:00
Add things <(^_^<)
This commit is contained in:
+75
-7
@@ -29,6 +29,7 @@
|
||||
<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">
|
||||
@@ -43,25 +44,89 @@
|
||||
<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 & Use</h2>
|
||||
<h2 id="download">Download</h2>
|
||||
<p>
|
||||
<b>With composer:</b><br>
|
||||
<pre><code class="block">{
|
||||
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(JsonResponseHandler);
|
||||
|
||||
// Register the handler with PHP, and you're set!
|
||||
$run->register();
|
||||
</code></pre>
|
||||
</p>
|
||||
|
||||
<h2 id="learn-more">Learn More</h2>
|
||||
<h2 id="learn-more">Learn More & Contribute</h2>
|
||||
<p>
|
||||
<em>coming soon</em>
|
||||
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,
|
||||
@@ -70,6 +135,9 @@
|
||||
var windowHeight = Math.min(Math.max(800, $(window).height()), 1100);
|
||||
|
||||
$hero.height(windowHeight);
|
||||
|
||||
// Enable google code prettify
|
||||
prettyPrint();
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
||||
+45
-3
@@ -1,13 +1,22 @@
|
||||
body {
|
||||
font: 14px 'Source Sans Pro', helvetica, arial, sans-serif;
|
||||
font: 11px 'Source Sans Pro', helvetica, arial, sans-serif;
|
||||
background: #272727;
|
||||
color: white;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #82B6EA;
|
||||
text-decoration: none;
|
||||
}
|
||||
a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.container {
|
||||
width: 80%;
|
||||
max-width: 940px;
|
||||
margin: 0 auto;
|
||||
margin-bottom: 50px;
|
||||
}
|
||||
|
||||
.hero {
|
||||
@@ -59,6 +68,11 @@ body {
|
||||
font-size: 1.3em;
|
||||
}
|
||||
|
||||
p.center {
|
||||
text-align: center;
|
||||
margin: 30px 0;
|
||||
}
|
||||
|
||||
code {
|
||||
font-family: consolas, monospace;
|
||||
font-size: 80%;
|
||||
@@ -72,7 +86,7 @@ ul.simple {
|
||||
}
|
||||
|
||||
ul.simple li {
|
||||
margin-bottom: 5px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
ul.simple li:before {
|
||||
@@ -82,7 +96,7 @@ ul.simple li:before {
|
||||
}
|
||||
|
||||
.content h2 {
|
||||
color: #CACACA;
|
||||
color: #D4D4D4;
|
||||
text-shadow: 0 0 3px rgba(0, 0, 0, .4);
|
||||
}
|
||||
|
||||
@@ -100,4 +114,32 @@ ul.simple li:before {
|
||||
|
||||
.button:hover {
|
||||
background: #31679D;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
pre .str, code .str { color: #79E3E1; } /* string */
|
||||
pre .kwd, code .kwd { color: #FDFF62; font-weight: bold; } /* keyword*/
|
||||
pre .com, code .com { color: #A5A5A5; font-weight: bold; } /* comment */
|
||||
pre .typ, code .typ { color: #E16CA1; } /* type */
|
||||
pre .lit, code .lit { color: #49DF9D; } /* literal */
|
||||
pre .pun, code .pun { color: #51D743; font-weight: bold; } /* punctuation */
|
||||
pre .pln, code .pln { color: #BBBBBB; } /* plaintext */
|
||||
pre .tag, code .tag { color: #9c9cff; } /* html/xml tag */
|
||||
pre .htm, code .htm { color: #dda0dd; } /* html tag */
|
||||
pre .xsl, code .xsl { color: #d0a0d0; } /* xslt tag */
|
||||
pre .atn, code .atn { color: #46eeee; font-weight: normal;} /* html/xml attribute name */
|
||||
pre .atv, code .atv { color: #EEB4B4; } /* html/xml attribute value */
|
||||
pre .dec, code .dec { color: #3387CC; } /* decimal */
|
||||
pre.prettyprint, code.prettyprint {
|
||||
font-family: consolas, monospace;
|
||||
font-size: 16px;
|
||||
background: #181818;
|
||||
padding: 20px;
|
||||
color: #929292;
|
||||
-moz-border-radius: 16px;
|
||||
-webkit-border-radius: 16px;
|
||||
border-radius: 16px;
|
||||
}
|
||||
pre.prettyprint {
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user