-- bytte <[email protected]> wrote
(on Friday, 10 April 2009, 09:28 AM -0700):
> 
> Thanks. But I'm confused. Early on in my bootstrap I have this code:
> 
> set_include_path('.' . PATH_SEPARATOR . '../library/'
> . PATH_SEPARATOR . '../application/models'
> . PATH_SEPARATOR . '../application/forms'
> . PATH_SEPARATOR . '../library/dompdf-0.5.1'
> . PATH_SEPARATOR . get_include_path());
> include "Zend/Loader.php";
> Zend_Loader::registerAutoload();
> 
> Then where exactly do I need to insert this spl_autoload_register()
> function?

Before the Zend_Loader::registerAutoload() call.

> If I do it in my controller where I create the pdf, the pdf gets created but
> it starts with a lot of warnings because a lot of files in the DOMPDF file
> structure weren't found. Such as:
> 
> Warning: Zend_Loader::include_once() [function.include]: Failed opening
> 'Style.php' for inclusion
> (include_path='.:../library/:../application/models:../application/forms:../library/dompdf-0.5.1:.:/opt/local/lib/php')
> in /Users/xxx/Sites/zf-test/library/Zend/Loader.php on line 83
> 
> If I do it in my bootstrap just before Zend_Loader::registerAutoload(), all
> my other code doesn't work anymore as it looks like the DOMPDF autoloader is
> used to load all the ZF classes. Here's the warnings I get then:
> 
> Warning:
> require_once(/Users/xxx/Sites/zf-test/library/dompdf-0.5.1/include/zend_config_ini.cls.php)
> [function.require-once]: failed to open stream: No such file or directory in
> /Users/xxx/Sites/zf-test/library/dompdf-0.5.1/dompdf_config.inc.php on line
> 194
> 
> Could you provide me with some more information? It would be really helpful.
> 
> 
> 
> 
> 
> Mon Zafra wrote:
> > 
> > spl_autoload_register('DOMPDF_autoload');
> > 
> > Make sure that loader is registered late in the stack because it does a
> > require_once, meaning it will throw a fatal if it fails and will prevent
> > the
> > other autoloaders from trying to load the class.
> > 
> >    -- Mon
> > 
> > 
> > On Fri, Apr 10, 2009 at 9:22 PM, bytte <[email protected]> wrote:
> > 
> >>
> >> I'm using DOMPDF in a project of mine and I was wondering how I can call
> >> DOMPDF's autoload function so it can function together with the one from
> >> Zend Framework.
> >>
> >> Here's what DOMPDF says:
> >>
> >> /**
> >>  * DOMPDF autoload function
> >>  *
> >>  * If you have an existing autoload function, add a call to this function
> >>  * from your existing __autoload() implementation.
> >>  *
> >>  * @param string $class
> >>  */
> >> function DOMPDF_autoload($class) {
> >>  $filename = mb_strtolower($class) . ".cls.php";
> >>  require_once(DOMPDF_INC_DIR . "/$filename");
> >> }
> >>
> >> How exactly can I make it work together with the ZF?
> >> --
> >> View this message in context:
> >> http://www.nabble.com/Calling-external-autoload-function-%E2%80%93-how-to--tp22987919p22987919.html
> >> Sent from the Zend Framework mailing list archive at Nabble.com.
> >>
> >>
> > 
> > 
> 
> -- 
> View this message in context: 
> http://www.nabble.com/Calling-external-autoload-function-%E2%80%93-how-to--tp22987919p22990711.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
> 

-- 
Matthew Weier O'Phinney
Software Architect      | [email protected]
Zend Framework          | http://framework.zend.com/

Reply via email to