コード例 #1
0
ファイル: Config.php プロジェクト: srinathweb/MTool
 /**
  * Load config
  * @param string $filepath
  */
 public function __construct($filepath)
 {
     libxml_use_internal_errors(true);
     if (!Mtool_Codegen_Filesystem::exists($filepath)) {
         throw new Mtool_Codegen_Exception_Config("Config file does not exist: {$filepath}");
     }
     $this->_xml = simplexml_load_file($filepath);
     if ($this->_xml === false) {
         $message = "Cannot load config file: {$filepath}";
         foreach (libxml_get_errors() as $_error) {
             $message .= "; {$_error->message}";
         }
         throw new Mtool_Codegen_Exception_Config($message);
     }
     $this->_path = $filepath;
 }
コード例 #2
0
ファイル: Module.php プロジェクト: srinathweb/MTool
 /**
  * Check if module exists
  * @return boolean
  */
 public function exists()
 {
     // Decide by existance of config.xml file
     return Mtool_Codegen_Filesystem::exists($this->_moduleConfigsDir . DIRECTORY_SEPARATOR . 'config.xml');
 }