sfViewCacheManagerUpgrade.class.php 1020 B

12345678910111213141516171819202122232425262728293031323334
  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. * Notifies sfViewCacheManager changes.
  11. *
  12. * @package symfony
  13. * @subpackage task
  14. * @author Fabien Potencier <fabien.potencier@symfony-project.com>
  15. * @version SVN: $Id$
  16. */
  17. class sfViewCacheManagerUpgrade extends sfUpgrade
  18. {
  19. public function upgrade()
  20. {
  21. $filtersFinder = $this->getFinder('file')->name('*.php');
  22. foreach ($filtersFinder->in($this->getProjectActionDirectories()) as $file)
  23. {
  24. $content = file_get_contents($file);
  25. if (preg_match("#\->(removePattern|clearGlob)\(#s", $content, $matches))
  26. {
  27. $this->logSection('cache', sprintf('Action "%s" calls the "%s()" method but the syntax has changed. Please, read the documentation and upgrade accordingly.', $file, $matches[1]), 1000);
  28. }
  29. }
  30. }
  31. }