Grandt/PHPePub

Namespacing

Opened this issue · 3 comments

I think more specific class names would really help with compatibility.

I've been trying to get around a name conflict (in the Omeka CMS, which also uses Item) using PHP's namespace to no avail.

For some reason, it's putting together the various book parts but the spine and manifest are empty, producing a corrupt file.

I'm not sure the best way to approach this (nor am I sure I'm using namespaces correctly) but figured I'd put it out there as an issue.

Please send the corrupted ePub to php@grandt.com

Also, are you suggesting that I add a namespace to the PHPePub classes?

Hi.

Apologies for taking a while to get back to you. Things got a little hectic for a while.

Please have a look at the 3.30 branch for the namespace fix. I've used \com\grandt

The problem was that I test for class names using get_class. It always returns the fully qualified class name within its namespace, meaning nothing was actually added to the OPF and NCX files.

Fantastic, thank you! The method you applied to the 3.30 branch appears to solve the problem.