Development

Changeset 33081

You must first sign up to be able to contribute.

Changeset 33081

Show
Ignore:
Timestamp:
09/23/11 15:30:39 (3 years ago)
Author:
COil
Message:

[sfTaskLoggerPlugin]
* Finalized the 1.0.4 package
* Finalized the Doctrine admin generator module
* Updated the sample task
* Fixed and updated the documentation

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/sfTaskLoggerPlugin/branches/1.2/README

    r33073 r33081  
    4848        $ symfony plugin:install sfTaskLoggerPlugin 
    4949 
    50    (or download it and unzip in your /plugins directory
     50   (download it and unzip in your `/plugins` directory or use svn `http://svn.symfony-project.com/plugins/sfTaskLoggerPlugin/tags/sfTaskLoggerPlugin_1_0_4/`
    5151 
    5252 * Build the new plugin table and associated models: 
    5353 
    54         $ symfony doctrine:build-all-reload 
     54        $ ./symfony doctrine:build --all-classes --db --and-load --env=dev 
    5555(or launch each "build" task individually) 
    5656 
     
    6363> 
    6464>  * A new table called `tl_tasks` in your database 
    65 >  * A new set of model classes in `lib/model/sfTaskLoggerPlugin` or `lib/model/sfTaskLoggerPlugin` 
     65>  * A new set of model classes in `lib/model/sfTaskLoggerPlugin` or `lib/model/doctrine/sfTaskLoggerPlugin` 
    6666 
    6767 * Clear you cache 
     
    274274        enabled_modules:  [default, tl_task] 
    275275 
     276After having generated all the model files of the plugin, edit the 
     277`/lib/model/doctrine/sfTaskLoggerPlugin/tlTaskTable.class.php` class and make it 
     278extend the class `PlugintlTaskTableExtended`: 
     279 
     280    [php] 
     281    /** 
     282     * tlTaskTable 
     283     * 
     284     * This class has been auto-generated by the Doctrine ORM Framework 
     285     */ 
     286    class tlTaskTable extends PlugintlTaskTableExtended 
     287    { 
     288        /** 
     289         * Returns an instance of this class. 
     290         * 
     291         * @return object tlTaskTable 
     292         */ 
     293        public static function getInstance() 
     294        { 
     295            return Doctrine_Core::getTable('tlTask'); 
     296        } 
     297    } 
     298 
     299Then call the module, `you_backend.php/tl_task` ! That's it ! ;) 
     300 
     301>**Note** 
     302>The plugin comes with a route `tl_task` for this admin generator module. 
     303 
    276304Notes 
    277305===== 
     
    303331==== 
    304332 
    305   * Include model functions to get the list of already executed task 
    306   * Test Propel version 
     333  * V1.1.0: Advanced features to keep a state of "processed objects" 
     334  * V1.0.5: Test the Propel version 
    307335 
    308336Support 
    309337======= 
    310338 
    311 Please report bugs on the symfony TRAC, I could also answer if you ask on the 
    312 symfony mailing list or IRC
     339Send me an email or report bugs on the symfony TRAC, I could also answer if you ask on the 
     340symfony mailing list
    313341 
    314342Changelog 
  • plugins/sfTaskLoggerPlugin/branches/1.2/lib/task/sfTaskLoggerSampleTask.class.php

    r30989 r33081  
    6565    { 
    6666      $this->printAndLog(' - This is a log info !!'); 
     67      $rand = rand(1, 5); 
     68      $this->printAndLog(sprintf(' - Sleeping... for... %d seconds...', $rand)); 
     69      sleep($rand); 
    6770      $this->task->setErrorCode(self::ERROR_CODE_SUCCESS); 
    6871      $this->setOk(); 
  • plugins/sfTaskLoggerPlugin/branches/1.2/modules/tl_task/config/generator.yml

    r33073 r33081  
    22  class: sfDoctrineGenerator 
    33  param: 
    4     theme:                 ~ 
    54    model_class:           tlTask 
    6     non_verbose_templates: ~ 
    7     with_show:             ~ 
     5    theme:                 admin 
     6    non_verbose_templates: true 
     7    with_show:             false 
    88    singular:              ~ 
    99    plural:                ~ 
    1010    route_prefix:          tl_task 
    1111    with_doctrine_route:   true 
    12     actions_base_class:    ~ 
     12    actions_base_class:    sfActions 
    1313 
    1414    config: 
    15       actions: 
    16         launch: ~ 
    17         run: ~ 
     15      actions: ~ 
    1816 
    1917      fields: 
     
    4341        object_actions: 
    4442          _edit: { label: "Edit/show" } 
    45         actions: ~ 
     43        actions: { } 
    4644 
    4745      filter: 
     
    5755          "Stats":  [started_at, is_running, ended_at, _length, count_processed, count_not_processed] 
    5856          "Logs":   [log_file, _file_log, log, _database_log] 
    59           "Admin":  [comments, created_at
     57          "Admin":  [comments, created_at, updated_at
    6058 
    6159      edit: 
    6260        title: Edition / view of task "%%id%%" 
     61 
     62      new: ~ 
  • plugins/sfTaskLoggerPlugin/branches/1.2/modules/tl_task/lib/filter/tlTaskBackendFormFilter.class.php

    r33073 r33081  
    55 * 
    66 * @author COil 
    7  * @since  5 aug 2010 
     7 * @since  23 sept 2011 
    88 */ 
    99 
     
    2424  protected function _setWidgets() 
    2525  { 
    26     $this->widgetSchema['id'] = new sfWidgetFormFilterInput(); 
    27     $this->widgetSchema['task'] = new BoWidgetFormFilterSelect( 
     26    $this->widgetSchema['id']   = new sfWidgetFormFilterInput(); 
     27    $this->widgetSchema['task'] = new sfWidgetFormSelectForText( 
    2828      array( 
    2929        'choices' => Doctrine::getTable('tlTask')->getTasksList() 
  • plugins/sfTaskLoggerPlugin/branches/1.2/modules/tl_task/lib/form/tlTaskBackendForm.class.php

    r33073 r33081  
    2727    $this->widgetSchema['options']->setAttribute('size', 100); 
    2828    $this->widgetSchema['arguments']->setAttribute('size', 100); 
     29    $this->widgetSchema['log']->setAttribute('cols', 100); 
     30    $this->widgetSchema['comments']->setAttribute('cols', 100); 
    2931  } 
    3032} 
  • plugins/sfTaskLoggerPlugin/branches/1.2/modules/tl_task/templates/_file_log.php

    r33073 r33081  
    22<?php if ($log_file && file_exists($log_file)): ?> 
    33<div style="margin: 20px">  
    4 <pre> 
    5   <?php ini_set('memory_limit', '64M'); // to display big log files ?> 
    6   <?php echo htmlentities(file_get_contents($log_file)); ?> 
     4<pre><?php echo htmlentities(file_get_contents($log_file)); ?> 
    75</pre> 
    86</div> 
    97<?php else: ?> 
    108  <div style="margin: 20px"> 
    11   <?php echo __('Log file was not recorded (or purged)'); ?> 
     9  <?php echo __('Log file does not exists or was purged)'); ?> 
    1210  </div> 
    1311<?php endif; ?> 
  • plugins/sfTaskLoggerPlugin/branches/1.2/modules/tl_task/templates/_length.php

    r33073 r33081  
    33  <div class="sf_admin_form_row sf_admin_boolean sf_admin_form_field"> 
    44    <div> 
    5       <label for="batch_is_ok">DurĂ©e</label> 
     5      <label for="batch_is_ok">Lenght</label> 
    66      <?php if ($tl_task->getStartedAt(null) && $tl_task->getEndedAt(null)): ?> 
    77        <?php $ended_at_var = $tl_task->getEndedAt(null); ?> 
  • plugins/sfTaskLoggerPlugin/branches/1.2/package.xml

    r33073 r33081  
    2525    <active>yes</active> 
    2626  </developer> 
    27   <date>2010-09-06</date> 
     27  <date>2011-09-23</date> 
    2828  <version> 
    29     <release>1.0.3</release> 
    30     <api>1.0.3</api> 
     29    <release>1.0.4</release> 
     30    <api>1.0.4</api> 
    3131  </version> 
    3232  <stability> 
     
    3939    <dir name="/"> 
    4040      <dir name="config"> 
     41        <dir name="doctrine"> 
     42          <file name="schema.yml" role="data" /> 
     43        </dir> 
    4144        <file name="config_handlers.yml" role="data" /> 
    4245        <file name="plugin_sftl.yml" role="data" /> 
     46        <file name="routing.yml" role="data" /> 
    4347        <file name="schema.yml" role="data" /> 
    44         <dir name="doctrine"> 
    45           <file name="schema.yml" role="data" /> 
    46         </dir> 
    4748      </dir> 
    4849      <dir name="lib"> 
     50        <dir name="filter"> 
     51          <dir name="doctrine"> 
     52          </dir> 
     53        </dir> 
     54        <dir name="form"> 
     55          <dir name="doctrine"> 
     56          </dir> 
     57        </dir> 
     58        <dir name="model"> 
     59          <dir name="doctrine"> 
     60            <file name="PlugintlTaskTableExtended.class.php" role="data" /> 
     61          </dir> 
     62        </dir> 
    4963        <dir name="task"> 
    5064          <file name="sfBaseTaskLoggerTask.class.php" role="data" /> 
    5165          <file name="sfTaskLoggerPurgeRunningTask.class.php" role="data" /> 
    5266          <file name="sfTaskLoggerSampleTask.class.php" role="data" /> 
     67        </dir> 
     68        <dir name="widget"> 
     69          <file name="sfWidgetFormSelectForText.class.php" role="data" /> 
     70        </dir> 
     71      </dir> 
     72      <dir name="modules"> 
     73        <dir name="tl_task"> 
     74          <dir name="actions"> 
     75            <file name="actions.class.php" role="data" /> 
     76          </dir> 
     77          <dir name="config"> 
     78            <file name="generator.yml" role="data" /> 
     79          </dir> 
     80          <dir name="lib"> 
     81            <dir name="filter"> 
     82              <file name="tlTaskBackendFormFilter.class.php" role="data" /> 
     83            </dir> 
     84            <dir name="form"> 
     85              <file name="tlTaskBackendForm.class.php" role="data" /> 
     86            </dir> 
     87            <dir name="model"> 
     88            </dir> 
     89            <file name="tl_taskGeneratorConfiguration.class.php" role="data" /> 
     90            <file name="tl_taskGeneratorHelper.class.php" role="data" /> 
     91          </dir> 
     92          <dir name="templates"> 
     93            <file name="_database_log.php" role="data" /> 
     94            <file name="_ended_at.php" role="data" /> 
     95            <file name="_file_log.php" role="data" /> 
     96            <file name="_length.php" role="data" /> 
     97            <file name="_started_at.php" role="data" /> 
     98          </dir> 
    5399        </dir> 
    54100      </dir> 
     
    86132      </stability> 
    87133      <license uri="http://www.symfony-project.com/license">MIT license</license> 
    88       <date>2011-09-22</date> 
    89       <license>MIT</license> 
    90       <notes> 
    91         * Fixed typos in README 
    92         * Added a full admin generator module for Doctrine (tested on symfony 1.4) 
    93         * Fixed event dispatcher object in order to avoid core log messages  
     134      <date>2011-09-23</date> 
     135      <license>MIT</license> 
     136      <notes> 
     137        * Updated the sample task 
     138        * Fixed and updated the documentation 
     139        * Added a full admin generator module for Doctrine (tested with symfony 1.4) 
     140        * Fixed event dispatcher object in order to avoid core log messages 
    94141      </notes> 
    95142    </release> 
     
    107154      <license>MIT</license> 
    108155      <notes> 
    109         * added an admin comment when purging batchs 
    110         * verbose console output problem solved (readme) 
     156        * Added an admin comment when purging batchs 
     157        * Verbose console output problem solved (readme) 
    111158      </notes> 
    112159    </release>