1. sfLogClearTask.class.php
  2. /** * Clears log files. * * @package symfony * @subpackage task * @author Fabien Potencier * @version SVN: $Id: sfLogClearTask.class.php 23922 2009-11-14 14:58:38Z fabien $ */
  3. class sfLogClearTask extends sfBaseTask
  4. {
  5. /**
  6. * @see sfTask
  7. */
  8. protected function configure()
  9. {
  10. $this->namespace = 'log';
  11. $this->name = 'clear';
  12. $this->briefDescription = 'Clears log files';
  13. $this->detailedDescription = <<<EOF
  14. The [log:clear|INFO] task clears all symfony log files:
  15. [./symfony log:clear|INFO]
  16. EOF;
  17. }
  18. /**
  19. * @see sfTask
  20. */
  21. protected function execute($arguments = array(), $options = array())
  22. {
  23. $logs = sfFinder::type('file')->in(sfConfig::get('sf_log_dir'));
  24. $this->getFilesystem()->remove($logs);
  25. }
  26. }

Debug toolbar