Development

Changeset 8299

You must first sign up to be able to contribute.

Changeset 8299

Show
Ignore:
Timestamp:
04/04/08 19:06:54 (3 months ago)
Author:
francois
Message:

[doc 1.1] documented how to embed a task in a plugin

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • doc/branches/1.1/book/17-Extending-Symfony.txt

    r8287 r8299  
    641641        fixtures/ 
    642642          *.yml            // Fixtures files 
    643         tasks/ 
    644           *.php            // CLI tasks 
    645643      lib/ 
    646644        *.php              // Classes 
     
    649647        model/ 
    650648          *.php            // Model classes 
     649        task/ 
     650          *Task.class.php  // CLI tasks 
    651651      modules/ 
    652652        */                 // Modules 
     
    682682  * The plug-in configuration is to be included in the plug-in bootstrap script (`config.php`). This file is executed after the application and project configuration, so symfony is already bootstrapped at that time. You can use this file, for instance, to add directories to the PHP include path or to extend existing classes with mixins. 
    683683  * Fixtures files located in the plug-in `data/fixtures/` directory are processed by the `propel:data-load` task. 
    684   * Tasks are immediately available to the symfony command line as soon as the plug-in is installed. It is a best practice to prefix the task by something meaningful--for instance, the plug-in name. Type `php symfony` to see the list of available tasks, including the ones added by plug-ins. 
    685684  * Custom classes are autoloaded just like the ones you put in your project `lib/` folders. 
    686685  * Helpers are automatically found when you call `use_helper()` in templates. They must be in a` helper/` subdirectory of one of the plug-in's `lib/` directory. 
    687686  * Model classes in `myplugin/lib/model/` specialize the model classes generated by the Propel builder (in `myplugin/lib/model/om/` and `myplugin/lib/model/map/`). They are, of course, autoloaded. Be aware that you cannot override the generated model classes of a plug-in in your own project directories. 
     687  * Tasks are immediately available to the symfony command line as soon as the plug-in is installed. A plugin can either add new tasks, or override an existing one. It is a best practice to use the plug-in name as a namespace for the task. Type `php symfony` to see the list of available tasks, including the ones added by plug-ins. 
    688688  * Modules provide new actions accessible from the outside, provided that you declare them in the `enabled_modules` setting in your application. 
    689689  * Web assets (images, scripts, style sheets, etc.) are made available to the server. When you install a plug-in via the command line, symfony creates a symlink to the project `web/` directory if the system allows it, or copies the content of the module `web/` directory into the project one. If the plug-in is installed from an archive or a version control repository, you have to copy the plug-in `web/` directory by hand (as the `README` bundled with the plug-in should mention). 
     
    812812        fixtures/ 
    813813          fixtures.yml 
    814         tasks/ 
    815           sfSampleTask.php 
    816814      lib/ 
    817815        model/ 
    818816          sfSampleFooBar.php 
    819817          sfSampleFooBarPeer.php 
     818        task/ 
     819          sfSampleTask.class.php 
    820820        validator/ 
    821821          sfSampleValidator.class.php 
     
    885885         <file role="data" name="fixtures.yml" /> 
    886886        </dir> 
    887         <dir name="tasks"> 
    888          <!-- tasks --> 
    889          <file role="data" name="sfSampleTask.php" /> 
    890         </dir> 
    891887       </dir> 
    892888       <dir name="lib"> 
     
    895891         <file role="data" name="sfSampleFooBar.php" /> 
    896892         <file role="data" name="sfSampleFooBarPeer.php" /> 
     893        </dir> 
     894        <dir name="task"> 
     895         <!-- tasks --> 
     896         <file role="data" name="sfSampleTask.class.php" /> 
    897897        </dir> 
    898898        <dir name="validator"> 
     
    991991          fixtures/ 
    992992            fixtures.yml 
    993           tasks/ 
    994             sfSampleTask.php 
    995993        lib/ 
    996994          model/ 
    997995            sfSampleFooBar.php 
    998996            sfSampleFooBarPeer.php 
     997          task/ 
     998            sfSampleTask.class.php 
    999999          validator/ 
    10001000            sfSampleValidator.class.php