Development

/branches/1.4/lib/task/project/validation/sfDeprecatedPluginsValidation.class.php

You must first sign up to be able to contribute.

root/branches/1.4/lib/task/project/validation/sfDeprecatedPluginsValidation.class.php

Revision 25410, 1.5 kB (checked in by fabien, 4 years ago)

[1.2, 1.3, 1.4] changed project:validate task to strip comments in PHP classes to avoid false positives (refs #7852)

  • Property svn:mime-type set to text/x-php
  • 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  * Finds deprecated plugins usage.
13  *
14  * @package    symfony
15  * @subpackage task
16  * @author     Fabien Potencier <fabien.potencier@symfony-project.com>
17  * @version    SVN: $Id$
18  */
19 class sfDeprecatedPluginsValidation extends sfValidation
20 {
21   public function getHeader()
22   {
23     return 'Checking usage of deprecated plugins';
24   }
25
26   public function getExplanation()
27   {
28     return array(
29           '',
30           '  The files above use deprecated plugins',
31           '  that have been removed in symfony 1.4.',
32           '',
33           'You can probably remove those references safely.',
34           '',
35     );
36   }
37
38   public function validate()
39   {
40     $found = array();
41     $files = sfFinder::type('file')->name('*Configuration.class.php')->in($this->getProjectConfigDirectories());
42     foreach ($files as $file)
43     {
44       $content = sfToolkit::stripComments(file_get_contents($file));
45
46       $matches = array();
47       if (false !== strpos($content, 'sfCompat10Plugin'))
48       {
49         $matches[] = 'sfCompat10Plugin';
50       }
51       if (false !== strpos($content, 'sfProtoculousPlugin'))
52       {
53         $matches[] = 'sfProtoculousPlugin';
54       }
55
56       if ($matches)
57       {
58         $found[$file] = implode(', ', $matches);
59       }
60     }
61
62     return $found;
63   }
64 }
65
Note: See TracBrowser for help on using the browser.