[ Index ] |
|
Code source de Symfony 1.0.0 |
1 <?php 2 3 /* 4 * This file is part of the symfony package. 5 * (c) 2004-2006 Fabien Potencier <fabien.potencier@symfony-project.com> 6 * (c) 2004-2006 Sean Kerr. 7 * 8 * For the full copyright and license information, please view the LICENSE 9 * file that was distributed with this source code. 10 */ 11 12 /** 13 * sfFrontWebController allows you to centralize your entry point in your web 14 * application, but at the same time allow for any module and action combination 15 * to be requested. 16 * 17 * @package symfony 18 * @subpackage controller 19 * @author Fabien Potencier <fabien.potencier@symfony-project.com> 20 * @author Sean Kerr <skerr@mojavi.org> 21 * @version SVN: $Id: sfFrontWebController.class.php 3502 2007-02-18 18:28:28Z fabien $ 22 */ 23 class sfFrontWebController extends sfWebController 24 { 25 /** 26 * Dispatches a request. 27 * 28 * This will determine which module and action to use by request parameters specified by the user. 29 */ 30 public function dispatch() 31 { 32 try 33 { 34 if (sfConfig::get('sf_logging_enabled')) 35 { 36 $this->getContext()->getLogger()->info('{sfController} dispatch request'); 37 } 38 39 // reinitialize filters (needed for unit and functional tests) 40 sfFilter::$filterCalled = array(); 41 42 // determine our module and action 43 $request = $this->getContext()->getRequest(); 44 $moduleName = $request->getParameter('module'); 45 $actionName = $request->getParameter('action'); 46 47 // make the first request 48 $this->forward($moduleName, $actionName); 49 } 50 catch (sfException $e) 51 { 52 if (sfConfig::get('sf_test')) 53 { 54 throw $e; 55 } 56 57 $e->printStackTrace(); 58 } 59 catch (Exception $e) 60 { 61 if (sfConfig::get('sf_test')) 62 { 63 throw $e; 64 } 65 66 try 67 { 68 // wrap non symfony exceptions 69 $sfException = new sfException(); 70 $sfException->printStackTrace($e); 71 } 72 catch (Exception $e) 73 { 74 header('HTTP/1.0 500 Internal Server Error'); 75 } 76 } 77 } 78 }
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Fri Mar 16 22:42:14 2007 | par Balluche grâce à PHPXref 0.7 |