http://www.mediawiki.org/wiki/Special:Code/MediaWiki/56207
Revision: 56207
Author: brion
Date: 2009-09-11 21:01:50 +0000 (Fri, 11 Sep 2009)
Log Message:
-----------
Merge r53263 from wmf-deployment: Rearranging some paths so the output file
goes into $IP/cache by default, rather than mixing in with the extensions
checkout.
Modified Paths:
--------------
trunk/extensions/TrustedXFF/TrustedXFF.php
trunk/extensions/TrustedXFF/generate.php
trunk/extensions/TrustedXFF/update
Property Changed:
----------------
trunk/extensions/TrustedXFF/
trunk/extensions/TrustedXFF/trusted-hosts.txt
Property changes on: trunk/extensions/TrustedXFF
___________________________________________________________________
Added: svn:mergeinfo
+ /branches/wmf-deployment/extensions/TrustedXFF:53263
Modified: trunk/extensions/TrustedXFF/TrustedXFF.php
===================================================================
--- trunk/extensions/TrustedXFF/TrustedXFF.php 2009-09-11 20:37:30 UTC (rev
56206)
+++ trunk/extensions/TrustedXFF/TrustedXFF.php 2009-09-11 21:01:50 UTC (rev
56207)
@@ -1,5 +1,9 @@
<?php
+if (!defined('MEDIAWIKI')) {
+ die(1);
+}
+
/**
* Trusted hosts file in CDB format.
* The file can be generated using generate.php
@@ -10,7 +14,7 @@
*
* For details, see http://meta.wikimedia.org/wiki/XFF_project
*/
-$wgTrustedXffFile = dirname(__FILE__).'/trusted-xff.cdb';
+$wgTrustedXffFile = $IP . '/cache/trusted-xff.cdb';
/** Registration */
Modified: trunk/extensions/TrustedXFF/generate.php
===================================================================
--- trunk/extensions/TrustedXFF/generate.php 2009-09-11 20:37:30 UTC (rev
56206)
+++ trunk/extensions/TrustedXFF/generate.php 2009-09-11 21:01:50 UTC (rev
56207)
@@ -12,7 +12,16 @@
echo "Unable to open input file \"trusted-xff.txt\"\n";
exit( 1 );
}
-$outFile = dba_open( 'trusted-xff.cdb', 'n', 'cdb' );
+
+if( isset( $args[0] ) ) {
+ $target = realpath( $args[0] );
+} elseif( isset( $wgTrustedXffFile ) ) {
+ $target = $wgTrustedXffFile;
+} else {
+ echo "TrustedXffFile extension is not enabled. Specify target output
file on command line!\n";
+ exit( 1 );
+}
+$outFile = dba_open( $target, 'n', 'cdb' );
if ( !$outFile ) {
echo "Unable open output file \"trusted-xff.cdb\"\n";
exit( 1 );
Property changes on: trunk/extensions/TrustedXFF/trusted-hosts.txt
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/wmf-deployment/extensions/TrustedXFF/trusted-hosts.txt:55331
+
/branches/wmf-deployment/extensions/TrustedXFF/trusted-hosts.txt:53263,55331
Modified: trunk/extensions/TrustedXFF/update
===================================================================
--- trunk/extensions/TrustedXFF/update 2009-09-11 20:37:30 UTC (rev 56206)
+++ trunk/extensions/TrustedXFF/update 2009-09-11 21:01:50 UTC (rev 56207)
@@ -1,8 +1,8 @@
#!/bin/bash
cd `dirname $0`
-php generate.php
-bzip2 -kf trusted-xff.cdb
+php generate.php aawiki ../../cache/trusted-xff.cdb
+bzip2 -kf ../../cache/trusted-xff.cdb
if [ -x /home/wikipedia/bin/sync-common-file ]; then
- sync-common-file php-1.5/extensions/TrustedXFF/trusted-xff.cdb
+ sync-common-file wmf-deployment/cache/trusted-xff.cdb
fi
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs