Page MenuHomePhabricator

D669.id.diff
No OneTemporary

D669.id.diff

diff --git a/App.php b/App.php
--- a/App.php
+++ b/App.php
@@ -57,34 +57,5 @@
* spitfire will look for controllers, models etc for this application.
*/
abstract public function namespace();
-
- public function makeRoutes() {
- #Include the routes from the user definitions
- file_exists("{$this->directory()}/settings/routes.php") && include "{$this->directory()}/settings/routes.php";
-
- #Build some defaults
- $ns = $this->url();
-
- #The default route just returns a path based on app/controller/action/object
- #If your application does not wish this to happen, please override createRoutes
- #with your custome code.
- $default = Router::getInstance()->request($ns, function (Parameters$params, Parameters$server, $extension) {
- $args = $params->getUnparsed();
- return new Path($this, array_shift($args), array_shift($args), $args, $extension);
- });
-
- #The reverser for the default route is rather simple again.
- #It will concatenate app, controller and action
- $default->setReverser(new ClosureReverser(function (Path$path, $explicit = false) {
- $controller = $path->getController();
- $action = $path->getAction();
- $object = $path->getObject();
-
- if ($action === Environment::get('default_action') && empty($object) && !$explicit) { $action = ''; }
- if ($controller === (array)Environment::get('default_controller') && empty($object) && empty($action) && !$explicit) { $controller = Array(); }
-
- return '/' . trim(implode('/', array_filter(array_merge((array)$controller, [$action], $object))), '/');
- }));
- }
}
diff --git a/core/kernel/WebKernel.php b/core/kernel/WebKernel.php
--- a/core/kernel/WebKernel.php
+++ b/core/kernel/WebKernel.php
@@ -65,10 +65,6 @@
# TODO: The stack needs to be 'decorated' with requesthandlers
# TODO: Run the stack
- #Every app now gets the chance to create appropriate routes for it's operation
- #TODO: The apps should have the appropriate route service providers
- foreach ($this->apps as $app) { $app->makeRoutes(); }
-
#Start debugging output
ob_start();
diff --git a/tests/URLTest.php b/tests/URLTest.php
--- a/tests/URLTest.php
+++ b/tests/URLTest.php
@@ -24,7 +24,6 @@
Router::getInstance()->request('/static/:page', ['controller' => 'content', 'action' => 'page', 'object' => ':page']);
$t = new \spitfire\UnnamedApp('');
- $t->makeRoutes();
spitfire()->registerApp($t);
$this->setup = true;

File Metadata

Mime Type
text/plain
Expires
Wed, Apr 14, 6:47 PM (3 w, 5 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
6078
Default Alt Text
D669.id.diff (2 KB)

Event Timeline