Localization update for he and fixing comment in en.
[lhc/web/wiklou.git] / maintenance / backupPrefetch.inc
index f5645c1..512af1c 100644 (file)
@@ -1,5 +1,43 @@
 <?php
 
+// Some smart guy removed XMLReader's global constants from PHP 5.1
+// and replaced them with class constants. Breaking source compatibility
+// is SUPER awesome, and I love languages which do this constantly!
+$xmlReaderConstants = array(
+       "NONE",
+       "ELEMENT",
+       "ATTRIBUTE", 
+       "TEXT",
+       "CDATA",
+       "ENTITY_REF",
+       "ENTITY",
+       "PI",
+       "COMMENT",
+       "DOC",
+       "DOC_TYPE",
+       "DOC_FRAGMENT",
+       "NOTATION",
+       "WHITESPACE",
+       "SIGNIFICANT_WHITESPACE",
+       "END_ELEMENT",
+       "END_ENTITY",
+       "XML_DECLARATION",
+       "LOADDTD",
+       "DEFAULTATTRS",
+       "VALIDATE",
+       "SUBST_ENTITIES" );
+foreach( $xmlReaderConstants as $name ) {
+       $fullName = "XMLREADER_$name";
+       $newName = "XMLReader::$name";
+       if( !defined( $fullName ) ) {
+               if( defined( $newName ) ) {
+                       define( $fullName, constant( $newName ) );
+               } else {
+                       // broken or missing the extension...
+               }
+       }
+}
+
 /**
  * Readahead helper for making large MediaWiki data dumps;
  * reads in a previous XML dump to sequentially prefetch text
@@ -14,6 +52,7 @@
  *   recorded, so the previous dump is a reliable source
  *
  * Requires PHP 5 and the XMLReader PECL extension.
+ * @ingroup Maintenance
  */
 class BaseDump {
        var $reader = null;
@@ -161,5 +200,3 @@ class BaseDump {
                return null;
        }
 }
-
-?>