File indexing completed on 2024-12-22 05:36:33

0001 <?php
0002 /**
0003  * Zend Framework
0004  *
0005  * LICENSE
0006  *
0007  * This source file is subject to the new BSD license that is bundled
0008  * with this package in the file LICENSE.txt.
0009  * It is also available through the world-wide-web at this URL:
0010  * http://framework.zend.com/license/new-bsd
0011  * If you did not receive a copy of the license and are unable to
0012  * obtain it through the world-wide-web, please send an email
0013  * to license@zend.com so we can send you a copy immediately.
0014  *
0015  * @category   Zend
0016  * @package    Zend_Controller
0017  * @subpackage Plugins
0018  * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
0019  * @license    http://framework.zend.com/license/new-bsd     New BSD License
0020  * @version    $Id$
0021  */
0022 
0023 /**
0024  * @category   Zend
0025  * @package    Zend_Controller
0026  * @subpackage Plugins
0027  * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
0028  * @license    http://framework.zend.com/license/new-bsd     New BSD License
0029  */
0030 abstract class Zend_Controller_Plugin_Abstract
0031 {
0032     /**
0033      * @var Zend_Controller_Request_Abstract
0034      */
0035     protected $_request;
0036 
0037     /**
0038      * @var Zend_Controller_Response_Abstract
0039      */
0040     protected $_response;
0041 
0042     /**
0043      * Set request object
0044      *
0045      * @param Zend_Controller_Request_Abstract $request
0046      * @return Zend_Controller_Plugin_Abstract
0047      */
0048     public function setRequest(Zend_Controller_Request_Abstract $request)
0049     {
0050         $this->_request = $request;
0051         return $this;
0052     }
0053 
0054     /**
0055      * Get request object
0056      *
0057      * @return Zend_Controller_Request_Abstract $request
0058      */
0059     public function getRequest()
0060     {
0061         return $this->_request;
0062     }
0063 
0064     /**
0065      * Set response object
0066      *
0067      * @param Zend_Controller_Response_Abstract $response
0068      * @return Zend_Controller_Plugin_Abstract
0069      */
0070     public function setResponse(Zend_Controller_Response_Abstract $response)
0071     {
0072         $this->_response = $response;
0073         return $this;
0074     }
0075 
0076     /**
0077      * Get response object
0078      *
0079      * @return Zend_Controller_Response_Abstract $response
0080      */
0081     public function getResponse()
0082     {
0083         return $this->_response;
0084     }
0085 
0086     /**
0087      * Called before Zend_Controller_Front begins evaluating the
0088      * request against its routes.
0089      *
0090      * @param Zend_Controller_Request_Abstract $request
0091      * @return void
0092      */
0093     public function routeStartup(Zend_Controller_Request_Abstract $request)
0094     {}
0095 
0096     /**
0097      * Called after Zend_Controller_Router exits.
0098      *
0099      * Called after Zend_Controller_Front exits from the router.
0100      *
0101      * @param  Zend_Controller_Request_Abstract $request
0102      * @return void
0103      */
0104     public function routeShutdown(Zend_Controller_Request_Abstract $request)
0105     {}
0106 
0107     /**
0108      * Called before Zend_Controller_Front enters its dispatch loop.
0109      *
0110      * @param  Zend_Controller_Request_Abstract $request
0111      * @return void
0112      */
0113     public function dispatchLoopStartup(Zend_Controller_Request_Abstract $request)
0114     {}
0115 
0116     /**
0117      * Called before an action is dispatched by Zend_Controller_Dispatcher.
0118      *
0119      * This callback allows for proxy or filter behavior.  By altering the
0120      * request and resetting its dispatched flag (via
0121      * {@link Zend_Controller_Request_Abstract::setDispatched() setDispatched(false)}),
0122      * the current action may be skipped.
0123      *
0124      * @param  Zend_Controller_Request_Abstract $request
0125      * @return void
0126      */
0127     public function preDispatch(Zend_Controller_Request_Abstract $request)
0128     {}
0129 
0130     /**
0131      * Called after an action is dispatched by Zend_Controller_Dispatcher.
0132      *
0133      * This callback allows for proxy or filter behavior. By altering the
0134      * request and resetting its dispatched flag (via
0135      * {@link Zend_Controller_Request_Abstract::setDispatched() setDispatched(false)}),
0136      * a new action may be specified for dispatching.
0137      *
0138      * @param  Zend_Controller_Request_Abstract $request
0139      * @return void
0140      */
0141     public function postDispatch(Zend_Controller_Request_Abstract $request)
0142     {}
0143 
0144     /**
0145      * Called before Zend_Controller_Front exits its dispatch loop.
0146      *
0147      * @return void
0148      */
0149     public function dispatchLoopShutdown()
0150     {}
0151 }