Jump to content

Extension talk:StubManager

Add topic
From mediawiki.org
Latest comment: 12 years ago by Barmichev in topic StubManager 1.3.2 & MediaWiki 1.13 & 1.16.0

Redeclare Class

[edit]

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()

[edit]

Get the following PHP warning:

PHP Warning: call_user_func_array() [a href='function.call-user-func-array'>function.call-user-func-array<a/>]:
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)Reply

(CLOSED)

[edit]

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)Reply
// Paste here

Ok, I will gmail you instead if that's ok.

even better. Jean-Lou Dupont 21:07, 25 September 2007 (UTC)Reply
So what causes this error? -- Joe Beaudoin Jr. 03:24, 14 October 2007 (UTC)Reply
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)Reply

StubManager & ExtensionManager confilct (CLOSED)

[edit]

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)Reply

Login Required?! (CLOSED)

[edit]

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)Reply

So what does this do? (CLOSED)

[edit]

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)Reply

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)Reply

Installation fails (CLOSED)

[edit]

Installing Extension:StubManager with PEAR method (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)Reply

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)Reply

SVN download correction to 'require_once' setting for LocalSettings.php

[edit]

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:

require_once( "extensions/StubManager/StubManager.php" );

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:

mv StubManager-x.x.x StubManager

or link it to StubManager:

ln -s StubManager-x.x.x StubManager

Alternately, you could modify the directory name in the LocalSettings.php file:

require_once( "extensions/StubManager-x.x.x/StubManager.php" );

Posted by --AuroraCA 04:18, 10 March 2008 (UTC)Reply

Thanks for the detailed notes. Jean-Lou Dupont 01:16, 11 March 2008 (UTC)Reply
Has this been fixed? I attempted to fix it, which you changed back. [1]
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)Reply
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)Reply

I don't understand

[edit]

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)Reply

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)Reply
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)Reply
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)Reply

How can I test if this extension works

[edit]

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)Reply

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 [2].Jean-Lou Dupont 15:21, 31 March 2008 (UTC)Reply
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)Reply
I found a way to see if this extension is on your mediawiki. Special:Version Odessaukrain 16:02, 3 August 2008 (UTC)Reply

Possibly needs to be changed

[edit]

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)Reply

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

Save StubManager.php in the extensions folder.

in LocalSettings.php at the top, after the require line add:

require_once( "extensions/StubManager.php" );

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)Reply

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 [3]. Jean-Lou Dupont 17:36, 31 March 2008 (UTC)Reply


Under: [[Installation]] 2

You changed:

Download StubManager-1.2.0.tgz

to:

Download StubManager from

[4]

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)Reply

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

small styles bug

[edit]

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:

Provides stubbing facility for extensions handling rare events. Extensions registered:
AddScriptCss,  
.

/* Jerone || 20220314204846 */

Please file an issue on [5] and I'll get it fixed, someday. Jean-Lou Dupont 17:44, 2 April 2008 (UTC)Reply

Removed to talk

[edit]

I removed the following section:

== Installation Note == Always make sure that the <code>require 'path/to/StubManager/StubManager.php';</code> 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)Reply

Error: Too many arguments in Stub->__call

[edit]

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)Reply

I need to uncomment the switch statement to make the extension work too.

createStub2 and edit page hook name

[edit]

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)Reply

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)Reply

Support for Mediawiki 1.13

[edit]

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)Reply

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

[edit]

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.

MediaWiki 1.18.0

[edit]

Many thanks for a way to workaround this problem.

Today I made an update MediaWiki from 1.17.0 to 1.18.0. After opening the Special:Version page, this page was empty. When I added $wgShowExceptionDetails = true; line to a LocalSettings.php file, then I received the following error message:

Internal Error

Detected bug in an extension! Hook StubManager::hUpdateExtensionCredits failed to return a value; should return true to continue hook processing or false to abort.

Backtrace:

#0 /var/www/w/includes/GlobalFunctions.php(3631): Hooks::run('SpecialVersionE...', Array)
#1 /var/www/w/includes/specials/SpecialVersion.php(274): wfRunHooks('SpecialVersionE...', Array)
#2 /var/www/w/includes/specials/SpecialVersion.php(61): SpecialVersion->getExtensionCredits()
#3 /var/www/w/includes/SpecialPageFactory.php(458): SpecialVersion->execute(NULL)
#4 /var/www/w/includes/Wiki.php(226): SpecialPageFactory::executePath(Object(Title), Object(RequestContext))
#5 /var/www/w/includes/Wiki.php(626): MediaWiki->performRequest()
#6 /var/www/w/includes/Wiki.php(533): MediaWiki->main()
#7 /var/www/w/index.php(57): MediaWiki->run()
#8 {main}

I add this information (with error message), because someone might come in handy and will look the same as me.

--Danny373 07:49, 5 December 2011 (UTC)Reply

I also have this problem --Barmichev 21:33, 10 December 2011 (UTC)Reply

Hook StubManager failed to return a value

[edit]

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:

#0 /space/mediawiki-1.13.3/includes/specials/SpecialVersion.php(153): wfRunHooks('SpecialVersionE...', Array)
#1 /space/mediawiki-1.13.3/includes/specials/SpecialVersion.php(38): SpecialVersion->extensionCredits()
#2 /space/mediawiki-1.13.3/includes/specials/SpecialVersion.php(18): SpecialVersion->execute()
#3 [internal function]: wfSpecialVersion(NULL, Object(SpecialPage))
#4 /space/mediawiki-1.13.3/includes/SpecialPage.php(748): call_user_func('wfSpecialVersio...', NULL, Object(SpecialPage))
#5 /space/mediawiki-1.13.3/includes/SpecialPage.php(534): SpecialPage->execute(NULL)
#6 /space/mediawiki-1.13.3/includes/Wiki.php(224): SpecialPage::executePath(Object(Title))
#7 /space/mediawiki-1.13.3/includes/Wiki.php(55): MediaWiki->initializeSpecialCases(Object(Title), Object(OutputPage), Object(WebRequest))
#8 /space/mediawiki-1.13.3/index.php(93): MediaWiki->initialize(Object(Title), NULL, Object(OutputPage), Object(User), Object(WebRequest))
#9 {main}

February 2009 (UTC) Same error --Ccornell 10:54, 15 January 2009 (UTC)Reply

I also can't use this extension. Is there a way to make it work for 1.18? --LTech March 14th 2011


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

Stubmanager and Anywebsite extension

[edit]

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?

[edit]

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

[edit]

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)Reply

Warning with non static hUpdateExtensionCredits function

[edit]

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 (talkcontribs) 15:53, 12 February 2010 (UTC). Please sign your posts with ~~~~!Reply


jmol no longer works with mediawiki

[edit]

I'm using media 1.17 (but I think the same is going to happen to 1.16 and maybe 1.15). I installed StubManager and Jmol and I get the following error:

Warning: Parameter 1 to Jmol::tag_jmol() expected to be a reference, value given in /var/www/mediawiki/extensions/StubManager/StubManager.php on line 783

removing the '&' references from the jmol.body.php file make the error go away but nothing is displayed (though I really don't know much php). --24.188.149.43

Is there Somebody working on an Update for 1.16 or higher? I have the same problem with jmol.