Development

/branches/1.1/lib/task/log/sfLogClearTask.class.php

You must first sign up to be able to contribute.

root/branches/1.1/lib/task/log/sfLogClearTask.class.php

Revision 8148, 1.0 kB (checked in by fabien, 6 years ago)

made sfFinder::ignore_version_control the default (you can disable it by calling ignore_version_control(false)) (refs #2795)

  • Property svn:mime-type set to text/x-php
  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
Line 
1 <?php
2
3 /*
4  * This file is part of the symfony package.
5  * (c) 2004-2006 Fabien Potencier <fabien.potencier@symfony-project.com>
6  *
7  * For the full copyright and license information, please view the LICENSE
8  * file that was distributed with this source code.
9  */
10
11 /**
12  * Clears log files.
13  *
14  * @package    symfony
15  * @subpackage task
16  * @author     Fabien Potencier <fabien.potencier@symfony-project.com>
17  * @version    SVN: $Id$
18  */
19 class sfLogClearTask extends sfBaseTask
20 {
21   /**
22    * @see sfTask
23    */
24   protected function configure()
25   {
26     $this->aliases = array('log-purge');
27     $this->namespace = 'log';
28     $this->name = 'clear';
29     $this->briefDescription = 'Clears log files';
30
31     $this->detailedDescription = <<<EOF
32 The [log:clear|INFO] task clears all symfony log files:
33
34   [./symfony log:clear|INFO]
35 EOF;
36   }
37
38   /**
39    * @see sfTask
40    */
41   protected function execute($arguments = array(), $options = array())
42   {
43     $logs = sfFinder::type('file')->in(sfConfig::get('sf_log_dir'));
44     $this->getFilesystem()->remove($logs);
45   }
46 }
47
Note: See TracBrowser for help on using the browser.