Preventing re-declaration of classes/functions in Prestashop
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]
Categories:
prestashop
View Comments
Comment or Ask a Question
Quick Links