web/lib/Zend/Application.php
changeset 807 877f952ae2bd
parent 207 621fa6caec0c
child 1230 68c69c656a2c
equal deleted inserted replaced
805:5e7a0fedabdf 807:877f952ae2bd
    12  * obtain it through the world-wide-web, please send an email
    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.
    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  * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
    17  * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
    18  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    18  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    19  * @version    $Id: Application.php 23163 2010-10-19 16:30:26Z matthew $
    19  * @version    $Id: Application.php 25024 2012-07-30 15:08:15Z rob $
    20  */
    20  */
    21 
    21 
    22 /**
    22 /**
    23  * @category   Zend
    23  * @category   Zend
    24  * @package    Zend_Application
    24  * @package    Zend_Application
    25  * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
    25  * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
    26  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    26  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    27  */
    27  */
    28 class Zend_Application
    28 class Zend_Application
    29 {
    29 {
    30     /**
    30     /**
   374      * @return array
   374      * @return array
   375      */
   375      */
   376     protected function _loadConfig($file)
   376     protected function _loadConfig($file)
   377     {
   377     {
   378         $environment = $this->getEnvironment();
   378         $environment = $this->getEnvironment();
   379         $suffix      = strtolower(pathinfo($file, PATHINFO_EXTENSION));
   379         $suffix      = pathinfo($file, PATHINFO_EXTENSION);
   380 
   380         $suffix      = ($suffix === 'dist')
   381         switch ($suffix) {
   381                      ? pathinfo(basename($file, ".$suffix"), PATHINFO_EXTENSION)
       
   382                      : $suffix;
       
   383 
       
   384         switch (strtolower($suffix)) {
   382             case 'ini':
   385             case 'ini':
   383                 $config = new Zend_Config_Ini($file, $environment);
   386                 $config = new Zend_Config_Ini($file, $environment);
   384                 break;
   387                 break;
   385 
   388 
   386             case 'xml':
   389             case 'xml':
   390             case 'json':
   393             case 'json':
   391                 $config = new Zend_Config_Json($file, $environment);
   394                 $config = new Zend_Config_Json($file, $environment);
   392                 break;
   395                 break;
   393 
   396 
   394             case 'yaml':
   397             case 'yaml':
       
   398             case 'yml':
   395                 $config = new Zend_Config_Yaml($file, $environment);
   399                 $config = new Zend_Config_Yaml($file, $environment);
   396                 break;
   400                 break;
   397 
   401 
   398             case 'php':
   402             case 'php':
   399             case 'inc':
   403             case 'inc':