default
[ class tree: default ] [ index: default ] [ all elements ]

Source for file DevelopmentAdmin.php

Documentation is available at DevelopmentAdmin.php

  1. <?php
  2.  
  3. /**
  4.  * Base class for URL access to development tools. Currently supports the
  5.  * TestRunner and TaskRunner.
  6.  *
  7.  * @todo documentation for how to add new unit tests and tasks
  8.  */
  9. class DevelopmentAdmin extends Controller {
  10.     
  11.     static $url_handlers array(
  12.         '' => 'index',
  13.         '$Action' => '$Action'
  14.     );
  15.     
  16.     function index({
  17.         $renderer new DebugView();
  18.         $renderer->writeHeader();
  19.         echo <<<HTML
  20.             <div class="info"><h1>Sapphire Development Tools</h1></div>
  21.             <div class="options">
  22.             <ul>
  23.                 <li><a href="tests">/dev/tests: See a list of unit tests to run</a></li>
  24.                 <li><a href="tasks">/dev/tasks: See a list of build tasks to run</a></li>
  25.                 <li><a href="db/build?flush=1">/db/build?flush=1: Rebuild the database</a></li>
  26.             </ul>
  27.             </div>
  28. HTML;
  29.         $renderer->writeFooter();
  30.     }
  31.     
  32.     function tests({
  33.         if(isset($this->urlParams['NestedAction'])) {
  34.             Director::redirect("TestRunner/only/" $this->urlParams['NestedAction']);
  35.         else {
  36.             Director::redirect("TestRunner/");
  37.         }
  38.     }
  39.     
  40.     function tasks($request{
  41.         return new TaskRunner();
  42.     }
  43.     
  44. }
  45.  
  46. ?>

blog comments powered by Disqus
Documentation generated on Fri, 13 Jun 2008 06:34:58 +1200 by phpDocumentor 1.3.2