web/lib/Zend/Application/Resource/Frontcontroller.php
changeset 807 877f952ae2bd
parent 207 621fa6caec0c
child 1230 68c69c656a2c
equal deleted inserted replaced
805:5e7a0fedabdf 807:877f952ae2bd
    13  * to license@zend.com so we can send you a copy immediately.
    13  * to license@zend.com so we can send you a copy immediately.
    14  *
    14  *
    15  * @category   Zend
    15  * @category   Zend
    16  * @package    Zend_Application
    16  * @package    Zend_Application
    17  * @subpackage Resource
    17  * @subpackage Resource
    18  * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
    18  * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
    19  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    19  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    20  * @version    $Id: Frontcontroller.php 23378 2010-11-18 21:48:27Z bittarman $
    20  * @version    $Id: Frontcontroller.php 24798 2012-05-12 19:17:41Z adamlundrigan $
    21  */
    21  */
    22 
    22 
    23 /**
    23 /**
    24  * @see Zend_Application_Resource_ResourceAbstract
    24  * @see Zend_Application_Resource_ResourceAbstract
    25  */
    25  */
    30  * Front Controller resource
    30  * Front Controller resource
    31  *
    31  *
    32  * @category   Zend
    32  * @category   Zend
    33  * @package    Zend_Application
    33  * @package    Zend_Application
    34  * @subpackage Resource
    34  * @subpackage Resource
    35  * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
    35  * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
    36  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    36  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    37  */
    37  */
    38 class Zend_Application_Resource_Frontcontroller extends Zend_Application_Resource_ResourceAbstract
    38 class Zend_Application_Resource_Frontcontroller extends Zend_Application_Resource_ResourceAbstract
    39 {
    39 {
    40     /**
    40     /**
    99                     $front->setParams($value);
    99                     $front->setParams($value);
   100                     break;
   100                     break;
   101 
   101 
   102                 case 'plugins':
   102                 case 'plugins':
   103                     foreach ((array) $value as $pluginClass) {
   103                     foreach ((array) $value as $pluginClass) {
   104                     	$stackIndex = null;
   104                         $stackIndex = null;
   105                     	if(is_array($pluginClass)) {
   105                         if(is_array($pluginClass)) {
   106                     	    $pluginClass = array_change_key_case($pluginClass, CASE_LOWER);
   106                             $pluginClass = array_change_key_case($pluginClass, CASE_LOWER);
   107                             if(isset($pluginClass['class']))
   107                             if(isset($pluginClass['class']))
   108                             {
   108                             {
   109                                 if(isset($pluginClass['stackindex'])) {
   109                                 if(isset($pluginClass['stackindex'])) {
   110                                     $stackIndex = $pluginClass['stackindex'];
   110                                     $stackIndex = $pluginClass['stackindex'];
   111                                 }
   111                                 }
   133                             Zend_Controller_Action_HelperBroker::addPath($helperPath, $helperPrefix);
   133                             Zend_Controller_Action_HelperBroker::addPath($helperPath, $helperPrefix);
   134                         }
   134                         }
   135                     }
   135                     }
   136                     break;
   136                     break;
   137 
   137 
       
   138                 case 'dispatcher':
       
   139                     if(!isset($value['class'])) {
       
   140                         require_once 'Zend/Application/Exception.php';
       
   141                         throw new Zend_Application_Exception('You must specify both ');
       
   142                     }
       
   143                     if (!isset($value['params'])) {
       
   144                         $value['params'] = array();
       
   145                     }
       
   146                     
       
   147                     $dispatchClass = $value['class'];
       
   148                     if(!class_exists($dispatchClass)) {
       
   149                         require_once 'Zend/Application/Exception.php';
       
   150                         throw new Zend_Application_Exception('Dispatcher class not found!');
       
   151                     }
       
   152                     $front->setDispatcher(new $dispatchClass((array)$value['params']));
       
   153                     break;
   138                 default:
   154                 default:
   139                     $front->setParam($key, $value);
   155                     $front->setParam($key, $value);
   140                     break;
   156                     break;
   141             }
   157             }
   142         }
   158         }