sfConsoleController.class.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. /*
  3. * This file is part of the symfony package.
  4. * (c) 2004-2006 Fabien Potencier <fabien.potencier@symfony-project.com>
  5. *
  6. * For the full copyright and license information, please view the LICENSE
  7. * file that was distributed with this source code.
  8. */
  9. /**
  10. * @package symfony
  11. * @subpackage controller
  12. * @author Fabien Potencier <fabien.potencier@symfony-project.com>
  13. * @version SVN: $Id: sfConsoleController.class.php 9078 2008-05-20 00:33:39Z Carl.Vondrick $
  14. */
  15. class sfConsoleController extends sfController
  16. {
  17. /**
  18. * Dispatches a request.
  19. *
  20. * @param string $moduleName A module name
  21. * @param string $actionName An action name
  22. * @param array $parameters An associative array of parameters to be set
  23. */
  24. public function dispatch($moduleName, $actionName, $parameters = array())
  25. {
  26. try
  27. {
  28. // set parameters
  29. $this->context->getRequest()->getParameterHolder()->add($parameters);
  30. // make the first request
  31. $this->forward($moduleName, $actionName);
  32. }
  33. catch (sfException $e)
  34. {
  35. $e->printStackTrace();
  36. }
  37. catch (Exception $e)
  38. {
  39. sfException::createFromException($e)->printStackTrace();
  40. }
  41. }
  42. }