PHPExcel and Joomla

When you try to include the PHPExcel library into a joomla article (using a plugin for inserting PHP code into an article), it doesn’t work. It displays a white screen. I found a solution for that. It maybe not the best way to fix this sinceĀ  I’ve modified the Joomla core.

Go to /libraries/loader.php and replace:

function __autoload($class)
{
if(JLoader::load($class)) {
return true;
}
return false;
}

with:

function Joomla_Autoload($class) {
if(JLoader::load($class)) {
return true;
}
return false;
}
/*** specify extensions that may be loaded ***/
spl_autoload_extensions('.php, .class.php, .lib.php');
/*** register the loader functions ***/
spl_autoload_register('Joomla_Autoload');
This entry was posted in Joomla. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

2 Comments

  1. Posted October 31, 2011 at 18:37 | Permalink

    Great post however I was wondering if you could write a litte more on this subject? I’d be very thankful if you could elaborate a little bit more. Appreciate it!

  2. Posted January 12, 2013 at 13:03 | Permalink

    For component developers who need to integrate with PHPExcel, there is also a library with PHPExcel build for Joomla.

    You can check it out here: https://github.com/vdespa/PHPExcel-Joomla-Library

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>