[Mediawiki-l] built new extension-cache trouble problem

Erik Mermagen mermagen at earthlink.net
Sat May 13 17:22:45 UTC 2006


I created a new extension. You can see it implemented and not working  
here:
http://wikimoto.org/wikimoto/index.php?title=Test

a working version of it OUTSIDE the wiki is here:
http://wikimoto.org/test_bin/styleTests3.php

It needs to be run everytime the button is hit but I only get the  
cached page in the wiki.
I'm running version 1.5.8 and http://meta.wikimedia.org/wiki/ 
MediaWiki_extensions_FAQ suggests that I should include

$parser->disableCache();
  in my hook function.

The suggestion on that same page for version 1.4 suggests other  
options that also don't work. Such as:

  $ts = mktime();
$now = gmdate("YmdHis", $ts + 120);
$ns = $wgTitle->getNamespace();
$ti = wfStrencode($wgTitle->getDBkey());
$sql = "UPDATE cur SET cur_touched='$now' WHERE cur_namespace=$ns AND  
cur_title='$ti'";
wfQuery($sql, DB_WRITE, "");

This results in

Fatal error: Call to a member function on a non-object in /home/httpd/ 
vhosts/wikimoto.org/httpdocs/wikimoto/extensions/donation4email.php  
on line 71

If I back up even further and attempt to utilize

$wgParser->disableCache();
global $wgTitle;
$dbw =& wfGetDB( DB_MASTER );
$dbw->update( 'cur', array( 'cur_touched' => $dbw->timestamp( time()  
+ 120 ) ),
     array(
         'cur_namespace' => $wgTitle->getNamespace(),
         'cur_title' => $wgTitle->getDBkey()
     ), 'wfEmailDonationExtension'
);

then I recieve the error message
A database query syntax error has occurred. This may indicate a bug  
in the software. The last attempted database query was:
(SQL query hidden)
from within function "wfEmailDonationExtension". MySQL returned error  
"1146: Table 'wiki254915KjkhKJH354.mw_cur' doesn't exist (localhost)".

the code for the extenstion is here (too many characters to post here)
[url]http://wikimoto.org/wikimoto/index.php? 
title=Mail_Donation&action=edit[/url]

I sure could use some help folks.
Thanks,
Erik



More information about the MediaWiki-l mailing list