Index: trunk/lucene-search-2/src/org/wikimedia/lsearch/config/GlobalConfiguration.java |
— | — | @@ -564,15 +564,34 @@ |
565 | 565 | protected void initializeWmfSettings(String initset) { |
566 | 566 | try { |
567 | 567 | 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); |
569 | 583 | wgLanguageCode = parser.getLanguages(text); |
570 | 584 | wgServer = parser.getServer(text); |
571 | 585 | wgDefaultSearch = parser.getDefaultSearch(text); |
572 | 586 | wgNamespacesWithSubpages = parser.getNamespacesWithSubpages(text); |
573 | 587 | wgContentNamespaces = parser.getContentNamespaces(text); |
574 | 588 | Localization.readDBLocalizations(text); |
575 | | - } catch (Exception e) { |
| 589 | + |
| 590 | + } catch (MalformedURLException e) { |
576 | 591 | 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(); |
577 | 596 | } |
578 | 597 | } |
579 | 598 | |