sfWebDebugUpgrade.class.php 1008 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. /*
  3. * This file is part of the symfony package.
  4. * (c) Fabien Potencier <fabien.potencier@symfony-project.com>
  5. *
  6. * For the full copyright and license information, please view the LICENSE
  7. * file that was distributed with this source code.
  8. */
  9. /**
  10. * Upgrade web debug.
  11. *
  12. * @package symfony
  13. * @subpackage task
  14. * @author Fabien Potencier <fabien.potencier@symfony-project.com>
  15. * @version SVN: $Id: sfWebDebugUpgrade.class.php 7397 2008-02-08 06:48:35Z fabien $
  16. */
  17. class sfWebDebugUpgrade extends sfUpgrade
  18. {
  19. public function upgrade()
  20. {
  21. $filtersFinder = $this->getFinder('file')->name('filters.yml');
  22. foreach ($filtersFinder->in($this->getProjectConfigDirectories()) as $file)
  23. {
  24. $content = file_get_contents($file);
  25. $content = preg_replace("#web_debug\:\s+~\s*\n#s", '', $content, -1, $count);
  26. if ($count)
  27. {
  28. $this->logSection('web_debug', sprintf('Migrating %s', $file));
  29. file_put_contents($file, $content);
  30. }
  31. }
  32. }
  33. }