On 9/17/05, Jamie Bliss astronouth7303@gmail.com wrote:
At this point, it sounds a little more intricate than can be easily discussed on a mailing list. If you can paste the code somewhere, maybe we (I) can help you.
It's not really intricate. Please follow the example, which uses two files and less than 15 lines of code.
(Using MediaWiki 1.5rc4) add
include('extensions/MyExtensions.php');
at the end of your LocalSettings.php. The file extensions/MyExtensions.php contains this:
<?php function __autoload($class_name) { require_once($class_name . '.php'); } SpecialPage::addPage(new UnlistedSpecialPage('MyTest')); ?>
and extensions/SpecialMyTest.php contains this:
<?php function wfSpecialMyTest() { global $wgOut; $wgOut->setPageTitle('My Test'); $wgOut->addHtml(''); } ?>
Loading MediaWiki produces a warning about undefined variables on SpecialPage.php. Now add this to extensions/MyExtensions.php:
require_once('SpecialPage.php');
*before* the call to SpecialPage::addPage(). Now MediaWiki loads without any warnings and runs just fine.
In MediaWiki 1.4.X, loading SpecialPage.php before the call was not needed. Why the difference?