|
Revision 25410, 1.5 kB
(checked in by fabien, 3 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 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 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 |
|
|---|