|
![Picture of Asbjorn Grandt Picture of Asbjorn Grandt](/graphics/unknown.gif) Asbjorn Grandt - 2011-02-22 17:30:42 - In reply to message 9 from fulvio corsini
I have uploaded an updated EPub that should do away with the errors you describe. please help me test these, as the VirtualBox installation I have with PHP 5.2 on it have .... other issues, and are hardly reliable.
I wrote all of PHP version 2.0 for PHP 5.3, I'd be delighted to be able to ensure it'll run on 5.2 as well.
![Picture of fulvio corsini Picture of fulvio corsini](/graphics/unknown.gif) fulvio corsini - 2011-02-22 18:28:29 - In reply to message 11 from Asbjorn Grandt
Great! works perfect under php 5.2, so I assume the issue was in the addFile function,
anyway, I'll use your class in a big project I'm writing for my wife, of course I'll leave the credits and let you know when a beta version is online,
Thanks again, futre
p.s. you should have my email if you need a... tester, :)
![Picture of Asbjorn Grandt Picture of Asbjorn Grandt](/graphics/unknown.gif) Asbjorn Grandt - 2011-02-22 18:49:38 - In reply to message 12 from fulvio corsini
The problem was really throughout, whenever a file was added to the book.
As I mentioned, the problem was in test I did (and did have some misgivings about, but never got around to get rid of) where I just called the array with the file name as key, and if it failed, the file hadn't been added yet.
In PHP 5.3 that didn't cause a problem, I had no idea that it would in 5.2. I just replaced the test with the array_key_exists function which solved the problem quite nicely.
I did find another potential problem, but I do think that if that come up in real life, the server is in trouble regardless, as that will only happen if the server can't access the internet when adding an external file from an HTML :)
And thanks for the offer to help testing. Let me know when your project goes online. PHPClasses have a "Applications that use this class" section for listing those.
Cheers
A.Grandt
![Picture of Dragos Picture of Dragos](/graphics/unknown.gif) Dragos - 2011-02-23 12:53:48 - In reply to message 3 from fulvio corsini
some not set indexes i put if isset like strlen(isset($this->fileList[$fileName])) != 0 now it s working fine but on the image i get de cover image form your example but i can t get the image embeded inte xt in first chapter.
![Picture of Asbjorn Grandt Picture of Asbjorn Grandt](/graphics/unknown.gif) Asbjorn Grandt - 2011-02-23 13:16:46 - In reply to message 14 from Dragos
In the example the first chapter is added (line 112 in EPub.Example1.php) with the default setting for external references, that is to ignore them, that means the HTML is not scanned for these references and they are not added to the book.
The same chapter file is added as chapter 6 (line 166 in EPub.Example1.php) with the EPub::EXTERNAL_REF_ADD argument, causing that image to be added in chapter 6. But because Chapter 1 were never processed, it's link to the image in question were never rewritten in that chapter.
Cheers,
A.Grandt
|