Extension talk:StubManager

Redeclare Class
I get this error on mine Fatal error: Cannot redeclare class stubmanager in /home/mysite/public_html/extensions/StubManager/StubManager.php on line 9

PHP Warning: call_user_func_array
Get the following PHP warning:

PHP Warning: call_user_func_array [a href='function.call-user-func-array'>function.call-user-func-array]: First argument is expected to be a valid callback, 'StubManager' was given in /usr/share/mediwiki/includes/Hooks.php on line 113

Setup: MediaWiki 1.12.0, PHP 5.2.0-8+etch13 (cgi-fcgi), MySQL 5.0.32-Debian_7etch8

Leeds to: Spezial:Version aka Special:Version is not shown. StubManager installed for JSKitRating. JSKitRating seems to work O.K. (have another question, but will write it in Extension_talk:JSKitRating. Require-Statement for StubManager is done before JSKitRating in LocalSettings.php. Have commented out all other extensions in LocalSettings.php, but warning still remains.


 * I have the same error on MW 1.13.3 freshly installed on almost identical Debian Etch configuration. 83.29.113.74 22:55, 29 December 2008 (UTC)

(CLOSED)
I installed this and then got "Unable to add cookies, header already sent. LocalSettings.php. Line: 1

Any ideas why that would happen?
 * Paste your LocalSettings.php here and I'll have a look. Of course, leave out the sensitive information. Jean-Lou Dupont 20:36, 25 September 2007 (UTC)

Ok, I will gmail you instead if that's ok.
 * even better. Jean-Lou Dupont 21:07, 25 September 2007 (UTC)


 * So what causes this error? -- Joe Beaudoin Jr. 03:24, 14 October 2007 (UTC)
 * I never had any feedback on this one nor did I ever see that sort of error with all my experience with this extension. Jean-Lou Dupont 11:26, 14 October 2007 (UTC)

StubManager & ExtensionManager confilct (CLOSED)
I installed StubManager and ExtensionManager via pear and got this:

Fatal error: Cannot redeclare class ExtensionLoader in /usr/share/php/MediaWiki/ExtensionManager/ExtensionManager.php on line 31
 * Please check if the extension you used to configure ExtensionClass isn't available with StubManager. I do not plan to support both ExtensionClass anymore. Jean-Lou Dupont 21:11, 22 October 2007 (UTC)

Login Required?! (CLOSED)
After I installed StubManager via pear login required to all action (e.g. see Main_Page)
 * ? Jean-Lou Dupont 21:11, 22 October 2007 (UTC)

So what does this do? (CLOSED)
I am a new extensions developer. I couldn't understand what this extension did from reading the page, but I guessed at what I wanted it to do. I scanned the code briefly and it seems like it might do what I would like it to do.

Q1: Does this extension intercept calls to extension hooks so that not every extension has to be instantiated and loaded for each page?

Q2: What are its features?

Q3: What are its limitations? Brion.finlay 21:50, 11 November 2007 (UTC)
 * R1:yes
 * R2:I'll add some additional notes on the extension's page. In the meantime, why not scan the extensions that depend on this one? There are quite a few... why don't you use this page to see the dependencies?
 * R3:Infinite ;-)
 * Jean-Lou Dupont 22:04, 11 November 2007 (UTC)

Installation fails (CLOSED)
Installing Extension:StubManager with PEAR method (http://www.mediawiki.org/wiki/Extension:StubManager#PEAR) fails. Errors given:


 * Warning: require(MediaWiki/StubManager/StubManager.php) [function.require]: failed to open stream: No such file or directory in /var/www/mediawiki/w/LocalSettings.php on line 233


 * Fatal error: require [function.require]: Failed opening required 'MediaWiki/StubManager/StubManager.php' (include_path='.:/var/www/mediawiki/w:/var/www/mediawiki/w/includes:/var/www/mediawiki/w/languages') in /var/www/mediawiki/w/LocalSettings.php on line 233

Regards, --84.190.136.180 15:25, 14 January 2008 (UTC)
 * Please provide more details because StubManager is the foundation is most of my extensions and I always use PEAR to install it.
 * Jean-Lou Dupont 15:49, 14 January 2008 (UTC)

SVN download correction to 'require_once' setting for LocalSettings.php
When using the SVN download to install the StubManager extension there is one not so obvious directory name correction necessary.

First, the correct change to the LocalSettings.php file should be:

Secondly, downloading the compressed archive the file name is in the form StubManager-x.x.x.tgz which decompresses to the directory StubManager-x.x.x.

The directory needs to be renamed for the LocalSettings.php to find it.

Rename it:

or link it to StubManager:

Alternately, you could modify the directory name in the LocalSettings.php file: Posted by --AuroraCA 04:18, 10 March 2008 (UTC)
 * Thanks for the detailed notes. Jean-Lou Dupont 01:16, 11 March 2008 (UTC)
 * Has this been fixed? I attempted to fix it, which you changed back.
 * I guess this means that the folder SecureHTML-2.3.0, which is what is downloaded, should be changed to "SecureHTML" only, before it is uploaded.
 * I am sorry for my mistakes, I learn by being hands on. Your extension pages are the most complex to understand, I was only attempting to fix this.
 * I understand it must be frustrating to correct all my mistakes, that is the reason why I agreed to no longer edit your pages.Odessaukrain 16:21, 31 March 2008 (UTC)
 * Sorry - I mostly focused on the PEAR method of installation and I tend to forget details about the other options. Jean-Lou Dupont 16:32, 31 March 2008 (UTC)

I don't understand
Do I simply download and add this program to my extensions folder to get the HTML extension to work? Or is there programming involved? I am confused by the download instructions.

What is the short php code and what is the longer php code? Are either of these required to get this extension to work?

Can you please explain what the short php code and what is the longer php code is and whether it is required? Then I can rewrite the instructions for a lay audience with little or no programming experience, like myself. Odessaukrain 14:52, 31 March 2008 (UTC)
 * Please get up to speed with PEAR as it is (almost) the only way I support my extensions. Once this is done, I can happily entertain other questions. Thanks for your comprehension. Jean-Lou Dupont 15:23, 31 March 2008 (UTC)
 * It is rather frustrating to me, a new user, to feel like I am being dismissed several times when I ask simple questions. I am asking questions because I want your wonderful program to work on my mediawiki. While I learn how to add this extension to my mediawiki, I am attempting to help this extension page be clearer for not only users like me, but all users.  This way everyone benefits--I get the extension on my mediawiki, you have more user friendly instructions, and other users benefit from those instructions.
 * I know I have made mistakes because of my own ignorance. For that I apologize.
 * I am no longer editing your pages. I have spent a lot of time attempting to learn the complex terminology that is on this page.
 * There are two solutions presented on this page, a normal extension way, which most wikiusers use to install extensions, and the PEAR extension way.
 * I would like to know how to install this extension the normal extension way. That is why I asked the above question. Can you please take one minute and answer it?
 * You didn't delete my new header, Create a stub for the short php code and longer php code section, so the header title is correct: this is simply an example of how to Create a stub, not part of the installation?
 * Thanks in advance. Odessaukrain 16:40, 31 March 2008 (UTC)
 * Sorry - I didn't see this question before!! You are correct: there is a section meant for ones that would like to build on StubManager for their own extensions whilst the rest of the page is meant for normal users. Jean-Lou Dupont 19:40, 3 August 2008 (UTC)

How can I test if this extension works
How can I test if this extension works?

Because if I install this required extension first and don't test it, and then install SecureHTML and have problems, I don't know how to tell which one is working improperly. Odessaukrain 14:59, 31 March 2008 (UTC)
 * No test available. This extension is just a helper for my other extensions. Sorry... maybe on some other release. You can always file a report on the site .Jean-Lou Dupont 15:21, 31 March 2008 (UTC)
 * Thanks. Why would I want to file a report when I can talk to the author of this incredible program here? I assume a report is a good thing. Odessaukrain 16:42, 31 March 2008 (UTC)
 * I found a way to see if this extension is on your mediawiki. Special:Version Odessaukrain 16:02, 3 August 2008 (UTC)

Possibly needs to be changed
Under Creating a stub 
 * Creating a Stub is meant for extension writers, not users of the extensions. Jean-Lou Dupont 17:35, 31 March 2008 (UTC)

The below needs to be moved above, into the Installation section.

Save StubManager.php in the extensions folder.

in  at the top, after the require line add:

Under: Examples

I am unsure how the citied "Examples" Email Log extension is an example of this extension, it simply connects to Email Log extension, which doesn't have an example. Is this an example of a program in which Stubs is a required program (what you term a "dependency"?
 * A dependency is any other piece of code which is required for the said extension to work. Jean-Lou Dupont 17:35, 31 March 2008 (UTC)

Maybe change the examples section to:
 * For an example of an extension which depends on this, see Extension:StubManager.

Extension:StubManager has a working link right now.

Or delete it?

Under: Installation  I think that the localsettings needs to be changed to:
 * require_once( "extensions/StubManager.php" );
 * The current version has no and uses ' ' not " "
 * Not critical, see . Jean-Lou Dupont 17:36, 31 March 2008 (UTC)

Under: Installation 2

You changed:
 * Download StubManager-1.2.0.tgz

to:
 * Download StubManager from



The problem is there are 21 links on http://mediawiki.googlecode.com/svn/tags/StubManager/, and newbie editors like me would wonder which version to download. I downloaded StubManager-1.2.0.tgz which appears to be the correct version. Is there another way to explain which version to download?

Maybe: or:
 * Download the newest version of StubManager [here].
 * with version linked to a tag in the version template. (I could do this if you like)

Odessaukrain 17:14, 31 March 2008 (UTC)
 * Ok for the dynamic link. Thanks. Jean-Lou Dupont 17:35, 31 March 2008 (UTC)

small styles bug
I've got a small styles bug in the version page (it's annoying) and i don't know enough php to look for an answer; it says: /* Jerone || */
 * Please file an issue on and I'll get it fixed, someday. Jean-Lou Dupont 17:44, 2 April 2008 (UTC)

Removed to talk
I removed the following section:

== Installation Note ==

Always make sure that the  statement preceeds any other require statement of dependent extensions in LocalSettings.php. Whilst StubManager will appear as installed in Special:Version, dependent extensions will be registered correctly with it.

Since it is already the first sentence in the installation section. If you think it is necessary Jean, please restore it. Odessaukrain 15:32, 3 August 2008 (UTC)

Error: Too many arguments in Stub->__call
Apparently there is a limit on number of arguments in the __call function. I've found this when I tried to create a parser function with many arguments.

return call_user_func_array(array($obj,$method),$args); replaces the switch statement that calls function with different number of arguments and fixes the problem.

Evgeny Fadeev 22:23, 28 September 2008 (UTC)
 * I need to uncomment the switch statement to make the extension work too.

createStub2 and edit page hook name
I think there may be a problem with createStub2 and edit page hook name. Let me explain. This is what I understand about the hook. You supply the hook name like so.

'hooks' => array( 'ParserAfterTidy' )

Then you create a stub function named similar to the hook name, but prepended with 'h'.

public function hParserAfterTidy( &$parser, &$text )

That works for all hooks, except that EditPage hooks have an entirely different naming convention.

'hooks' => array ('EditPage::showEditForm:fields'),

So what do I do now? What will the stub function name be?

-- Emceelam 19:40, 1 October 2008 (UTC)
 * Good point; of course you can always use the usual method of hooking up this one. Jean-Lou Dupont 01:42, 2 October 2008 (UTC)

Support for Mediawiki 1.13
I tried getting this to work with MW 1.13.2 and failed. Are there any plans to support it in the near future? Thanks. --Tosfos 19:02, 7 November 2008 (UTC)

I tried as well to install StubManager on MW 1.13.2 and did not see it installed on the Special:Version page. Please add an update for 1.13.2, I'm dying to try out some of your other extensions relying on this one. - Hyo-Son.

StubManager 1.3.2 & MediaWiki 1.13 & 1.16.0
I installed the latest StubManager 1.3.2, placed it into the extensions folder and added the required line above other lines depending on it ... but still the Special:Version does not list "StubManager". Could you verify 1.3.2 works under MW 1.13? -- Hyo-Son

I undergo same problem at MW 1.3.3... I installed and edit require statement, but did not view Speicial:Version and only viewing wihte page... -- chanwook
 * It showed errors when I open Special:Version page. Then I replaced:

public function hUpdateExtensionCredits( &$sp, &$ext ) { with: public static function hUpdateExtensionCredits( &$sp, &$ext ) { Now it is fine.

Hook StubManager failed to return a value
I am getting this error with StubManager running on MediaWiki 1.13.3 (in combination with the JSKitRating extension):

Detected bug in an extension! Hook StubManager failed to return a value; should return true to continue hook processing or false to abort. Backtrace:
 * 1) 0 /space/mediawiki-1.13.3/includes/specials/SpecialVersion.php(153): wfRunHooks('SpecialVersionE...', Array)
 * 2) 1 /space/mediawiki-1.13.3/includes/specials/SpecialVersion.php(38): SpecialVersion->extensionCredits
 * 3) 2 /space/mediawiki-1.13.3/includes/specials/SpecialVersion.php(18): SpecialVersion->execute
 * 4) 3 [internal function]: wfSpecialVersion(NULL, Object(SpecialPage))
 * 5) 4 /space/mediawiki-1.13.3/includes/SpecialPage.php(748): call_user_func('wfSpecialVersio...', NULL, Object(SpecialPage))
 * 6) 5 /space/mediawiki-1.13.3/includes/SpecialPage.php(534): SpecialPage->execute(NULL)
 * 7) 6 /space/mediawiki-1.13.3/includes/Wiki.php(224): SpecialPage::executePath(Object(Title))
 * 8) 7 /space/mediawiki-1.13.3/includes/Wiki.php(55): MediaWiki->initializeSpecialCases(Object(Title), Object(OutputPage), Object(WebRequest))
 * 9) 8 /space/mediawiki-1.13.3/index.php(93): MediaWiki->initialize(Object(Title), NULL, Object(OutputPage), Object(User), Object(WebRequest))
 * 10) 9 {main}

--Ccornell 10:54, 15 January 2009 (UTC)

I can confirm that I get the same error with mw 1.13.3 with Extension:PreloadManager. Also, I have noticed that if you put a 'return true;' in the first line of static function setupCreditsHook (line 316 of StubManager.php), the Special:Version page displays. It doesn't include details of extensions loaded via StubManager, but the display is relatively complete. See example at wikidoc.org --24.218.221.150 18:35, 2 February 2009 (UTC)

Stubmanager and Anywebsite extension
I've tried to install the Anywebsite extension (afther I installed the Stubmanager). And now I can see that my special pages are scrambled/corrupted. I'm using Mediawiki 1.13.2 on a Windows Server 2003 IIS environment. Is there a solution for this?

HNP Error?
Hi, I tried to install BizzWiki and just followed the instruction to install but I got the following errors HNP: action userrights not found in namespace dependant array. HNP: action userrights not found in namespace dependant array. HNP: action confirmaccount not found in namespace dependant array. HNP: action sysop not found in namespace dependant array. MediaWiki internal error. Original exception: exception 'MWException' with message 'Detected bug in an extension! Hook fnPageSecurityBeforePageDisplayHook failed to return a value; should return true to continue hook processing or false to abort.' in D:\Work\Projects_Web\BCD\wiki\includes\Hooks.php:137 Stack trace: #0 D:\Work\Projects_Web\BCD\wiki\includes\OutputPage.php(942): wfRunHooks #1 D:\Work\Projects_Web\BCD\wiki\includes\Wiki.php(150): OutputPage->output('BeforePageDispl...', Array) #2 D:\Work\Projects_Web\BCD\wiki\includes\Wiki.php(55): MediaWiki->preliminaryChecks #3 D:\Work\Projects_Web\BCD\wiki\index.php(114): MediaWiki->initialize(Object(Title), Object(OutputPage), Object(WebRequest)) #4 {main} Exception caught inside exception handler: exception 'MWException' with message 'Detected bug in an extension! Hook fnPageSecurityBeforePageDisplayHook failed to return a value; should return true to continue hook processing or false to abort.' in D:\Work\Projects_Web\BCD\wiki\includes\Hooks.php:137 Stack trace: #0 D:\Work\Projects_Web\BCD\wiki\includes\OutputPage.php(942): wfRunHooks #1 D:\Work\Projects_Web\BCD\wiki\includes\Exception.php(159): OutputPage->output('BeforePageDispl...', Array) #2 D:\Work\Projects_Web\BCD\wiki\includes\Exception.php(183): MWException->reportHTML #3 D:\Work\Projects_Web\BCD\wiki\includes\Exception.php(269): MWException->report #4 D:\Work\Projects_Web\BCD\wiki\includes\Exception.php(327): wfReportException #5 [internal function]: wfExceptionHandler #6 {main}

Any ideas?

Error with antibot
Running 1.16WMF (Because I can) and I get this lovely error "Fatal error: Cannot redeclare class AntiBot_GenericFormEncoding in ***\extensions\AntiBot\active\GenericFormEncoding.php on line 13", any suggestions? Rgoodermote 01:44, 5 August 2009 (UTC)

Warning with non static hUpdateExtensionCredits function
Installing the geshi extension I was getting a strinct warning that hUpdateExtensionCredits should be static if it is getting added to the global hook manager which seems to make some sense to me:

Strict Standards: call_user_func_array expects parameter 1 to be a valid callback, non-static method StubManager::hUpdateExtensionCredits should not be called statically in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\w\includes\Hooks.php on line 117

Changing the declaration on line 336 of StubManager.cpp fixes this error:

public static function hUpdateExtensionCredits( &$sp, &$ext ) {

—The preceding unsigned comment was added by Slowlearner (talk • contribs) 15:53, 12 February 2010 (UTC). Please sign your posts with ~ !