ZF-2996: ZF 1.5.0 breaks co-existance with external libs (domPDF)
Description
I have an application which relies heavily on generating PDF reports. I have chosen domPDF for the task (which is excellent BTW). Since upgrading to 1.5.0 the changes to Zend_Loader now seem to prevent use.
Example code to replicate issue:
require_once 'DomPDF/dompdf_config.inc.php';
require_once 'Zend/Loader.php';
Zend_Loader::registerAutoload();
spl_autoload_register('DOMPDF_autoload');
$pdf = new DOMPDF();
With 1.0.4 this works without any issues. The domPDF gets loads and the class is usable from within my application. Since upgrading to 1.5.0 I now get the following errors:
Warning: Zend_Loader::include_once(DOMPDF.php) [function.Zend-Loader-include-once]: failed to open stream: No such file or directory in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\ZendFramework\library\Zend\Loader.php on line 83
Warning: Zend_Loader::include_once() [function.include]: Failed opening 'DOMPDF.php' for inclusion (include_path='widgets/Macro4/Accounting/RunReport\;.;C:\php5\pear;..\ZendFramework\library;.\library;.\application\models;.\application\config;.\widgets') in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\ZendFramework\library\Zend\Loader.php on line 83
Warning: Zend_Loader::include_once(Frame\Tree.php) [function.Zend-Loader-include-once]: failed to open stream: No such file or directory in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\ZendFramework\library\Zend\Loader.php on line 83
Warning: Zend_Loader::include_once() [function.include]: Failed opening 'Frame\Tree.php' for inclusion (include_path='widgets/Macro4/Accounting/RunReport\;.;C:\php5\pear;..\ZendFramework\library;.\library;.\application\models;.\application\config;.\widgets') in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\ZendFramework\library\Zend\Loader.php on line 83
Warning: Zend_Loader::include_once(Stylesheet.php) [function.Zend-Loader-include-once]: failed to open stream: No such file or directory in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\ZendFramework\library\Zend\Loader.php on line 83
Warning: Zend_Loader::include_once() [function.include]: Failed opening 'Stylesheet.php' for inclusion (include_path='widgets/Macro4/Accounting/RunReport\;.;C:\php5\pear;..\ZendFramework\library;.\library;.\application\models;.\application\config;.\widgets') in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\ZendFramework\library\Zend\Loader.php on line 83
I use domPDF because I need to convert HTML to PDF. I accept the Zend_Loader has changed but is there a way to switch off the new behavior to allow the use of external libs that do not necessarily conform to the strict guidelines in ZF?
Cheers,
- Robert
Comments
Posted by Wil Sinclair (wil) on 2008-03-31T16:07:18.000+0000
Please evaluate and assign as necessary.
Posted by Sergey Belov (arikon) on 2008-06-06T02:09:06.000+0000
Here is a patch for this issue
Posted by Robert Castley (rcastley) on 2008-06-11T03:55:40.000+0000
The patch works :-)
Many thanks ....
Will this be in the next release?
All the very best,
Posted by current (current.undone) on 2008-07-05T07:53:52.000+0000
Hi,
How did you apply the patch? I am also receiving a similar error, which I think can be solved using this patch. Please help, regards, Current
######################My Error
Warning: include(Zend/Loader.php) [function.include]: failed to open stream: No such file or directory in /var/www/index.php on line 11
Warning: include() [function.include]: Failed opening 'Zend/Loader.php' for inclusion (include_path='.:./library:./application/models/:.:/usr/share/php:/usr/share/pear') in /var/www/index.php on line 11
Fatal error: Class 'Zend_Loader' not found in /var/www/index.php on line 12
#
Posted by Robert Castley (rcastley) on 2008-07-07T02:18:01.000+0000
@ current,
I think you issue is more with not have the Zend Framework specified in your PHP path.
e.g.
set_include_path(PS . '..' . DS . 'ZendFramework' . DS . 'library' . PS . '.' .DS . 'library' . PS . '.' .DS . 'application' . DS . 'models' . PS . get_include_path());
Posted by Robert Castley (rcastley) on 2008-09-01T02:39:21.000+0000
Hi,
Is there any chance that this tiny ickle patch could make it into 1.6.0? Pretty please :-)
Cheers, - Robert
Posted by Juan Felipe Alvarez Saldarriaga (jfalvarez) on 2008-10-22T09:10:47.000+0000
Same problem here (ZF 1.6.2), this is my config:
bootstrap:
// Include path set_include_path( '.' . PATH_SEPARATOR . '../library' . PATH_SEPARATOR . '../library/classes'
. PATH_SEPARATOR . '../library/functions'
. PATH_SEPARATOR . '../library/plugins'
. PATH_SEPARATOR . '/usr/local/lib/fw/php/phpzend-1.6.2/library' . PATH_SEPARATOR . '/usr/local/lib/dompdf/dompdf-0.5.1'
. PATH_SEPARATOR . get_include_path()
);
controller/action:
public function pdfAction() { // Include dompdf config file. require_once( "dompdf_config.inc.php" );
}
And I got this warnings:
Warning: Zend_Loader::include_once(DOMPDF.php) [function.Zend-Loader-include-once]: failed to open stream: No such file or directory in /usr/local/lib/fw/php/phpzend-1.6.2/library/Zend/Loader.php on line 83
Warning: Zend_Loader::include_once() [function.include]: Failed opening 'DOMPDF.php' for inclusion (include_path='.:../library:../library/classes:../library/functions:../library/plugins:/usr/local/lib/fw/php/phpzend-1.6.2/library:/usr/local/lib/dompdf/dompdf-0.5.1:.:/usr/share/php:/usr/share/pear') in /usr/local/lib/fw/php/phpzend-1.6.2/library/Zend/Loader.php on line 83
Warning: Zend_Loader::include_once(Frame/Tree.php) [function.Zend-Loader-include-once]: failed to open stream: No such file or directory in /usr/local/lib/fw/php/phpzend-1.6.2/library/Zend/Loader.php on line 83
Warning: Zend_Loader::include_once() [function.include]: Failed opening 'Frame/Tree.php' for inclusion (include_path='.:../library:../library/classes:../library/functions:../library/plugins:/usr/local/lib/fw/php/phpzend-1.6.2/library:/usr/local/lib/dompdf/dompdf-0.5.1:.:/usr/share/php:/usr/share/pear') in /usr/local/lib/fw/php/phpzend-1.6.2/library/Zend/Loader.php on line 83
Warning: Zend_Loader::include_once(Stylesheet.php) [function.Zend-Loader-include-once]: failed to open stream: No such file or directory in /usr/local/lib/fw/php/phpzend-1.6.2/library/Zend/Loader.php on line 83
Warning: Zend_Loader::include_once() [function.include]: Failed opening 'Stylesheet.php' for inclusion (include_path='.:../library:../library/classes:../library/functions:../library/plugins:/usr/local/lib/fw/php/phpzend-1.6.2/library:/usr/local/lib/dompdf/dompdf-0.5.1:.:/usr/share/php:/usr/share/pear') in /usr/local/lib/fw/php/phpzend-1.6.2/library/Zend/Loader.php on line 83
Posted by Matthew Weier O'Phinney (matthew) on 2008-11-22T09:16:25.000+0000
Resolved in trunk with ZF-2923 fixes; will not release until 1.8.0.