Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

magento code outsode of magento
 
hridaya
Member
 
Avatar
Total Posts:  63
Joined:  2009-02-04
Nepal
 

When i run the magento code outsode of magento( in JOOMLA)
it displays following errors Fatal error: Cannot redeclare __autoload().

Any ideas

Thanks..

Hridaya

 
Magento Community Magento Community
Magento Community
Magento Community
 
Incognito
Guru
 
Total Posts:  322
Joined:  2008-08-07
Michigan
 

ajax

 
Magento Community Magento Community
Magento Community
Magento Community
 
demonkoryu
Guru
 
Avatar
Total Posts:  328
Joined:  2008-11-26
Dortmund, Germany
 

What’s with ajax?

@OP: Magento and Joomla both use old-skool __autoload for automatic class loading (IIRC Magento defines it in app/Mage.php or app/Mage/functions.php or some such). You need to rewrite both occurences of __autoload() to use spl_autoload_register().

 
Magento Community Magento Community
Magento Community
Magento Community
 
artesiandesign
Jr. Member
 
Avatar
Total Posts:  11
Joined:  2008-06-17
Riverside, CA, USA
 

@Nightfly: Do you know if this is possible without editing the core files? Can I override the __autoload() function with custom module?

 
Magento Community Magento Community
Magento Community
Magento Community
 
demonkoryu
Guru
 
Avatar
Total Posts:  328
Joined:  2008-11-26
Dortmund, Germany
 

Editing not, but you must override them.
You’ll have to override at least app/code/core/Mage/Core/functions.php with your own version in app/code/local and rename the __autoload() function to something else, then call spl_autoload_register() with that function (at the place where the previous __autoload() was defined).
Then in Joomla you must do the same (replace __autoload() and call spl_autoload_register()), but don’t ask me where the functions are. I have never touched Joomla.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top