views:

34

answers:

2

Hi,

I whant to use some classes that are not part of ZF. I have a dir classes in application dir and the classes dir contains classes that are required as object or static. In Bootstrap i "load" every class.php.

Zend_Loader::loadFile('TimeZones.php', APPLICATION_PATH.'/classes/', false);

How can I have all the classes by default loaded/included from this dir?


SOLUTION for now. in Bootstrap.php

$files = scandir(APPLICATION_PATH.'/classes/');

foreach($files as $file) {
    if($file[0] != '.') {
        Zend_Loader::loadFile($file, APPLICATION_PATH.'/classes', false);
    }
}
+1  A: 

You might want to add your dir to the include_path where PHP looks for files.

set_include_path( get_include_path() . PATH_SEPARATOR . 
                  APPLICATION_PATH.'/classes/' );
Victor Nicollet
A: 

To have your classes loaded automatically from that dir, place it in your include_path. Here's two ways to do that. Setting include_path directly in your PHP.ini, if at all possible, is recommended.

Derek Illchuk
that would be a global path, i dont want that.
Dr Casper Black