Create a gist now

Instantly share code, notes, and snippets.

Patch to Zend Framework 1.11.4 to add filename to exception description when TMX parsing fails
Index: library/Zend/Translate/Adapter/Tmx.php
--- library/Zend/Translate/Adapter/Tmx.php (revision 3015)
+++ library/Zend/Translate/Adapter/Tmx.php (working copy)
@@ -74,9 +74,10 @@
xml_set_character_data_handler($this->_file, "_contentElement");
if (!xml_parse($this->_file, file_get_contents($filename))) {
- $ex = sprintf('XML error: %s at line %d',
+ $ex = sprintf('XML error: %s at line %d of file %s',
- xml_get_current_line_number($this->_file));
+ xml_get_current_line_number($this->_file),
+ $filename);
require_once 'Zend/Translate/Exception.php';
throw new Zend_Translate_Exception($ex);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment