#1341: autoload_folders
-------------------------------+--------------------------------------------
 Reporter:  JanS@…             |       Owner:  david   
     Type:  enhancement        |      Status:  new     
 Priority:  low                |   Milestone:  1.0.5   
Component:  config             |     Version:  1.0.4   
 Severity:  major              |    Keywords:  autoload
Has_patch:  1                  |  
-------------------------------+--------------------------------------------
 This tiny patch enhances the autoload mechanism of agavi in a way, to
 allow autoload_folder-elements.

 Those autoload_folders can be used to automatically add all files of a
 folder, which match a specific pattern.

 '''Example Usage'''

 {{{
 <?xml version="1.0" encoding="UTF-8"?>
 <ae:configurations
 xmlns="http://agavi.org/agavi/config/parts/autoload/1.0";
     xmlns:ae="http://agavi.org/agavi/config/global/envelope/1.0";
 parent="%core.config_dir%/autoload.xml">
     <ae:configuration>
         <autoload_folders>
             <autoload_folder
 
pattern="/^.+\/(.+)\.(interface|class)\.php$/i">%core.lib_dir%/services/</autoload_folder>
         </autoload_folders>
     </ae:configuration>
 </ae:configurations>

 }}}

 '''Implementation details'''

 Since this is done all at compile time, the resulting
 cache/config/autoload_xml_*.php should be exactly the same size.

 Performance is only lower, in case one has %core.debug%=true. In this case
 it would automatically find new classes.

 If %core.debug%=false the autoload_folders behave the same like xincludes.
 The cache has to be cleared to find new files added to the folder.

-- 
Ticket URL: <http://trac.agavi.org/ticket/1341>
Agavi <http://www.agavi.org/>
An MVC Framework for PHP5



_______________________________________________
Agavi Tickets Mailing List
[email protected]
http://lists.agavi.org/mailman/listinfo/tickets

Reply via email to