Yii Framework Forum: [Extension] Gimport - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

[Extension] Gimport Recursive directory import with caching Rate Topic: -----

#1 User is offline   seb 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 240
  • Joined: 29-June 09

Posted 10 October 2012 - 09:33 AM

GImport class 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 first time.

Basic usage example:

   $importer = new GImport;
   $importer->add('modules.myModule.*');


This code will import all clasees from modules/myModule/ directory.

GImport can also be configured as application component. Add 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.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users