#5681: Enabling a seperate bootstrap.php for every plugin
--------------------------+-------------------------------------------------
    Reporter:  stevieboy  |          Type:  Enhancement
      Status:  new        |      Priority:  Medium     
   Milestone:  1.2.x.x    |     Component:  General    
     Version:  RC3        |      Severity:  Normal     
    Keywords:             |   Php_version:  n/a        
Cake_version:             |  
--------------------------+-------------------------------------------------
 By default cakephp does not load any config files when executing a plugin.
 This is very unhandy because you might want to set some vars like version
 or mail address for a particular plugin.

 So you can modify the bootstrap.php of the main app to enabling such
 values or you can add a way to include plugin-bootstraps by default.

 Zaboo of the irc-channel showed me a way on how to do the 2nd (better) way
 by including this in the main app's bootstrap.php or routes.php


 {{{
   /* I placed this in the bottom of my /app/config/routes.php to include
 all the routes for all my separate plugins. You could do something simular
 for the config
   */
       uses('Folder');
       $pf = new Folder(APP . 'plugins');
       list($pluginFolders, $pluginFiles) = $pf->read();
       foreach($pluginFolders as $folder) {
       $file = APP . 'plugins' . DS . $folder . DS . 'config' . DS .
 'bootstrap.php';
       if(is_file($file)) {
        require_once($file);
       }
    }
 }}}

 As you can see this way all existing files named bootstrap.php in a
 '''plugins/<pluginname>/config/''' folder will be included.

 I think this is a feature for more mobile plugins as we dont have to
 change the main app anymore when "installing" a plugin. So, dear cake-
 team, please make it a core-feature so nobody has to paste the function in
 the main app's bootstrap anymore.

-- 
Ticket URL: <https://trac.cakephp.org/ticket/5681>
CakePHP : The Rapid Development Framework for PHP <https://trac.cakephp.org/>
Cake is a rapid development framework for PHP which uses commonly known design 
patterns like ActiveRecord, Association Data Mapping, Front Controller and MVC. 
Our primary goal is to provide a structured framework that enables PHP users at 
all levels to rapidly develop robust web applications, without any loss to 
flexibility.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"tickets cakephp" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/tickets-cakephp?hl=en
-~----------~----~----~----~------~----~------~--~---

  • [CakePHP : The Rapid Dev... CakePHP : The Rapid Development Framework for PHP

Reply via email to