Page MenuHomePhabricator
Authored By
• bzimport
Nov 21 2014, 9:52 PM
Size
3 KB
Referenced Files
None
Subscribers
None

diff.txt

--- config/index.php (r28641)
+++ config/index.php (new version)
@@ -700,6 +700,15 @@
$conf->Enotif = importRequest("Enotif", "enotif_allpages");
$conf->Eauthent = importRequest("Eauthent", "eauthent_enabled");
+/* load defaults for extensions */
+$extension_config = array();
+if(@file_exists("$IP/extensions/config.php")) {
+ require_once( "$IP/extensions/config.php" );
+}
+foreach($extension_config as $extension) {
+ $conf->$extension['name'] = importRequest($extension['name'], $extension['name'].'_disabled');
+}
+
if( $conf->posted && ( 0 == count( $errs ) ) ) {
do { /* So we can 'continue' to end prematurely */
$conf->Root = ($conf->RootPW != "");
@@ -1299,6 +1308,25 @@
</div>
+<?php if(count($extension_config) > 0) { ?>
+<h2>Extensions</h2>
+
+<?php foreach($extension_config as $extension) { ?>
+<div class="config-section">
+ <div class="config-input">
+ <label class='column'>The <?php echo $extension['label'] ?> extension:</label>
+ <ul class="plain">
+ <li><?php aField( $conf, $extension['name'], "Disabled", "radio", $extension['name']."_disabled" ); ?></li>
+ <li><?php aField( $conf, $extension['name'], "Enabled", "radio", $extension['name']."_enabled" ); ?></li>
+ </ul>
+ </div>
+ <div class="config-desc">
+ <p><?php echo $extension['description'] ?></p>
+ </div>
+</div>
+<?php } ?>
+<?php } ?>
+
<h2>Database config</h2>
<div class="config-section">
@@ -1529,6 +1557,23 @@
$enotifusertalk = 'false';
$enotifwatchlist = 'false';
}
+
+ $installextensions = array();
+ global $extension_config, $IP;
+ foreach($extension_config as $extension) {
+ if ( $conf->$extension['name'] == $extension['name'].'_enabled' ) {
+ if( @file_exists($IP.'/extensions/'.$extension['file']) ) {
+ print "<li>Installing " . $IP.'/extensions/'.$extension['file']."</li>\n";
+ $installextensions[$extension['name']] = "";
+ } else {
+ print "<li><strong>Warning:</strong> Skipping install for <tt>" . $IP.'/extensions/'.$extension['file']."</tt>. Extension not found.</li>\n";
+ $installextensions[$extension['name']] = "# Please download this extension from ".$extension['download']." and then uncomment the following line to enable it.\r\n#";
+ }
+ } else {
+ print "<li><strong>Warning:</strong> Skipping install for " . $IP.'/extensions/'.$extension['file']."</li>\n";
+ $installextensions[$extension['name']] = "#";
+ }
+ }
$file = @fopen( "/dev/urandom", "r" );
if ( $file ) {
@@ -1675,6 +1720,14 @@
\$wgCacheEpoch = max( \$wgCacheEpoch, gmdate( 'YmdHis', @filemtime( __FILE__ ) ) );
"; ## End of setting the $localsettings string
+ $localsettings .= "\r\n###################";
+ $localsettings .= "\r\n# Extensions: \r\n";
+ global $extension_config;
+ foreach($extension_config as $extension) {
+ $localsettings .= "\r\n" . $installextensions[$extension['name']]. 'require_once("$IP/extensions/'.$extension['file'].'");';
+ $localsettings .= "\r\n" . $extension['config'] . "\r\n";
+ }
+
// Keep things in Unix line endings internally;
// the system will write out as local text type.
return str_replace( "\r\n", "\n", $localsettings );

File Metadata

Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3728
Default Alt Text
diff.txt (3 KB)

Event Timeline