Skip to content

Commit

Permalink
Update the Symfony documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
mnapoli committed May 2, 2018
1 parent bd8a946 commit 92f5da2
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions docs/Symfony.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,30 @@ Here is an example of what your `bref.php` file should contain:
```php
<?php

use App\Kernel;
use Bref\Bridge\Symfony\SymfonyAdapter;
use Symfony\Component\Debug\Debug;
use Symfony\Component\Dotenv\Dotenv;

# On lambdas the output is not displayed in the HTTP response
ini_set('display_errors', '1');
error_reporting(E_ALL);

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

$kernel = new \App\Kernel('prod', false);
Debug::enable();

// The check is to ensure we don't use .env in production
if (!isset($_SERVER['APP_ENV'])) {
(new Dotenv)->load(__DIR__.'/.env');
}
if ($_SERVER['APP_DEBUG'] ?? ('prod' !== ($_SERVER['APP_ENV'] ?? 'dev'))) {
umask(0000);
}
$kernel = new Kernel($_SERVER['APP_ENV'] ?? 'dev', (bool) ($_SERVER['APP_DEBUG'] ?? ('prod' !== ($_SERVER['APP_ENV'] ?? 'dev'))));

$app = new \Bref\Application;
$app->httpHandler(new \Bref\Bridge\Symfony\SymfonyAdapter($kernel));
$app->httpHandler(new SymfonyAdapter($kernel));
$app->cliHandler(new \Symfony\Bundle\FrameworkBundle\Console\Application($kernel));
$app->run();
```
Expand Down

0 comments on commit 92f5da2

Please sign in to comment.