Page not found
The stacktrace displays the function calls made that led to the error. They are displayed in an inverted order to how they were called.
- * @throws PublicException
- */
- public function getController($controller, Context$intent) {
- #Get the controllers class name. If it doesn't exist it'll be false
- $c = $this->hasController($controller);
- #If no controller was found, we can throw an exception letting the user know
- if ($c === false) { throw new PublicException("Page not found", 404, new PrivateException("Controller {$controller[0]} not found", 0) ); }
- #Otherwise we will instantiate the class and return it
- return new $c($intent);
- $context->cache = MemcachedAdapter::getInstance();
- $context->request = Request::get();
- $context->parameters = $context->request->getPath()->getParameters();
- $context->response = new Response($context);
- $context->middleware = new MiddlewareStack($context);
- $context->app = spitfire()->getApp($context->request->getPath()->getApp());
- $context->controller = $context->app->getControllerLocator()->getController($context->request->getPath()->getController(), $context);
- $context->action = $context->request->getPath()->getAction();
- $context->object = $context->request->getPath()->getObject();
- * Automatically creates a context from the available data. This allows Spitfire
- * to create a single interface that your app can use to access all it's
- * components in a convenient way.
- *
- * @return type
- */
- public function makeContext() {
- $this->context = Context::create();
- return $this->context;
- }
- #If the request has no defined controller, action and object it will define
- #those now.
- $path = $request->getPath();
- #Receive the initial context for the app. The controller can replace this later
- /*@var $initContext Context*/
- $initContext = ($path instanceof Context)? $path : $request->makeContext();
- #Define the context, include the application's middleware configuration.
- current_context($initContext);
- include __DIR__ . '/vendor/autoload.php';
- include __DIR__ . '/spitfire/bootstrap.php';
- include __DIR__ . '/bin/settings/services.php';
- ini_set('memory_limit', '128M');/**/
- /* Call the selected controller with the selected method. */
- spitfire()->fire();
- * @throws PublicException
- */
- public function getController($controller, Context$intent) {
- #Get the controllers class name. If it doesn't exist it'll be false
- $c = $this->hasController($controller);
- #If no controller was found, we can throw an exception letting the user know
- if ($c === false) { throw new PublicException("Page not found", 404, new PrivateException("Controller {$controller[0]} not found", 0) ); }
- #Otherwise we will instantiate the class and return it
- return new $c($intent);
- $context->cache = MemcachedAdapter::getInstance();
- $context->request = Request::get();
- $context->parameters = $context->request->getPath()->getParameters();
- $context->response = new Response($context);
- $context->middleware = new MiddlewareStack($context);
- $context->app = spitfire()->getApp($context->request->getPath()->getApp());
- $context->controller = $context->app->getControllerLocator()->getController($context->request->getPath()->getController(), $context);
- $context->action = $context->request->getPath()->getAction();
- $context->object = $context->request->getPath()->getObject();
- * Automatically creates a context from the available data. This allows Spitfire
- * to create a single interface that your app can use to access all it's
- * components in a convenient way.
- *
- * @return type
- */
- public function makeContext() {
- $this->context = Context::create();
- return $this->context;
- }
- #If the request has no defined controller, action and object it will define
- #those now.
- $path = $request->getPath();
- #Receive the initial context for the app. The controller can replace this later
- /*@var $initContext Context*/
- $initContext = ($path instanceof Context)? $path : $request->makeContext();
- #Define the context, include the application's middleware configuration.
- current_context($initContext);
- include __DIR__ . '/vendor/autoload.php';
- include __DIR__ . '/spitfire/bootstrap.php';
- include __DIR__ . '/bin/settings/services.php';
- ini_set('memory_limit', '128M');/**/
- /* Call the selected controller with the selected method. */
- spitfire()->fire();