Changeset 33081
- Timestamp:
- 09/23/11 15:30:39 (2 years ago)
- Files:
-
- plugins/sfTaskLoggerPlugin/branches/1.2/README (modified) (4 diffs)
- plugins/sfTaskLoggerPlugin/branches/1.2/config/routing.yml (added)
- plugins/sfTaskLoggerPlugin/branches/1.2/lib/task/sfTaskLoggerSampleTask.class.php (modified) (1 diff)
- plugins/sfTaskLoggerPlugin/branches/1.2/lib/widget (added)
- plugins/sfTaskLoggerPlugin/branches/1.2/lib/widget/sfWidgetFormSelectForText.class.php (added)
- plugins/sfTaskLoggerPlugin/branches/1.2/modules/tl_task/config/generator.yml (modified) (3 diffs)
- plugins/sfTaskLoggerPlugin/branches/1.2/modules/tl_task/lib/filter/tlTaskBackendFormFilter.class.php (modified) (2 diffs)
- plugins/sfTaskLoggerPlugin/branches/1.2/modules/tl_task/lib/form/tlTaskBackendForm.class.php (modified) (1 diff)
- plugins/sfTaskLoggerPlugin/branches/1.2/modules/tl_task/templates/_file_log.php (modified) (1 diff)
- plugins/sfTaskLoggerPlugin/branches/1.2/modules/tl_task/templates/_length.php (modified) (1 diff)
- plugins/sfTaskLoggerPlugin/branches/1.2/package.xml (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
plugins/sfTaskLoggerPlugin/branches/1.2/README
r33073 r33081 48 48 $ symfony plugin:install sfTaskLoggerPlugin 49 49 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/`) 51 51 52 52 * Build the new plugin table and associated models: 53 53 54 $ symfony doctrine:build-all-reload54 $ ./symfony doctrine:build --all-classes --db --and-load --env=dev 55 55 (or launch each "build" task individually) 56 56 … … 63 63 > 64 64 > * 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` 66 66 67 67 * Clear you cache … … 274 274 enabled_modules: [default, tl_task] 275 275 276 After having generated all the model files of the plugin, edit the 277 `/lib/model/doctrine/sfTaskLoggerPlugin/tlTaskTable.class.php` class and make it 278 extend 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 299 Then 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 276 304 Notes 277 305 ===== … … 303 331 ==== 304 332 305 * Include model functions to get the list of already executed task306 * TestPropel version333 * V1.1.0: Advanced features to keep a state of "processed objects" 334 * V1.0.5: Test the Propel version 307 335 308 336 Support 309 337 ======= 310 338 311 Pleasereport bugs on the symfony TRAC, I could also answer if you ask on the312 symfony mailing list or IRC.339 Send me an email or report bugs on the symfony TRAC, I could also answer if you ask on the 340 symfony mailing list. 313 341 314 342 Changelog plugins/sfTaskLoggerPlugin/branches/1.2/lib/task/sfTaskLoggerSampleTask.class.php
r30989 r33081 65 65 { 66 66 $this->printAndLog(' - This is a log info !!'); 67 $rand = rand(1, 5); 68 $this->printAndLog(sprintf(' - Sleeping... for... %d seconds...', $rand)); 69 sleep($rand); 67 70 $this->task->setErrorCode(self::ERROR_CODE_SUCCESS); 68 71 $this->setOk(); plugins/sfTaskLoggerPlugin/branches/1.2/modules/tl_task/config/generator.yml
r33073 r33081 2 2 class: sfDoctrineGenerator 3 3 param: 4 theme: ~5 4 model_class: tlTask 6 non_verbose_templates: ~ 7 with_show: ~ 5 theme: admin 6 non_verbose_templates: true 7 with_show: false 8 8 singular: ~ 9 9 plural: ~ 10 10 route_prefix: tl_task 11 11 with_doctrine_route: true 12 actions_base_class: ~12 actions_base_class: sfActions 13 13 14 14 config: 15 actions: 16 launch: ~ 17 run: ~ 15 actions: ~ 18 16 19 17 fields: … … 43 41 object_actions: 44 42 _edit: { label: "Edit/show" } 45 actions: ~43 actions: { } 46 44 47 45 filter: … … 57 55 "Stats": [started_at, is_running, ended_at, _length, count_processed, count_not_processed] 58 56 "Logs": [log_file, _file_log, log, _database_log] 59 "Admin": [comments, created_at ]57 "Admin": [comments, created_at, updated_at] 60 58 61 59 edit: 62 60 title: Edition / view of task "%%id%%" 61 62 new: ~ plugins/sfTaskLoggerPlugin/branches/1.2/modules/tl_task/lib/filter/tlTaskBackendFormFilter.class.php
r33073 r33081 5 5 * 6 6 * @author COil 7 * @since 5 aug 20107 * @since 23 sept 2011 8 8 */ 9 9 … … 24 24 protected function _setWidgets() 25 25 { 26 $this->widgetSchema['id'] = new sfWidgetFormFilterInput();27 $this->widgetSchema['task'] = new BoWidgetFormFilterSelect(26 $this->widgetSchema['id'] = new sfWidgetFormFilterInput(); 27 $this->widgetSchema['task'] = new sfWidgetFormSelectForText( 28 28 array( 29 29 'choices' => Doctrine::getTable('tlTask')->getTasksList() plugins/sfTaskLoggerPlugin/branches/1.2/modules/tl_task/lib/form/tlTaskBackendForm.class.php
r33073 r33081 27 27 $this->widgetSchema['options']->setAttribute('size', 100); 28 28 $this->widgetSchema['arguments']->setAttribute('size', 100); 29 $this->widgetSchema['log']->setAttribute('cols', 100); 30 $this->widgetSchema['comments']->setAttribute('cols', 100); 29 31 } 30 32 } plugins/sfTaskLoggerPlugin/branches/1.2/modules/tl_task/templates/_file_log.php
r33073 r33081 2 2 <?php if ($log_file && file_exists($log_file)): ?> 3 3 <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)); ?> 7 5 </pre> 8 6 </div> 9 7 <?php else: ?> 10 8 <div style="margin: 20px"> 11 <?php echo __('Log file was not recorded (orpurged)'); ?>9 <?php echo __('Log file does not exists or was purged)'); ?> 12 10 </div> 13 11 <?php endif; ?> plugins/sfTaskLoggerPlugin/branches/1.2/modules/tl_task/templates/_length.php
r33073 r33081 3 3 <div class="sf_admin_form_row sf_admin_boolean sf_admin_form_field"> 4 4 <div> 5 <label for="batch_is_ok"> Durée</label>5 <label for="batch_is_ok">Lenght</label> 6 6 <?php if ($tl_task->getStartedAt(null) && $tl_task->getEndedAt(null)): ?> 7 7 <?php $ended_at_var = $tl_task->getEndedAt(null); ?> plugins/sfTaskLoggerPlugin/branches/1.2/package.xml
r33073 r33081 25 25 <active>yes</active> 26 26 </developer> 27 <date>201 0-09-06</date>27 <date>2011-09-23</date> 28 28 <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> 31 31 </version> 32 32 <stability> … … 39 39 <dir name="/"> 40 40 <dir name="config"> 41 <dir name="doctrine"> 42 <file name="schema.yml" role="data" /> 43 </dir> 41 44 <file name="config_handlers.yml" role="data" /> 42 45 <file name="plugin_sftl.yml" role="data" /> 46 <file name="routing.yml" role="data" /> 43 47 <file name="schema.yml" role="data" /> 44 <dir name="doctrine">45 <file name="schema.yml" role="data" />46 </dir>47 48 </dir> 48 49 <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> 49 63 <dir name="task"> 50 64 <file name="sfBaseTaskLoggerTask.class.php" role="data" /> 51 65 <file name="sfTaskLoggerPurgeRunningTask.class.php" role="data" /> 52 66 <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> 53 99 </dir> 54 100 </dir> … … 86 132 </stability> 87 133 <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 94 141 </notes> 95 142 </release> … … 107 154 <license>MIT</license> 108 155 <notes> 109 * added an admin comment when purging batchs110 * verbose console output problem solved (readme)156 * Added an admin comment when purging batchs 157 * Verbose console output problem solved (readme) 111 158 </notes> 112 159 </release>