/gist:d1bbf1ed3a22bdbb5d9c Secret
Created
August 4, 2013 03:02
Star
You must be signed in to star a gist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| use Symfony\Component\HttpFoundation\Request; | |
| use Silex\Application; | |
| use Dflydev\Stack\AuraFrameworkWrapper; | |
| $app = new Application(); | |
| $app->get('/', function () { | |
| return "Main Application!"; | |
| }); | |
| $app->get('/admin', function () { | |
| return "Protected!"; | |
| }); | |
| $map = [ | |
| // Assume that there is a sibling directory named aura-demo-1.2.5 | |
| // that contains an Aura.Framework application. By creating the | |
| // AuraFrameworkWrapper, it makes the Aura app effectively a Stack | |
| // compatible Symfony HttpKernelInterface application... and can | |
| // take advantage of all of the other things we can put on the stack | |
| // like stack/oauth and stack/session. | |
| // | |
| // Assume the Aura demo application has a /protected path... we'll | |
| // be protecting that with Stack Basic HTTP Authentication and | |
| // aura doesn't even have to know about it. | |
| "/aura-demo" => new AuraFrameworkWrapper(dirname(__DIR__).'/aura-demo-1.2.5'), | |
| ]; | |
| $app = (new Stack\Builder()) | |
| ->push('Stack\Session') | |
| ->push('Dflydev\Stack\BasicAuthentication', [ | |
| 'realm' => 'YAY!' | |
| 'firewall' => [ | |
| ['path' => '/admin'], | |
| ['path' => '/aura-demo/protected'] | |
| ] | |
| ]) | |
| ->push('Stack\UrlMap', $map) | |
| ->resolve($app); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment