*/ Routing\Router::register('*', '(:all)', function () { return Event::first('404'); }); /* |-------------------------------------------------------------------------- | Route The Incoming Request |-------------------------------------------------------------------------- | | Phew! We can finally route the request to the appropriate route and | execute the route to get the response. This will give an instance | of the Response object that we can send back to the browser | */ $uri = URI::current(); Request::$route = Routing\Router::route(Request::method(), $uri); $response = Request::$route->call(); /* |-------------------------------------------------------------------------- | Persist The Session To Storage |-------------------------------------------------------------------------- | | If a session driver has been configured, we will save the session to | storage so it is avaiable for the next request. This will also set | the session cookie in the cookie jar to be sent to the user. | */ if (Config::get('session.driver') !== '') { Session::save(); } /*
ini_set('display_errors', 1); ini_set('html_errors', 1); error_reporting(E_ALL | E_STRICT); header('Debug: Enabled'); } else { $error_handler = new Raven_ErrorHandler($app->sentry); set_error_handler(array($error_handler, 'handleError')); set_exception_handler(array($error_handler, 'handleException')); } /* Define routing and dispatch controllers to build response */ $router = new Routing\Router($app); // Set URL slug patterns $router->setPattern('eventslug', '\\d{4}\\-\\w+'); $router->setPattern('id', '\\d+'); // Cope with Andrew's extreme muppetry $router->route('/2014-sf/register', '/2015-london/register'); // Authentication routes $router->route('/auth/callback', 'AuthCallback'); $router->route('/auth/logout', 'AuthLogout'); $router->route('/auth/email/start-verify', 'PublicSite\\AuthEmailSendCode'); $router->route('/auth/email/verify', 'PublicSite\\AuthEmailVerify'); // Public content routes $router->route('/:eventslug', 'PublicSite\\Info'); $router->route('/:eventslug/(?<page>schedule|faq|hub)', 'PublicSite\\Info'); $router->route('/:eventslug/register', 'PublicSite\\Register'); $router->route('/:eventslug/video', 'PublicSite\\VideoAPI'); $router->route('/:eventslug/video/(?<video_id>[\\w\\d\\-\\_]+)', 'PublicSite\\VideoAPI'); $router->route('/:eventslug/pay/charge', 'PublicSite\\BillingCharge'); $router->route('/:eventslug/pay/cancel', 'PublicSite\\BillingCancel'); $router->route('/:eventslug/share', 'PublicSite\\ShareByEmail'); $router->route('/bot/(?<command>feedback|now|next)', 'PublicSite\\Bot');