2
0

Abstract.php 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. <?php
  2. /**
  3. * Zend Framework
  4. *
  5. * LICENSE
  6. *
  7. * This source file is subject to the new BSD license that is bundled
  8. * with this package in the file LICENSE.txt.
  9. * It is also available through the world-wide-web at this URL:
  10. * http://framework.zend.com/license/new-bsd
  11. * If you did not receive a copy of the license and are unable to
  12. * obtain it through the world-wide-web, please send an email
  13. * to license@zend.com so we can send you a copy immediately.
  14. *
  15. * @category Zend
  16. * @package Zend_Controller
  17. * @subpackage Plugins
  18. * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
  19. * @license http://framework.zend.com/license/new-bsd New BSD License
  20. */
  21. /**
  22. * @category Zend
  23. * @package Zend_Controller
  24. * @subpackage Plugins
  25. * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
  26. * @license http://framework.zend.com/license/new-bsd New BSD License
  27. */
  28. abstract class Zend_Controller_Plugin_Abstract
  29. {
  30. /**
  31. * @var Zend_Controller_Request_Abstract
  32. */
  33. protected $_request;
  34. /**
  35. * @var Zend_Controller_Response_Abstract
  36. */
  37. protected $_response;
  38. /**
  39. * Set request object
  40. *
  41. * @param Zend_Controller_Request_Abstract $request
  42. * @return Zend_Controller_Plugin_Abstract
  43. */
  44. public function setRequest(Zend_Controller_Request_Abstract $request)
  45. {
  46. $this->_request = $request;
  47. return $this;
  48. }
  49. /**
  50. * Get request object
  51. *
  52. * @return Zend_Controller_Request_Abstract $request
  53. */
  54. public function getRequest()
  55. {
  56. return $this->_request;
  57. }
  58. /**
  59. * Set response object
  60. *
  61. * @param Zend_Controller_Response_Abstract $response
  62. * @return Zend_Controller_Plugin_Abstract
  63. */
  64. public function setResponse(Zend_Controller_Response_Abstract $response)
  65. {
  66. $this->_response = $response;
  67. return $this;
  68. }
  69. /**
  70. * Get response object
  71. *
  72. * @return Zend_Controller_Response_Abstract $response
  73. */
  74. public function getResponse()
  75. {
  76. return $this->_response;
  77. }
  78. /**
  79. * Called before Zend_Controller_Front begins evaluating the
  80. * request against its routes.
  81. *
  82. * @param Zend_Controller_Request_Abstract $request
  83. * @return void
  84. */
  85. public function routeStartup(Zend_Controller_Request_Abstract $request)
  86. {}
  87. /**
  88. * Called after Zend_Controller_Router exits.
  89. *
  90. * Called after Zend_Controller_Front exits from the router.
  91. *
  92. * @param Zend_Controller_Request_Abstract $request
  93. * @return void
  94. */
  95. public function routeShutdown(Zend_Controller_Request_Abstract $request)
  96. {}
  97. /**
  98. * Called before Zend_Controller_Front enters its dispatch loop.
  99. *
  100. * @param Zend_Controller_Request_Abstract $request
  101. * @return void
  102. */
  103. public function dispatchLoopStartup(Zend_Controller_Request_Abstract $request)
  104. {}
  105. /**
  106. * Called before an action is dispatched by Zend_Controller_Dispatcher.
  107. *
  108. * This callback allows for proxy or filter behavior. By altering the
  109. * request and resetting its dispatched flag (via
  110. * {@link Zend_Controller_Request_Abstract::setDispatched() setDispatched(false)}),
  111. * the current action may be skipped.
  112. *
  113. * @param Zend_Controller_Request_Abstract $request
  114. * @return void
  115. */
  116. public function preDispatch(Zend_Controller_Request_Abstract $request)
  117. {}
  118. /**
  119. * Called after an action is dispatched by Zend_Controller_Dispatcher.
  120. *
  121. * This callback allows for proxy or filter behavior. By altering the
  122. * request and resetting its dispatched flag (via
  123. * {@link Zend_Controller_Request_Abstract::setDispatched() setDispatched(false)}),
  124. * a new action may be specified for dispatching.
  125. *
  126. * @param Zend_Controller_Request_Abstract $request
  127. * @return void
  128. */
  129. public function postDispatch(Zend_Controller_Request_Abstract $request)
  130. {}
  131. /**
  132. * Called before Zend_Controller_Front exits its dispatch loop.
  133. *
  134. * @return void
  135. */
  136. public function dispatchLoopShutdown()
  137. {}
  138. }