|
Revision 7397, 1.2 kB
(checked in by fabien, 5 years ago)
|
added sfTask::log() and sfTask::logSection() shortcuts
|
- 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 sfFactoriesUpgrade extends sfUpgrade |
|---|
| 20 |
{ |
|---|
| 21 |
public function upgrade() |
|---|
| 22 |
{ |
|---|
| 23 |
$phpFinder = $this->getFinder('file')->name('factories.yml'); |
|---|
| 24 |
foreach ($phpFinder->in($this->getProjectConfigDirectories()) as $file) |
|---|
| 25 |
{ |
|---|
| 26 |
$content = file_get_contents($file); |
|---|
| 27 |
$content = str_replace('automaticCleaningFactor', 'automatic_cleaning_factor', $content, $count1); |
|---|
| 28 |
$content = str_replace('cacheDir', 'cache_dir', $content, $count2); |
|---|
| 29 |
|
|---|
| 30 |
if ($count1 || $count2) |
|---|
| 31 |
{ |
|---|
| 32 |
$content = preg_replace('/^((.+)automatic_cleaning_factor:(\s+)(.+?))$/m', "$1\n$2prefix:$3 %SF_APP_DIR%", $content); |
|---|
| 33 |
|
|---|
| 34 |
$this->logSection('factories.yml', sprintf('Migrating %s', $file)); |
|---|
| 35 |
file_put_contents($file, $content); |
|---|
| 36 |
} |
|---|
| 37 |
} |
|---|
| 38 |
} |
|---|
| 39 |
} |
|---|
| 40 |
|
|---|