コード例 #1
0
ファイル: Dispatcher.php プロジェクト: lerre/framework
 /** 
  * Reload the routes for dispatching
  */
 public function reload()
 {
     $options = array('directory' => MAD_ROOT . '/app/controllers', 'explicit' => false);
     $map = new Horde_Routes_Mapper($options);
     include MAD_ROOT . '/config/routes.php';
     $scanner = new Mad_Controller_Scanner($map);
     $map->controllerScan = $scanner->getCallback();
     $this->_mapper = $map;
 }
コード例 #2
0
ファイル: ScannerTest.php プロジェクト: lerre/framework
 public function testScanFilesystem()
 {
     $mapper = new Horde_Routes_Mapper();
     $mapper->connect(':controller/:action/:id');
     $scanner = new Mad_Controller_Scanner($mapper);
     $controllers = $scanner->scanFilesystem(MAD_ROOT . '/app/controllers');
     sort($controllers);
     $this->assertEquals(array('application', 'error', 'unit_test'), $controllers);
 }