Back to Top

Preventing re-declaration of classes/functions in Prestashop

Updated 26 March 2015

Yesterday, when I tried to install my new module in Prestashop , i got an error : [stextbox id=”alert”]Cannot redeclare xmlrpc_se_any() (previously declared in /home/medicden/public_html/modules/cloudcache/lib/xmlrpc.inc.php:554) in /home/medicden/public_html/modules/prestaerp/xmlrpc.inc on line 543][/stextbox] Actually, the problem is my new module is using the library named “xmlrpc.inc” which is already used in previously installed modules, i tried –

 include_once xmlrpc.inc

but its not worked. Then i add one condition before including this library as –

 if (!class_exists('xmlrpc_client'))

 include_once xmlrpc.inc

and then it installed without getting any error. Hope, it will save someone`s time .

[stextbox id=”warning”]Your opinions, comments and suggestions are important to keep the page updated and interesting.[/stextbox]

Searching for an experienced
Prestashop Company ?
Find out More
. . .

Leave a Comment

Your email address will not be published. Required fields are marked*


Be the first to comment.

Back to Top

Message Sent!

If you have more details or questions, you can reply to the received confirmation email.

Back to Home