phpzend-frameworkopen-flash-chart

Open Flash Chart and Zend Framework Autoloader: class not found


I'm trying to upgrade the charts in my zend framework based website to the open flash chart 2 (version: kvasir) library. It used to work just fine with older versions. However, using the new version, when I try to create e.g. lines, I get error messages such as

Warning: include(line\hollow.php) [function.include]: failed to open stream: No such file or directory in C:\xampp\htdocs\weMatch\library\Zend\Loader.php on line 83

Fatal error: Class 'line_hollow' not found in C:\xampp\htdocs\weMatch\application\default\controllers\FeedbackController.php on line 215

I suspect that the Zend_Loader_Autoloader is replacing the underscore with a backslash. Can I exclude the whole open flash chart library from the Zend_Loader_Autoloader?


Solution

  • I found out that the API of the open flash library has changed with the new version (kvasir). As in old versions, there's a file you need to include which includes all the other library classes (open-flash-chart.php). I saw that the class line_hollow.php was commented out in this file and I therefore guess it's deprecated. When I tried to include line_hollow.php, there were some follow up errors. Luckily, there are other ways to achieve the same result. Instead of:

    $line = new line_hollow();
    

    you go

    $line= new line();
    $dot = new hollow_dot();
    $line->set_default_dot_style($dotTeam);
    

    The latter way gives you more flexibility, because you can give the $dot additional attributes.