Last modified: 2007-01-08 19:29:10 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 8454 - use mediawiki-parser independent of database-server
use mediawiki-parser independent of database-server
Status: RESOLVED INVALID
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
1.9.x
PC Linux
: Normal enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-01-01 21:18 UTC by Felix Natter
Modified: 2007-01-08 19:29 UTC (History)
0 users

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
proposed patch for "noDBmode" (2.27 KB, patch)
2007-01-01 21:26 UTC, Felix Natter
Details

Description Felix Natter 2007-01-01 21:18:20 UTC
I'd like to submit a patch which would allow to use the mediawiki-Parser
independent from a database-server.

We're developing a wikipedia-offline-reader (http://woc.fslab.de) and we need
the mediawiki-parser to generate the installation-package.
If we could integrate a small patch (essentially a few special cases with a
global variable $wgNoDBMode), then this would make it significantly easier to
use our generation-tools.
Comment 1 Felix Natter 2007-01-01 21:19:14 UTC
diff -ru mediawiki_svn/includes/Parser.php mediawiki_sa2/includes/Parser.php
--- mediawiki_svn/includes/Parser.php	2007-01-01 20:14:56.000000000 +0100
+++ mediawiki_sa2/includes/Parser.php	2007-01-01 20:21:23.000000000 +0100
@@ -4011,6 +4011,11 @@
 					$query .= $dbr->addQuotes( $this->mLinkHolders['dbkeys'][$key] );
 				}
 			}
+
+			// support wgNoDBMode
+			if ( !empty($GLOBALS['wgNoDBMode']) )
+				$query = 0;
+
 			if ( $query ) {
 				$query .= '))';
 				if ( $options & RLH_FOR_UPDATE ) {
diff -ru mediawiki_svn/includes/Setup.php mediawiki_sa2/includes/Setup.php
--- mediawiki_svn/includes/Setup.php	2007-01-01 20:14:56.000000000 +0100
+++ mediawiki_sa2/includes/Setup.php	2007-01-01 20:29:03.000000000 +0100
@@ -49,7 +49,8 @@
 
 $wgIP = false; # Load on demand
 # Can't stub this one, it sets up $_GET and $_REQUEST in its constructor
-$wgRequest = new WebRequest;
+if ( empty($GLOBALS['wgNoDBMode']) ) # support wgNoDBMode
+	$wgRequest = new WebRequest;
 if ( function_exists( 'posix_uname' ) ) {
 	$wguname = posix_uname();
 	$wgNodeName = $wguname['nodename'];
diff -ru mediawiki_svn/includes/StubObject.php mediawiki_sa2/includes/StubObject.php
--- mediawiki_svn/includes/StubObject.php	2007-01-01 20:14:56.000000000 +0100
+++ mediawiki_sa2/includes/StubObject.php	2007-01-01 20:41:25.000000000 +0100
@@ -89,7 +89,9 @@
 
 	function _newObject() {
 		global $wgContLanguageCode, $wgRequest, $wgUser, $wgContLang;
-		$code = $wgRequest->getVal('uselang', $wgUser->getOption('language') );
+		// supprt wgNoDBMode
+		if ( empty($GLOBALS['wgNoDBMode']) )
+			$code = $wgRequest->getVal('uselang', $wgUser->getOption('language') );
 
 		// if variant is explicitely selected, use it instead the one from wgUser
 		// see bug #7605
diff -ru mediawiki_svn/includes/Title.php mediawiki_sa2/includes/Title.php
--- mediawiki_svn/includes/Title.php	2007-01-01 20:14:56.000000000 +0100
+++ mediawiki_sa2/includes/Title.php	2007-01-01 21:06:24.000000000 +0100
@@ -917,7 +917,7 @@
 			
 			// FIXME: this causes breakage in various places when we
 			// actually expected a local URL and end up with dupe prefixes.
-			if ($wgRequest->getVal('action') == 'render') {
+			if (empty($GLOBALS['wgNoDBMode']) and $wgRequest->getVal('action') ==
'render') { # support wgNoDBMode
 				$url = $wgServer . $url;
 			}
 		}
Comment 2 Felix Natter 2007-01-01 21:26:21 UTC
Created attachment 2998 [details]
proposed patch for "noDBmode"

This is exactly the patch I just posted as a comment. Sorry, I didn't know
about
the "attachment" feature ;-)
Comment 3 Rob Church 2007-01-01 21:28:14 UTC
Ultimately, I don't think this is something we'd ever want to support in the
core code. If you're only using a MediaWiki installation to generate the parsed
content, then you could maintain the hack locally.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links