|
Revision 24610, 1.8 kB
(checked in by FabianLange, 3 years ago)
|
[1.3, 1.4] added svn properties for project:validate task
|
- 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 sfDeprecatedConfigurationFilesValidation extends sfValidation |
|---|
| 20 |
{ |
|---|
| 21 |
public function getHeader() |
|---|
| 22 |
{ |
|---|
| 23 |
return 'Checking usage of deprecated configuration files'; |
|---|
| 24 |
} |
|---|
| 25 |
|
|---|
| 26 |
public function getExplanation() |
|---|
| 27 |
{ |
|---|
| 28 |
return array( |
|---|
| 29 |
'', |
|---|
| 30 |
' The project uses deprecated configuration files', |
|---|
| 31 |
' that have been removed in symfony 1.4 (mailer.yml, validate/*.yml)', |
|---|
| 32 |
' or for which the format changed (generator.yml)', |
|---|
| 33 |
'', |
|---|
| 34 |
); |
|---|
| 35 |
} |
|---|
| 36 |
|
|---|
| 37 |
public function validate() |
|---|
| 38 |
{ |
|---|
| 39 |
|
|---|
| 40 |
$files = sfFinder::type('file')->name('mailer.yml')->in($this->getProjectConfigDirectories()); |
|---|
| 41 |
$found = array(); |
|---|
| 42 |
foreach ($files as $file) |
|---|
| 43 |
{ |
|---|
| 44 |
$found[$file] = true; |
|---|
| 45 |
} |
|---|
| 46 |
|
|---|
| 47 |
|
|---|
| 48 |
$files = sfFinder::type('file')->name('*.yml')->in(array_merge( |
|---|
| 49 |
glob(sfConfig::get('sf_apps_dir').'/*/modules/*/validate'), |
|---|
| 50 |
glob(sfConfig::get('sf_plugins_dir').'/*/modules/*/validate') |
|---|
| 51 |
)); |
|---|
| 52 |
foreach ($files as $file) |
|---|
| 53 |
{ |
|---|
| 54 |
$found[$file] = true; |
|---|
| 55 |
} |
|---|
| 56 |
|
|---|
| 57 |
|
|---|
| 58 |
$files = sfFinder::type('file')->name('generator.yml')->in(array( |
|---|
| 59 |
sfConfig::get('sf_apps_dir'), |
|---|
| 60 |
sfConfig::get('sf_plugins_dir'), |
|---|
| 61 |
)); |
|---|
| 62 |
foreach ($files as $file) |
|---|
| 63 |
{ |
|---|
| 64 |
$content = file_get_contents($file); |
|---|
| 65 |
|
|---|
| 66 |
if (false !== strpos($content, 'sfPropelAdminGenerator')) |
|---|
| 67 |
{ |
|---|
| 68 |
$found[$file] = true; |
|---|
| 69 |
} |
|---|
| 70 |
} |
|---|
| 71 |
|
|---|
| 72 |
return $found; |
|---|
| 73 |
} |
|---|
| 74 |
} |
|---|
| 75 |
|
|---|