Beispiel #1
0
 /**
  * (non-PHPdoc)
  * @see Tudu_Model_ResourceManager_Abstract::hasResource()
  */
 public function hasResource($name)
 {
     $bool = $this->_bootstrap->hasResource($name);
     if (!$bool) {
         try {
             $this->_bootstrap->bootstrap($name);
             $bool = true;
         } catch (Zend_Application_Bootstrap_Exception $e) {
             return false;
         }
     }
     return $bool;
 }
 /**
  * Load the configuration file that define the configurations of the module
  * and return the content into an array.
  * INI is the expected file format.
  *
  * @param string $relativePath Relative path from module root to the directory
  *                             where the configuraton file is locatedfrom module
  *                             root directory
  * @param string $fileName The filename of the configuration file
  * @param string $section  The section of the file to load
  * @return null|array
  */
 protected function _loadModuleConfigurationsFile($relativePath, $fileName, $section)
 {
     $moduleDir = $this->getFrontController()->getModuleDirectory($this->getRequest()->getModuleName());
     try {
         $configFile = new \Zend_Config_Ini($moduleDir . DIRECTORY_SEPARATOR . $relativePath . DIRECTORY_SEPARATOR . $fileName, $section);
     } catch (\Zend_Config_Exception $e) {
         if ($this->_bootstrap->hasResource('log')) {
             $logger = $this->_bootstrap->getResource('log');
             $logger->notice('Imposible to load module configuration file ; exception message: ' . $e->getMessage());
         }
         return null;
     }
     return count($configFile) == 0 ? null : $configFile->toArray();
 }