1. sfDeprecatedConfigurationFilesValidation.class.php
  2. /** * Finds deprecated configuration files usage. * * @package symfony * @subpackage task * @author Fabien Potencier * @version SVN: $Id: sfDeprecatedConfigurationFilesValidation.class.php 24610 2009-11-30 22:07:34Z FabianLange $ */
  3. class sfDeprecatedConfigurationFilesValidation extends sfValidation
  4. {
  5. public function getHeader()
  6. {
  7. return 'Checking usage of deprecated configuration files';
  8. }
  9. public function getExplanation()
  10. {
  11. return array(
  12. '',
  13. ' The project uses deprecated configuration files',
  14. ' that have been removed in symfony 1.4 (mailer.yml, validate/*.yml)',
  15. ' or for which the format changed (generator.yml)',
  16. '',
  17. );
  18. }
  19. public function validate()
  20. {
  21. // mailer.yml
  22. $files = sfFinder::type('file')->name('mailer.yml')->in($this->getProjectConfigDirectories());
  23. $found = array();
  24. foreach ($files as $file)
  25. {
  26. $found[$file] = true;
  27. }
  28. // modules/*/validate/*.yml
  29. $files = sfFinder::type('file')->name('*.yml')->in(array_merge(
  30. glob(sfConfig::get('sf_apps_dir').'/*/modules/*/validate'),
  31. glob(sfConfig::get('sf_plugins_dir').'/*/modules/*/validate')
  32. ));
  33. foreach ($files as $file)
  34. {
  35. $found[$file] = true;
  36. }
  37. // old generator.yml
  38. $files = sfFinder::type('file')->name('generator.yml')->in(array(
  39. sfConfig::get('sf_apps_dir'),
  40. sfConfig::get('sf_plugins_dir'),
  41. ));
  42. foreach ($files as $file)
  43. {
  44. $content = file_get_contents($file);
  45. if (false !== strpos($content, 'sfPropelAdminGenerator'))
  46. {
  47. $found[$file] = true;
  48. }
  49. }
  50. return $found;
  51. }
  52. }

Debug toolbar