Changeset 139 for branches

Show
Ignore:
Timestamp:
07/09/08 15:56:26 (5 months ago)
Author:
mikey
Message:

bugfix: throw exception if opening of xml files fails

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/PRE_NAMESPACES/XJConf/DefinitionParser.php

    r131 r139  
    1616                   'definitions::TagDefinition', 
    1717                   'definitions::handler::DefinitionHandlerFactory', 
    18                    'exceptions::InvalidNamespaceDefinitionException' 
     18                   'exceptions::InvalidNamespaceDefinitionException', 
     19                   'exceptions::XJConfException' 
    1920); 
    2021/** 
     
    188189    { 
    189190        $this->initParser(); 
    190         $this->reader->open($filename); 
     191        if (@$this->reader->open($filename) === false) { 
     192            throw new XJConfException('Can not open file ' . $filename); 
     193        } 
     194         
    191195        while ($this->reader->read()) { 
    192196            switch ($this->reader->nodeType) { 
  • branches/PRE_NAMESPACES/XJConf/XmlParser.php

    r137 r139  
    1111                   'definitions::NamespaceDefinitions', 
    1212                   'exceptions::UnknownNamespaceException', 
    13                    'exceptions::UnknownTagException' 
     13                   'exceptions::UnknownTagException', 
     14                   'exceptions::XJConfException' 
    1415); 
    1516/** 
     
    137138     * parses a given file and creates the data structure described in this file 
    138139     * 
    139      * @param  string  $filename 
     140     * @param   string  $filename 
     141     * @throws  XJConfException 
    140142     */ 
    141143    public function parse($filename) 
     
    143145        $reader = $this->initParser(); 
    144146        array_push($this->openFiles, $filename); 
    145         $reader->open($filename); 
     147        if (@$reader->open($filename) === false) { 
     148            throw new XJConfException('Can not open file ' . $filename); 
     149        } 
     150         
    146151        while ($reader->read()) { 
    147152            switch ($reader->nodeType) { 
  • branches/PRE_NAMESPACES/build.php

    r131 r139  
    1717$starArchive->addMetaData('version', '0.3.0dev'); 
    1818$starArchive->addMetaData('author', 'XJConf Development Team <http://php.xjconf.net>'); 
    19 $starArchive->addMetaData('copyright', '© 2007-2008 XJConf Development Team'); 
     19$starArchive->addMetaData('copyright', '(c) 2007-2008 XJConf Development Team'); 
    2020$starArchive->create(); 
    2121?> 
  • branches/PRE_NAMESPACES/package.php

    r137 r139  
    4646- added support for octal numbers (mikey) 
    4747- added XmlParser::clearConfigValues() (mikey) 
     48- bugfix: throw exception if opening of xml files fails (mikey) 
    4849EOT; 
    4950