Package including src, returning doctarine exception.

Permalink
Following the guidelines on this page:

I added a /src directory to my package, and included the PHPExcel library.
https://github.com/PHPOffice/PHPExcel...

And the following code to the package controller:

protected $pkgAutoloaderRegistries = array(
        'src/' => '\foo\Bar'
    );
    public function on_start()
    {
        $startup = \PHPExcel\Src\PHPExce();
        $startup->boot();
    }
.

Attempts to install the package give this error:
Doctrine\Common\Persistence\Mapping\Driver\AnnotationDriver::main(): Failed opening required '/jpgraph.php' (include_path='D:\SiteBackups\VIAFRONT\eds-www\concrete\vendor;.;C:\php\pear')

Being caused by this line in the source:
require_once(PHPExcel_Settings::getChartRendererPath().'/jpgraph.php');

Thing is, I know it's a problem with Concrete5, not the library, as the library worked outside of of Concrete5 AND PHPExcel doesn't use Doctrine.

 
MrKDilkington replied on at Permalink Reply
MrKDilkington
Hi voteitallorg,

This might be an autoloading issue.

Were you following this documentation:
https://documentation.concrete5.org/developers/packages/adding-custo...

Someone posted to the forum with their experience using this library:
http://www.concrete5.org/community/forums/5-7-discussion/third-part...

The code sample you included has "\foo\Bar" for $pkgAutoloaderRegistries and "PHPExce()", are these typos?
voteitallorg replied on at Permalink Reply
Yea, that was the documentation I was trying to follow.

The \foo\Bar was just replacing the name since the package I was working on hadn't decided on a namespace yet, and the PHPExce() is a typo. Blurry eyes to be blamed. I'll try the fixes in the article you linked.
JohntheFish replied on at Permalink Reply
JohntheFish
The rules for autoloading underwent another change with v8 that were not well advertised. If you were used to the rules for 5.7, then the rules for v8 packages are different (but there are some fudges to allow packages designed for 5.7 to continue working)
voteitallorg replied on at Permalink Reply
Yea, that's news to me. Do you know where any information is on it?
JohntheFish replied on at Permalink Reply
JohntheFish
There are docs for the current (v8) loading rules in the main part of the docs pages, then docs for v5.7 loading rules in the appendix. Please don't ask me to clarify them - they are a confusing mess.