protected function includeFile($fileName)
    {
        $extension = pathinfo($fileName, PATHINFO_EXTENSION);

        if (! $extension) {
            $extension = $this->findExtension($fileName, array('inc', 'ini', 'php', 'xml'));
            $fileName .= '.' . $extension;
        }

        if (file_exists($fileName)) {
            switch ($extension) {
                case 'ini':
                    $config = new \Zend_Config_Ini($fileName, APPLICATION_ENV);
                    break;

                case 'xml':
                    $config = new \Zend_Config_Xml($fileName, APPLICATION_ENV);
                    break;

                case 'php':
                case 'inc':
                    // Exclude all variables not needed
                    unset($extension);

                    // All variables from this Escort file can be changed in the include file.
                    return include($fileName);
                    break;

                default:
                    throw new \Zend_Application_Exception(
                            'Invalid configuration file provided; unknown config type ' . $extension
                            );

            }

            return $config->toArray();
        }

        // If the file does not exists it is up to the calling function to do something about it.
        return false;
    }
protected function includeFile($fileName)
    {
        $extension = pathinfo($fileName, PATHINFO_EXTENSION);

        if (! $extension) {
            $extension = $this->findExtension($fileName, array('inc', 'ini', 'php', 'xml'));
            $fileName .= '.' . $extension;
        }

        if (file_exists($fileName)) {
            switch ($extension) {
                case 'ini':
                    $config = new \Zend_Config_Ini($fileName, APPLICATION_ENV);
                    break;

                case 'xml':
                    $config = new \Zend_Config_Xml($fileName, APPLICATION_ENV);
                    break;

                case 'php':
                case 'inc':
                    // Exclude all variables not needed
                    unset($extension);

                    // All variables from this Escort file can be changed in the include file.
                    return include($fileName);
                    break;

                default:
                    throw new \Zend_Application_Exception(
                            'Invalid configuration file provided; unknown config type ' . $extension
                            );

            }

            return $config->toArray();
        }

        // If the file does not exists it is up to the calling function to do something about it.
        return false;
    }
protected function includeFile ( $ fileName ) { $ extension = pathinfo ( $ fileName , PATHINFO_EXTENSION ) ; if ( ! $ extension ) { $ extension = $ this -> findExtension ( $ fileName , array ( 'inc' , 'ini' , 'php' , 'xml' ) ) ; $ fileName .= '.' . $ extension ; } if ( file_exists ( $ fileName ) ) { switch ( $ extension ) { case 'ini' : $ config = new \ Zend_Config_Ini ( $ fileName , APPLICATION_ENV ) ; break ; case 'xml' : $ config = new \ Zend_Config_Xml ( $ fileName , APPLICATION_ENV ) ; break ; case 'php' : case 'inc' : // Exclude all variables not needed unset ( $ extension ) ; // All variables from this Escort file can be changed in the include file. return include ( $ fileName ) ; break ; default : throw new \ Zend_Application_Exception ( 'Invalid configuration file provided; unknown config type ' . $ extension ) ; } return $ config -> toArray ( ) ; } // If the file does not exists it is up to the calling function to do something about it. return false ; }
Searches and loads ini, xml, php or inc file

When no extension is specified the system looks for a file with the right extension,
in the order: .ini, .php, .xml, .inc.

.php and .inc files run within the context of this object and thus can access all
$this-> variables and functions.

@param string $fileName A filename in the include path
@return mixed false if nothing was returned
Searches and loads ini xml php or inc file