Archives Posts
mediawiki run php code
October 19th, 2007 by tom
you can run php code in mediawiki using the runphp extension.
you can get it here
i used it to display some database content. but it did only update after re-saving the article.
you need to disable caching in mediawiki:
$wgMainCacheType = CACHE_NONE; $wgMessageCacheType = CACHE_NONE; $wgParserCacheType = CACHE_NONE; $wgCachePages = false;
(taken from: here)
when accessing a database:
- do not use $handle
- do not use select_db() just use absolute database and table names, like “select * from databasename.tablename”
other problems:
- include the runphp file AT THE END OF localsettings.php, not at the beginning……..
- runphp only executes php from protected (sysop only) pages!