From cc496ad4f7bfe1f96b80dcbf1201b8ff030d1983 Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Mon, 11 Aug 2008 03:56:09 +0000 Subject: [PATCH] Fixed URL handling for /dev after merge from branches/roa to trunk git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@60362 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- _config.php | 22 +++------------------- dev/DevelopmentAdmin.php | 25 +++++++++++++------------ 2 files changed, 16 insertions(+), 31 deletions(-) diff --git a/_config.php b/_config.php index 8bdb5d720..03b813379 100644 --- a/_config.php +++ b/_config.php @@ -21,10 +21,9 @@ Director::addRules(10, array( 'Security//$Action/$ID/$OtherID' => 'Security', //'Security/$Action/$ID' => 'Security', - 'db/$Action' => 'DatabaseAdmin', - '$Controller' => array( - ), - 'images/$Action/$Class/$ID/$Field' => 'Image_Uploader', + 'db//$Action' => 'DatabaseAdmin', + '$Controller//$Action/$ID/$OtherID' => '*', + 'images//$Action/$Class/$ID/$Field' => 'Image_Uploader', '' => 'RootURLController', 'sitemap.xml' => 'GoogleSitemap', 'api/v1' => 'RestfulServer', @@ -92,21 +91,6 @@ Security::set_password_encryption_algorithm('sha1', true); define('EMAIL_BOUNCEHANDLER_KEY', '1aaaf8fb60ea253dbf6efa71baaacbb3'); -// Default director -Director::addRules(10, array( - 'Security/$Action/$ID' => 'Security', - 'db/$Action' => 'DatabaseAdmin', - '$Controller/$Action/$ID/$OtherID' => '*', - 'images/$Action/$Class/$ID/$Field' => 'Image_Uploader', - '' => 'RootURLController', - 'sitemap.xml' => 'GoogleSitemap', - 'api/v1/$ClassName/$ID/$Relation' => 'RestfulServer', - 'dev/$Action/$NestedAction' => 'DevelopmentAdmin' -)); - -Director::addRules(1, array( - '$URLSegment/$Action/$ID/$OtherID' => 'ModelAsController', -)); ?> \ No newline at end of file diff --git a/dev/DevelopmentAdmin.php b/dev/DevelopmentAdmin.php index 55996b94b..7bc68345b 100644 --- a/dev/DevelopmentAdmin.php +++ b/dev/DevelopmentAdmin.php @@ -20,13 +20,14 @@ class DevelopmentAdmin extends Controller { $renderer = new DebugView(); $renderer->writeHeader(); $renderer->writeInfo("Sapphire Development Tools", Director::absoluteBaseURL()); + $base = Director::baseURL(); echo << HTML; @@ -34,20 +35,20 @@ HTML; } function tests($request) { - $controller = new TestRunner(); - return $controller->handleRequest($request); + return new TestRunner(); } function tasks() { - $controller = new TaskRunner(); - return $controller->handleRequest($request); + return new TaskRunner(); + } + + function errors() { + Director::redirect("Debug_"); } function viewcode($request) { - $controller = new CodeViewer(); - return $controller->handleRequest($request); + return new CodeViewer(); } - } -?> \ No newline at end of file +?>