Development

/branches/1.3/lib/task/project/upgrade1.3/sfAssetsUpgrade.class.php

You must first sign up to be able to contribute.

root/branches/1.3/lib/task/project/upgrade1.3/sfAssetsUpgrade.class.php

Revision 24395, 0.9 kB (checked in by Kris.Wallsmith, 5 years ago)

[1.3] updated upgrade task to specify a class for the common filter since it's no longer specified in the core (closes #7156, #7536)

  • 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  * Tries to fix the removal of the common filter.
13  *
14  * @package    symfony
15  * @subpackage task
16  * @author     Fabien Potencier <fabien.potencier@symfony-project.com>
17  * @version    SVN: $Id$
18  */
19 class sfAssetsUpgrade extends sfUpgrade
20 {
21   public function upgrade()
22   {
23     $replace = 'common:'.PHP_EOL.'  class: sfCommonFilter';
24     foreach (glob(sfConfig::get('sf_apps_dir').'/*/config/filters.yml') as $file)
25     {
26       $original = file_get_contents($file);
27       $modified = preg_replace('/^common: +~/m', $replace, $original, -1, $count);
28
29       if ($count)
30       {
31         $this->logSection('file+', $file);
32         file_put_contents($file, $modified);
33       }
34     }
35   }
36 }
37
Note: See TracBrowser for help on using the browser.