Issue Details (XML | Word | Printable)

Key: ZF-2996
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Critical Critical
Assignee: Matthew Weier O'Phinney
Reporter: Robert Castley
Votes: 4
Watchers: 4
Operations

If you were logged in you would be able to see more operations.
Google issue summary
Zend Framework

ZF 1.5.0 breaks co-existance with external libs (domPDF)

Created: 30/Mar/08 01:26 PM   Updated: 22/Nov/08 09:16 AM   Resolved: 22/Nov/08 09:16 AM
Component/s: Zend_Loader
Affects Version/s: 1.5.0, 1.6.0, 1.6.1, 1.6.2
Fix Version/s: 1.8.0

Time Tracking:
Not Specified

File Attachments: 1. Text File Zend_Loader-patch.patch (0.9 kB)

Issue Links:
Duplicate
 

Fix Version Priority: Should Have


 Description  « Hide

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


Wil Sinclair added a comment - 31/Mar/08 04:07 PM

Please evaluate and assign as necessary.


Sergey Belov added a comment - 06/Jun/08 02:09 AM

Here is a patch for this issue


Robert Castley added a comment - 11/Jun/08 03:55 AM

The patch works

Many thanks ....

Will this be in the next release?

All the very best,

  • Robert

current added a comment - 05/Jul/08 07:53 AM

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
####################################################


Robert Castley added a comment - 07/Jul/08 02:18 AM

@ 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());


Robert Castley added a comment - 01/Sep/08 02:39 AM

Hi,

Is there any chance that this tiny ickle patch could make it into 1.6.0? Pretty please

Cheers,

  • Robert

Juan Felipe Alvarez Saldarriaga added a comment - 22/Oct/08 09:10 AM

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" );

// SPL register the DOMPDF loader so we can instantiate a new DOMPDF object.
spl_autoload_register( "DOMPDF_autoload" );

$objDomPdf = new DOMPDF();

$objDomPdf->load_html( $strHtml );

$objDomPdf->render();

$objDomPdf->stream( "blah.pdf" );
}

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


Matthew Weier O'Phinney added a comment - 22/Nov/08 09:16 AM

Resolved in trunk with ZF-2923 fixes; will not release until 1.8.0.