r34234 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r34233‎ | r34234 | r34235 >
Date:09:10, 5 May 2008
Author:dantman
Status:old
Tags:
Comment:
Tweaking Semantic MediaWiki maintenance scripts to use the MW_INSTALL_PATH environment variable.
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/RELEASE-NOTES (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/maintenance/README (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/maintenance/SMW_dumpRDF.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/maintenance/SMW_pingSemWeb.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/maintenance/SMW_refreshData.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/maintenance/SMW_setup.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/maintenance/SMW_unifyProperties.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/maintenance/SMW_unifyProperties.php
@@ -19,7 +19,9 @@
2020 * @author Denny Vrandecic
2121 */
2222
23 -require_once( 'commandLine.inc' );
 23+require_once ( getenv('MW_INSTALL_PATH') !== false
 24+ ? getenv('MW_INSTALL_PATH')."/maintenance/commandLine.inc"
 25+ : 'commandLine.inc' );
2426
2527 global $smwgIP;
2628 global $wgParser;
Index: trunk/extensions/SemanticMediaWiki/maintenance/SMW_refreshData.php
@@ -25,8 +25,9 @@
2626
2727 $optionsWithArgs = array( 'd', 's', 'e' ); // -d <delay>, -s <startid>
2828
29 -require_once('counter.php');
30 -require_once('commandLine.inc');
 29+$mwPath = getenv('MW_INSTALL_PATH') !== false ? getenv('MW_INSTALL_PATH').'/' : '';
 30+require_once("{$mwPath}counter.php");
 31+require_once("{$mwPath}commandLine.inc");
3132
3233 global $smwgIP;
3334 require_once($smwgIP . '/includes/SMW_Factbox.php');
Index: trunk/extensions/SemanticMediaWiki/maintenance/SMW_pingSemWeb.php
@@ -26,7 +26,9 @@
2727
2828 $optionsWithArgs = array( 'd', 's', 'e', 'h', 't' ); // -d <delay>, -s <startid>, -e <endid>
2929
30 -require_once( 'commandLine.inc' );
 30+require_once ( getenv('MW_INSTALL_PATH') !== false
 31+ ? getenv('MW_INSTALL_PATH')."/maintenance/commandLine.inc"
 32+ : 'commandLine.inc' );
3133
3234 global $smwgIP, $wgServer;
3335 include_once($smwgIP . '/includes/SMW_Infolink.php');
Index: trunk/extensions/SemanticMediaWiki/maintenance/SMW_setup.php
@@ -7,6 +7,7 @@
88 * migrating a lot of existing data.
99 *
1010 * Note: this file must be placed in MediaWiki's "maintenance" directory!
 11+ * or the MW_INSTALL_PATH environment variable must be set.
1112 *
1213 * Usage:
1314 * php SMW_refreshData.php [options...]
@@ -26,7 +27,9 @@
2728 */
2829
2930 $optionsWithArgs = array('user', 'password');
30 -require_once( 'commandLine.inc' );
 31+require_once ( getenv('MW_INSTALL_PATH') !== false
 32+ ? getenv('MW_INSTALL_PATH')."/maintenance/commandLine.inc"
 33+ : 'commandLine.inc' );
3134
3235 if( isset( $options['user'] ) ) {
3336 global $wgDBuser;
Index: trunk/extensions/SemanticMediaWiki/maintenance/README
@@ -1,9 +1,14 @@
22 == Semantic MediaWiki maintenance scripts ==
33
4 -Maintenance scripts must be placed within the "./maintenance" directory
5 -of your MediaWiki installation. In most cases, it is best to do this via
6 -a symbolic link, e.g.
 4+To run maintenance scripts it is recomended to set the environment
 5+variable MW_INSTALL_PATH to the root of your MediaWiki install.
 6+Then you may run them from their location here, or in the maintenance
 7+directory.
78
 9+Otherwise maintenance scripts must be placed within the "./maintenance"
 10+directory of your MediaWiki installation. In most cases, it is best to do
 11+this via a symbolic link, e.g.
 12+
813 % ln -s ./myMediaWiki/extensions/SemanticMediaWiki/maintenance/SMW_dumpRDF.php ./myMediaWiki/maintenance/SMW_dumpRDF.php
914
1015 Scripts can be run with a command line PHP call if your MediaWiki is
Index: trunk/extensions/SemanticMediaWiki/maintenance/SMW_dumpRDF.php
@@ -22,8 +22,11 @@
2323
2424 $optionsWithArgs = array( 'o', 'd', 'e' );
2525
26 -require_once( 'commandLine.inc' );
27 -require_once( "$IP/extensions/SemanticMediaWiki/specials/Export/SMW_SpecialOWLExport.php");
 26+require_once ( getenv('MW_INSTALL_PATH') !== false
 27+ ? getenv('MW_INSTALL_PATH')."/maintenance/commandLine.inc"
 28+ : 'commandLine.inc' );
 29+global $smwgIP;
 30+require_once( "$smwgIP/specials/Export/SMW_SpecialOWLExport.php");
2831
2932 if ( !empty( $options['o'] ) ) {
3033 $outfile = $options['o'];
Index: trunk/extensions/SemanticMediaWiki/RELEASE-NOTES
@@ -7,6 +7,7 @@
88 * Bugfix for Special:SearchByProperty (form-based serach failed)
99 * Minor bugfixes for RSS generation
1010 * Bugfix for Special_Ask in MediaWiki 1.11 with template formatting
 11+* Maintenance scripts now accept the MW_INSTALL_PATH environment variable
1112
1213 == Semantic MediaWiki 1.1 ==
1314

Status & tagging log