sfConsoleController.class.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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 17858 2009-05-01 21:22:50Z FabianLange $
  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. }