Using Zend Framework libraries - include_path

2 messages Options
Embed this post
Permalink
Kieron

Using Zend Framework libraries - include_path

Reply Threaded More More options
Print post
Permalink
Hello again,

Just a suggestion on the Zend Framework section in Ch. 12.

Editing each library file as you use it to include the include_path definition seems rather a painstaking exercise as well as a bad idea (surely convention would suggest you shouldn't edit any library files of a vendor application at all!)

An alternative is to create a new file called for example, zend_include_path.php in you vendors folder with the include_path definition in it:

<?php
    ini_set('include_path', dirname(__FILE__));
?>

and then import that file before each import of a zend library:

                App::import('Vendor', 'zend_include_path');
                App::import('Vendor', 'akismet', true, false, 'Zend/Service/Akismet.php');

This negates the need to edit any part of the Zend libraries at all.
Cheers.
davidgolding

Re: Using Zend Framework libraries - include_path

Reply Threaded More More options
Print post
Permalink
Great suggestion. And it keeps it Cake-side without having to affect the Zend files at all. Thanks for the post.
--Dave

Author, "Beginning CakePHP: From Novice to Professional"

[ get your copy at: http://www.amazon.com/Beginning-CakePHP-Novice-Professional/dp/1430209771/ ]