Restructure README.md

This commit is contained in:
filp
2013-05-10 20:31:37 +01:00
parent fbe0b89d18
commit 8b009e386a
+32 -32
View File
@@ -55,38 +55,6 @@ https://github.com/filp/whoops/wiki/API-Documentation
## Usage
### Opening referenced files with your favorite editor or IDE
When using the pretty error page feature, whoops comes with the ability to
open referenced files directly in your IDE or editor.
```php
<?php
use Whoops\Handler\PrettyPageHandler;
$handler = new PrettyPageHandler;
$handler->setEditor('sublime');
```
The following editors are currently supported by default.
- `sublime` - Sublime Text 2
- `emacs` - Emacs
- `textmate` - Textmate
- `macvim` - MacVim
- `xdebug` - xdebug (uses [xdebug.file_link_format](http://xdebug.org/docs/all_settings#file_link_format))
Adding your own editor is simple:
```php
$handler->setEditor(function($file, $line) {
return "whatever://open?file=$file&line=$line";
});
```
### Integrating with Silex
**whoops** comes packaged with a Silex Service Provider: `Whoops\Provider\Silex\WhoopsServiceProvider`. Using it
@@ -167,6 +135,38 @@ return array(
- NOTE: ob_clean(); is used to remove previous output, so you may use ob_start(); at the beginning of your app (index.php)
### Opening referenced files with your favorite editor or IDE
When using the pretty error page feature, whoops comes with the ability to
open referenced files directly in your IDE or editor.
```php
<?php
use Whoops\Handler\PrettyPageHandler;
$handler = new PrettyPageHandler;
$handler->setEditor('sublime');
```
The following editors are currently supported by default.
- `sublime` - Sublime Text 2
- `emacs` - Emacs
- `textmate` - Textmate
- `macvim` - MacVim
- `xdebug` - xdebug (uses [xdebug.file_link_format](http://xdebug.org/docs/all_settings#file_link_format))
Adding your own editor is simple:
```php
$handler->setEditor(function($file, $line) {
return "whatever://open?file=$file&line=$line";
});
```
### Available Handlers
**whoops** currently ships with the following built-in handlers, available in the `Whoops\Handler` namespace: