/** * Returns the source structure file location, or the default. * * Please note that the default is the target location of the parser appended with the structure.xml filename. * This is because in a default situation the structure.xml is located in the target folder of the parser. * * @return string */ public function getSource() { $source = parent::getSource(); $source = $source === null ? trim(DocBlox_Core_Abstract::config()->parser->target) . '/structure.xml' : trim($source); if ($source == '' || $source == DIRECTORY_SEPARATOR) { throw new Zend_Console_Getopt_Exception('Either an empty path or root was given: ' . $source); } if (is_dir($source)) { throw new Zend_Console_Getopt_Exception('The given path "' . $source . '" is a folder; we expect the exact location of the structure file ' . '(i.e. data/output/structure.xml)'); } if (!is_readable($source)) { throw new Zend_Console_Getopt_Exception('The given path "' . $source . '" either does not exist or is not readable.'); } return realpath($source); }