r48539 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r48538‎ | r48539 | r48540 >
Date:21:22, 18 March 2009
Author:rainman
Status:deferred
Tags:
Comment:
Make sure we tell the user when invalid directory is supplied, instead of spewing out all kinds of strange errors.
Modified paths:
  • /branches/lucene-search-2.1/src/org/wikimedia/lsearch/util/Configure.java (modified) (history)

Diff [purge]

Index: branches/lucene-search-2.1/src/org/wikimedia/lsearch/util/Configure.java
@@ -1,6 +1,7 @@
22 package org.wikimedia.lsearch.util;
33
44 import java.io.BufferedReader;
 5+import java.io.File;
56 import java.io.FileInputStream;
67 import java.io.FileNotFoundException;
78 import java.io.FileOutputStream;
@@ -39,6 +40,12 @@
4041 if(mediawiki.endsWith(System.getProperty("file.separator")))
4142 mediawiki = mediawiki.substring(0,mediawiki.length()-1);
4243
 44+ if( ! new File(mediawiki+"/LocalSettings.php").exists() ){
 45+ System.out.println("ERROR: "+mediawiki+" does not appear to contain a MediaWiki installation. ");
 46+ System.out.println("Please give full path to root directory (where LocaliseSettings.php is) of your MediWiki installation. ");
 47+ return;
 48+ }
 49+
4350 String dbname = getVariable(mediawiki,"wgDBname");
4451 String scriptPath = getVariable(mediawiki,"wgScriptPath");
4552 String server = getVariable(mediawiki,"wgServer");

Status & tagging log