Yii: GImport extension
GImport yii extension implements recursive import of directories with caching.
Import is performed recursively for specified path alias. Classes found are cached, so the import process can be slow only the first time.
Basic usage example:
$importer = new GImport;
$importer->add('modules.myModule.*');
This code will import all classes from modules/myModule/ directory.
GImport can also be configured as an application component. Add the following code into the application config:
return array(
...
'preload' => array('log', 'import'),
...
'components' => array(
'import' => array(
'class'=>'GImport',
'import' => array(
// add directories to import and
// put 'import' component to preload to trigger import
// on application initialization
'application.extensions.*',
),
),
...
Download at extension page.