1. sfDeprecatedPluginsValidation.class.php
  2. /** * Finds deprecated plugins usage. * * @package symfony * @subpackage task * @author Fabien Potencier * @version SVN: $Id: sfDeprecatedPluginsValidation.class.php 25410 2009-12-15 15:19:07Z fabien $ */
  3. class sfDeprecatedPluginsValidation extends sfValidation
  4. {
  5. public function getHeader()
  6. {
  7. return 'Checking usage of deprecated plugins';
  8. }
  9. public function getExplanation()
  10. {
  11. return array(
  12. '',
  13. ' The files above use deprecated plugins',
  14. ' that have been removed in symfony 1.4.',
  15. '',
  16. 'You can probably remove those references safely.',
  17. '',
  18. );
  19. }
  20. public function validate()
  21. {
  22. $found = array();
  23. $files = sfFinder::type('file')->name('*Configuration.class.php')->in($this->getProjectConfigDirectories());
  24. foreach ($files as $file)
  25. {
  26. $content = sfToolkit::stripComments(file_get_contents($file));
  27. $matches = array();
  28. if (false !== strpos($content, 'sfCompat10Plugin'))
  29. {
  30. $matches[] = 'sfCompat10Plugin';
  31. }
  32. if (false !== strpos($content, 'sfProtoculousPlugin'))
  33. {
  34. $matches[] = 'sfProtoculousPlugin';
  35. }
  36. if ($matches)
  37. {
  38. $found[$file] = implode(', ', $matches);
  39. }
  40. }
  41. return $found;
  42. }
  43. }

Debug toolbar