Skip to content

Commit

Permalink
better syntax on README
Browse files Browse the repository at this point in the history
  • Loading branch information
francois2metz committed Mar 5, 2010
1 parent c3482f5 commit 792bb8e
Showing 1 changed file with 24 additions and 18 deletions.
42 changes: 24 additions & 18 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,17 @@ Requirements
Usage
=====

$e = new ErrorNot('http://example.net/', 'my-api-key');
$e->notify('big error');
$e->notify('big error', '2010-03-03T00:00:42+01:00');
::

$e = new ErrorNot('http://example.net/', 'my-api-key');
$e->notify('big error');
$e->notify('big error', '2010-03-03T00:00:42+01:00');

ErrorNot can install a custom exception handler:

$e = new ErrorNot('http://example.net/', 'my-api-key', true);
::

$e = new ErrorNot('http://example.net/', 'my-api-key', true);

Be carefull about exception handler.

Expand All @@ -30,30 +33,33 @@ previous exception_handler.

ErrorNot will save your previous custom exception handler.

function my_exception_handler($e)
{
echo 'plop';
}
::

function my_exception_handler($e)
{
echo 'plop';
}

set_exception_handler('my_exception_handler'); // ok
$e = new ErrorNot('http://example.net/', 'my-api-key', true);
set_exception_handler('my_exception_handler'); // ok
$e = new ErrorNot('http://example.net/', 'my-api-key', true);

$e = new ErrorNot('http://example.net/', 'my-api-key', true);
set_exception_handler('my_exception_handler'); // not ok
$e = new ErrorNot('http://example.net/', 'my-api-key', true);
set_exception_handler('my_exception_handler'); // not ok

$e->installExceptionHandler(); // or reinstall exception handler
$e->installExceptionHandler(); // or reinstall exception handler

TESTS
=====

* simpletest for launching tests (http://www.simpletest.org/)

git submodule update --init
::

$> php tests/test_errornot.php
test_errornot.php
OK
Test cases run: 2/2, Passes: 8, Failures: 0, Exceptions: 0
$> git submodule update --init
$> php tests/test_errornot.php
test_errornot.php
OK
Test cases run: 2/2, Passes: 8, Failures: 0, Exceptions: 0


Author
Expand Down

0 comments on commit 792bb8e

Please sign in to comment.