All pastes #542247 Raw Edit

Untitled

public text v1 · immutable
·published 2007-06-05 19:36 UTC
rendered paste body
diff -ur mediawiki-1.9.0.orig/config/index.php mediawiki-1.9.0/config/index.php
--- mediawiki-1.9.0.orig/config/index.php       2007-01-10 22:38:12.000000000 +0
200
+++ mediawiki-1.9.0/config/index.php    2007-01-23 14:40:06.000000000 +0200
@@ -909,6 +909,14 @@
                        $article->updateRevisionOn( $wgDatabase, $revision );
                }
 
+               /* val@rpath: add includes from ./config.d */
+               $local .= "
+# include any extended configurations
+\$extConfigDir = \$IP.'/config.d/';
+\$files = glob(\$extConfigDir.'/*.php');
+if (is_array(\$files)) foreach (\$files as \$file) { @include_once(\$file); }
+";
+
                /* Write out the config file now that all is well */
                print "<li style=\"list-style: none\">\n";
                print "<p>Creating LocalSettings.php...</p>\n\n";
diff -Naur mediawiki-1.9.0.orig/includes/preg_ls.php mediawiki-1.9.0/includes/pr
eg_ls.php
--- mediawiki-1.9.0.orig/includes/preg_ls.php   1969-12-31 19:00:00.000000000 -0
500
+++ mediawiki-1.9.0/includes/preg_ls.php        2006-10-19 22:37:51.000000000 -0
400
@@ -0,0 +1,21 @@
+<?php
+
+function preg_ls ($path=".", $rec=false, $pat="/.*/") {
+   $pat=preg_replace ("|(/.*/[^S]*)|s", "\\1S", $pat);
+   while (substr ($path,-1,1) =="/") $path=substr ($path,0,-1);
+   if (!is_dir ($path) ) $path=dirname ($path);
+   if ($rec!==true) $rec=false;
+   $d=dir ($path);
+   $ret=Array ();
+   while (false!== ($e=$d->read () ) ) {
+       if ( ($e==".") || ($e=="..") ) continue;
+       if ($rec && is_dir ($path."/".$e) ) {
+           $ret=array_merge ($ret,preg_ls($path."/".$e,$rec,$pat));
+           continue;
+       }
+       if (!preg_match ($pat,$e) ) continue;
+       $ret[]=$path."/".$e;
+   }
+   return (empty ($ret) && preg_match ($pat,basename($path))) ? Array ($path."/
") : $ret;
+}
+?>