Skip to content

Commit

Permalink
Add autoload to example (#356)
Browse files Browse the repository at this point in the history
  • Loading branch information
foremtehan authored Sep 4, 2023
1 parent b401a4e commit e984728
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ To create an instance of `SocketHttpServer` and listen for requests, minimally f
* at least one host+port on which to listen for connections.

```php
<?php
use Amp\ByteStream;
use Amp\Http\HttpStatus;
use Amp\Http\Server\DefaultErrorHandler;
Expand All @@ -100,6 +101,8 @@ use Amp\Log\StreamHandler;
use Monolog\Logger;
use Monolog\Processor\PsrLogMessageProcessor;

require __DIR__.'/vendor/autoload.php';

// Note any PSR-3 logger may be used, Monolog is only an example.
$logHandler = new StreamHandler(ByteStream\getStdout());
$logHandler->pushProcessor(new PsrLogMessageProcessor());
Expand Down

0 comments on commit e984728

Please sign in to comment.