Abstract.php 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  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-2015 Zend Technologies USA Inc. (http://www.zend.com)
  19. * @license http://framework.zend.com/license/new-bsd New BSD License
  20. * @version $Id$
  21. */
  22. /**
  23. * @category Zend
  24. * @package Zend_Controller
  25. * @subpackage Plugins
  26. * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
  27. * @license http://framework.zend.com/license/new-bsd New BSD License
  28. */
  29. abstract class Zend_Controller_Plugin_Abstract
  30. {
  31. /**
  32. * @var Zend_Controller_Request_Abstract
  33. */
  34. protected $_request;
  35. /**
  36. * @var Zend_Controller_Response_Abstract
  37. */
  38. protected $_response;
  39. /**
  40. * Set request object
  41. *
  42. * @param Zend_Controller_Request_Abstract $request
  43. * @return Zend_Controller_Plugin_Abstract
  44. */
  45. public function setRequest(Zend_Controller_Request_Abstract $request)
  46. {
  47. $this->_request = $request;
  48. return $this;
  49. }
  50. /**
  51. * Get request object
  52. *
  53. * @return Zend_Controller_Request_Abstract $request
  54. */
  55. public function getRequest()
  56. {
  57. return $this->_request;
  58. }
  59. /**
  60. * Set response object
  61. *
  62. * @param Zend_Controller_Response_Abstract $response
  63. * @return Zend_Controller_Plugin_Abstract
  64. */
  65. public function setResponse(Zend_Controller_Response_Abstract $response)
  66. {
  67. $this->_response = $response;
  68. return $this;
  69. }
  70. /**
  71. * Get response object
  72. *
  73. * @return Zend_Controller_Response_Abstract $response
  74. */
  75. public function getResponse()
  76. {
  77. return $this->_response;
  78. }
  79. /**
  80. * Called before Zend_Controller_Front begins evaluating the
  81. * request against its routes.
  82. *
  83. * @param Zend_Controller_Request_Abstract $request
  84. * @return void
  85. */
  86. public function routeStartup(Zend_Controller_Request_Abstract $request)
  87. {}
  88. /**
  89. * Called after Zend_Controller_Router exits.
  90. *
  91. * Called after Zend_Controller_Front exits from the router.
  92. *
  93. * @param Zend_Controller_Request_Abstract $request
  94. * @return void
  95. */
  96. public function routeShutdown(Zend_Controller_Request_Abstract $request)
  97. {}
  98. /**
  99. * Called before Zend_Controller_Front enters its dispatch loop.
  100. *
  101. * @param Zend_Controller_Request_Abstract $request
  102. * @return void
  103. */
  104. public function dispatchLoopStartup(Zend_Controller_Request_Abstract $request)
  105. {}
  106. /**
  107. * Called before an action is dispatched by Zend_Controller_Dispatcher.
  108. *
  109. * This callback allows for proxy or filter behavior. By altering the
  110. * request and resetting its dispatched flag (via
  111. * {@link Zend_Controller_Request_Abstract::setDispatched() setDispatched(false)}),
  112. * the current action may be skipped.
  113. *
  114. * @param Zend_Controller_Request_Abstract $request
  115. * @return void
  116. */
  117. public function preDispatch(Zend_Controller_Request_Abstract $request)
  118. {}
  119. /**
  120. * Called after an action is dispatched by Zend_Controller_Dispatcher.
  121. *
  122. * This callback allows for proxy or filter behavior. By altering the
  123. * request and resetting its dispatched flag (via
  124. * {@link Zend_Controller_Request_Abstract::setDispatched() setDispatched(false)}),
  125. * a new action may be specified for dispatching.
  126. *
  127. * @param Zend_Controller_Request_Abstract $request
  128. * @return void
  129. */
  130. public function postDispatch(Zend_Controller_Request_Abstract $request)
  131. {}
  132. /**
  133. * Called before Zend_Controller_Front exits its dispatch loop.
  134. *
  135. * @return void
  136. */
  137. public function dispatchLoopShutdown()
  138. {}
  139. }