Skip to content

Instantly share code, notes, and snippets.

@cirpo
Last active August 29, 2015 14:00
Show Gist options
  • Save cirpo/11296317 to your computer and use it in GitHub Desktop.
Save cirpo/11296317 to your computer and use it in GitHub Desktop.
<?php
$app = new Silex\Application();
$app = (new Stack\Builder())
->push('Dflydev\Stack\BasicAuthentication', [
'firewall' => [
['path' => '/', 'anonymous' => true],
['path' => '/login'],
],
'authenticator' => function ($username, $password) {
// authenticate
},
'realm' => 'here there be dragons',
])
->resolve($app);
$request = Request::createFromGlobals();
$response = $app->handle($request)->send();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment