r108995 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r108994‎ | r108995 | r108996 >
Date:19:07, 15 January 2012
Author:oren
Status:deferred
Tags:
Comment:
configuration faliure provides more information
Modified paths:
  • /trunk/lucene-search-2/src/org/wikimedia/lsearch/config/GlobalConfiguration.java (modified) (history)

Diff [purge]

Index: trunk/lucene-search-2/src/org/wikimedia/lsearch/config/GlobalConfiguration.java
@@ -564,15 +564,34 @@
565565 protected void initializeWmfSettings(String initset) {
566566 try {
567567 PHPParser parser = new PHPParser();
568 - String text = parser.readURL(new URL(initset));
 568+
 569+ URL InitialiseSettingsLocation = new URL(null,initset);
 570+
 571+ if(InitialiseSettingsLocation.getProtocol().equals("file"))
 572+ {
 573+ URL path = getClass().getClassLoader().getResource(".");
 574+ //System.out.println("running at "+ path);
 575+ System.out.println("looking for "+InitialiseSettingsLocation+" relative to path: "+ path);
 576+ ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
 577+ InitialiseSettingsLocation = classLoader.getResource(initset);
 578+ }else{
 579+ System.out.println("looking for InitialiseSettings.php at url "+ InitialiseSettingsLocation);
 580+ }
 581+
 582+ String text = parser.readURL(InitialiseSettingsLocation);
569583 wgLanguageCode = parser.getLanguages(text);
570584 wgServer = parser.getServer(text);
571585 wgDefaultSearch = parser.getDefaultSearch(text);
572586 wgNamespacesWithSubpages = parser.getNamespacesWithSubpages(text);
573587 wgContentNamespaces = parser.getContentNamespaces(text);
574588 Localization.readDBLocalizations(text);
575 - } catch (Exception e) {
 589+
 590+ } catch (MalformedURLException e) {
576591 System.out.println("Error reading InitialiseSettings.php from url "+initset+" : "+e.getMessage());
 592+ e.printStackTrace();
 593+ } catch (IOException e) {
 594+ System.out.println("Error reading InitialiseSettings.php from url "+initset+" : "+e.getMessage());
 595+ e.printStackTrace();
577596 }
578597 }
579598

Status & tagging log