Development

/branches/1.1/lib/task/project/upgrade1.1/sfWebDebugUpgrade.class.php

You must first sign up to be able to contribute.

root/branches/1.1/lib/task/project/upgrade1.1/sfWebDebugUpgrade.class.php

Revision 7397, 0.9 kB (checked in by fabien, 6 years ago)

added sfTask::log() and sfTask::logSection() shortcuts

  • 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) 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  * Upgrade web debug.
13  *
14  * @package    symfony
15  * @subpackage task
16  * @author     Fabien Potencier <fabien.potencier@symfony-project.com>
17  * @version    SVN: $Id$
18  */
19 class sfWebDebugUpgrade extends sfUpgrade
20 {
21   public function upgrade()
22   {
23     $filtersFinder = $this->getFinder('file')->name('filters.yml');
24     foreach ($filtersFinder->in($this->getProjectConfigDirectories()) as $file)
25     {
26       $content = file_get_contents($file);
27       $content = preg_replace("#web_debug\:\s+~\s*\n#s", '', $content, -1, $count);
28       if ($count)
29       {
30         $this->logSection('web_debug', sprintf('Migrating %s', $file));
31         file_put_contents($file, $content);
32       }
33     }
34   }
35 }
36
Note: See TracBrowser for help on using the browser.