-- David Mintz <[email protected]> wrote
(on Friday, 01 May 2009, 03:29 PM -0400):
> On Fri, May 1, 2009 at 11:52 AM, mvug <[email protected]> wrote:
>     I use the Zend framework for generating PDF's... I use the following code
>     to
>     initialize zend_pdf, but from version 1.8 the autoloader is not working...
>     can anybody help me? This is the "old" code I use...
> 
>     <?php
> 
>     // LOAD ZEND_PDF
>     $path = '../system/plugins';
>     set_include_path( get_include_path().PATH_SEPARATOR.$path );
>     require_once $path.'/Zend/Loader.php';
>     Zend_Loader::registerAutoload();
> 
>     $pdf = Zend_Pdf::load('templatepdf.pdf');
>     ?>
>     --
> 
> Don't know if this is directly relevant to your problem, but when I ran 
> similar
> code in 1.8.0 I got deprecation warnings. Now I go like this in my bootstrap
> (rather, my index.php; migration to real bootstrapping is a WIP):
> 
> require_once('Zend/Loader/Autoloader.php');
> Zend_Loader_Autoloader::getInstance();
> 
> and that seems to be enough because "the first time an instance of the
> autoloader is retrieved, it registers itself with spl_autoload. You retrieve 
> an
> instance using the getInstance() method" according to 
> http://framework.zend.com
> /manual/en/zend.loader.autoloader.html#zend.loader.autoloader.usage.
> 
> There is surely a more correct way in 1.8.

Nope, that's the recommended way. You can also read about it here:

    http://devzone.zend.com/a/4525

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

Reply via email to