r24213 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r24212‎ | r24213 | r24214 >
Date:21:01, 17 July 2007
Author:brion
Status:old
Tags:
Comment:
cleanup:
* Expand explanation about missing PHP DOM module. Even though this is bundled in core by default, at least Fedora 6 puts it in a separate package which isn't enabled by default. Thanks, Fedora!
* Use full path to include refreshLinks.inc, fixes fancy include path issues
* wfImageDir() is gone in MW 1.11; for the moment, file updates are disabled when this condition is detected instead of just crashing. TODO: use the fancy new stuff in the updater
Modified paths:
  • /trunk/extensions/OAI/OAIHarvest.php (modified) (history)
  • /trunk/extensions/OAI/oaiUpdate.php (modified) (history)

Diff [purge]

Index: trunk/extensions/OAI/oaiUpdate.php
@@ -1,7 +1,16 @@
22 <?php
33
4 -if( !class_exists( 'DOMAttr' ) ) {
5 - die( 'Requires PHP 5 with the DOM module enabled...' );
 4+if( !class_exists( 'DOMAttrx' ) ) {
 5+ echo
 6+ "Requires PHP 5 with the DOM module enabled.\n" .
 7+ "\n" .
 8+ "Although enabled by default in most PHP configurations, this module\n" .
 9+ "is sometimes shipped in a separate package by Linux distributions.\n" .
 10+ "\n" .
 11+ "Fedora 6 users, please try:\n" .
 12+ " yum install php-xml\n" .
 13+ "\n";
 14+ exit( 1 );
615 }
716
817 $base = dirname( dirname( dirname( __FILE__ ) ) );
Index: trunk/extensions/OAI/OAIHarvest.php
@@ -39,7 +39,7 @@
4040
4141 # Need shared code...
4242 require_once( 'OAIFunctions.php' );
43 -require_once( 'maintenance/refreshLinks.inc' );
 43+require_once( "$IP/maintenance/refreshLinks.inc" );
4444
4545 global $oaiSourceRepository;
4646 global $oaiAgentExtra;
@@ -501,7 +501,14 @@
502502 }
503503
504504 # We assume the filename has already been validated by code above us.
505 - $filename = wfImageDir( $upload['filename'] ) . '/' . $upload['filename'];
 505+ if( function_exists( 'wfImageDir' ) ) {
 506+ // < 1.10
 507+ $filename = wfImageDir( $upload['filename'] ) . '/' . $upload['filename'];
 508+ } else {
 509+ // 1.11
 510+ echo "File updating temporarily broken on 1.11, sorry!\n";
 511+ return;
 512+ }
506513
507514 $timestamp = wfTimestamp( TS_UNIX, $this->getTimestamp( $upload['timestamp'] ) );
508515 if( file_exists( $filename )

Status & tagging log