Page MenuHomePhabricator

Rename class HttpRequest to something that doesn't conflict with PHP's HTTP extension.
Closed, ResolvedPublic

Description

Author: corneelbooysen

Description:
I have a public Wiki http://semanticstreams.com
that I am getting ready to use the Maps and Semantic Maps extension.

The Versions of software can be found here:
http://semanticstreams.com/wiki/index.php?title=Special:Version
(mediawiki 1.16, Maps and Semantic maps 0.7.2 rc1)

I am not even able to save the page but during the save process gets the following error:

Fatal error: Cannot redeclare class HttpRequest in /home/semanti4/public_html/wiki/includes/HttpFunctions.php on line 122

Please advise how you would like to proceed with this.

Thanks.
Corneel Booysen.


Version: 1.17.x
Severity: normal
OS: Linux

Details

Reference
bz25872

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:16 PM
bzimport set Reference to bz25872.

Mediawiki isn't compatible the HTTP php extension ( http://ca3.php.net/manual/en/intro.http.php ) . It sounds like you have the HTTP extension installed, which you'll need to disable (This isn't a smw issue).

corneelbooysen wrote:

As can be seen from the following link: http://semanticstreams.com/wiki/index.php?title=Special:Version

I have the following extensions installed:
include_once("$IP/extensions/SemanticMediaWiki/SemanticMediaWiki.php");
include_once("../wiki/extensions/SemanticForms/includes/SF_Settings.php");
require_once( "../wiki/extensions/Validator/Validator.php" );
require_once( "../wiki/extensions/Maps/Maps.php" );
require_once( "../wiki/extensions/SemanticMaps/SemanticMaps.php" );
require_once("../wiki/extensions/SemanticResultFormats/SRF_Settings.php");
require_once( "../wiki/extensions/ParserFunctions/ParserFunctions.php" );
require_once( "../wiki/extensions/BreadCrumbs/BreadCrumbs.php" );
require_once("../wiki/extensions/CategoryTree/CategoryTree.php");
require_once("../wiki/extensions/Cite/Cite.php");
require_once("../wiki/extensions/GoogleAnalytics/googleAnalytics.php");
include_once('../wiki/extensions/GoogleAdSense/GoogleAdSense.php');
require_once( "../wiki/extensions/GoogleAdSense2/GoogleAdSense.php" );
require_once("../wiki/extensions/ImageMap/ImageMap.php");
require_once("../wiki/extensions/IncludeArticle/IncludeArticle.php");
require_once("../wiki/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.php")

Which one should I disable?

(In reply to comment #1)

Mediawiki isn't compatible the HTTP php extension (
http://ca3.php.net/manual/en/intro.http.php ) . It sounds like you have the
HTTP extension installed, which you'll need to disable (This isn't a smw
issue).

We should probably just rename our class to not conflict with a known PHP interface :)

(In reply to comment #2)

I have the following extensions installed:
Which one should I disable?

The conflict is between MediaWiki and a PHP extension (not a MediaWiki extension). You need to change the configuration of your webserver to fix this.

corneelbooysen wrote:

Well,

I was hoping I would not end up in the middle between you guys and my hosting company. They attempted to disable the extension without much success. They then referred back to the comment Chad made that you should probably just rename the class as to not conflict with PHP. So they have now given up trying to disable the extension and I am left in the middle.

Could you guys please consider renaming your class - or send me instructions to do the renaming for my local copy.

I will add the copy of my siteground ticket for your benefit below.

Thanks
Corneel.

2010-11-11 11:30am by semanti4 (me)- I can try that - if you let me know which directory in the server the file needs to go.

From your note I assume the file will be called php.ini and will contain the one line:
;extension=http.so

If this is correct - just let me know which directory it should go in and I will give it a try.

Thanks.
Corneel.

PS. Will Apache have to be restart to enable the change?
2010-11-11 11:44am by Yavor.I - Hello Corneel,

Please note that I have already created the php.ini file in each MediaWiki folder. You only have to test whether the issue persists with that workaround implemented.

Apache restart is not required for the purpose.

Best Regards,

Yavor I.
Technical Support Team


Check out our Friends Special:

One year hosting for $9.95 only + free months for referral
2010-11-11 11:55am by semanti4 - I tried it and the problems still persists.

  1. If you login at semanticstreams.com with id "siteground" password "mediawiki" then
  2. Try to create a page called New York (or any other name) - with the following content:
  1. Attempt to save it and you will the error.

Thanks.
Corneel.

2010-11-11 12:09pm by Yavor.I - Hello Corneel,

In that case please check the possible courses of action below:

  • wait for the Mediawiki developers to rename their class in a way that it will not conflict with the http class. As one of them said in your bug report:

We should probably just rename our class to not conflict with a known PHP interface :)

  • contact professional developer to customize your application and rename the http class. If you want to take advantage of our development services you should post a support request by logging into your customer's area -> Get support -> HelpDesk - report hosting related issue -> Other technical issues -> Development related issues.

Alternatively, you can find developer at any of the portals below:

http://getafreelancer.com

http://scriptlance.com

If you have other questions or comments, feel free to contact us.

Best Regards,

Yavor I.
Technical Support Team

corneelbooysen wrote:

This is a valid bug because we were unable to solve the problem by overriding the PHP extension.

I believe you should rename your class.

Thanks.
Corneel.

(In reply to comment #6)

This is a valid bug because we were unable to solve the problem by overriding
the PHP extension.

I believe you should rename your class.

Thanks.
Corneel.

This is a MediaWiki bug, not a Semantic Maps bug, so please enter a new one into bugzilla with correct component and title. That way you have more chance of getting help.

How about we just rename/move the bug instead :)

/me plans to try to rename the class shortly if no one beats me to it.

Fixed in trunk on r76566 by renaming HttpRequest to MWHttpRequest. The old HttpRequest should still work as well so not to break backwards compatability.

Since maps extension was using the Http::get wrapper around HttpRequest, it doesn't need to change anything to be fixed.

corneelbooysen wrote:

I installed the trunk copy 1.17alpha that you fixed, on a local xampp server.
(I can see your fix comments in the release notes)

When I attempt to store a page with the following:

  • the save action hangs for a really long time and then I get the following message:

"Fatal error: Parameter coordinates must be one or more valid locations."

Then I tried the example off of your page at: http://mapping.referata.com/wiki/Maps_examples

{{
#display_points:
Moscow, Russia;New York City; Brussels, Belgium

icon=Green_marker.png

}}

The wiki hangs for a long time and then return the message:

"Fatal error: Maximum execution time of 30 seconds exceeded in C:\xampp\htdocs\wiki\includes\HttpFunctions.php on line 981"

I am reopening this ticket because I get the feeling it might be more semantic map related this time.

Thanks.
Corneel.

Please don't reuse bugs. This particular bug is about a duplicate class, the dupe is gone. If there's another problem with Maps, be bold to open another bug, or ask on IRC.

  • Bug 28929 has been marked as a duplicate of this bug. ***