|
Revision 7397, 1.3 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 sfEnvironmentUpgrade extends sfUpgrade |
|---|
| 20 |
{ |
|---|
| 21 |
public function upgrade() |
|---|
| 22 |
{ |
|---|
| 23 |
|
|---|
| 24 |
if (file_exists(sfConfig::get('sf_data_dir').'/environment.migrated')) |
|---|
| 25 |
{ |
|---|
| 26 |
return; |
|---|
| 27 |
} |
|---|
| 28 |
|
|---|
| 29 |
$phpFinder = $this->getFinder('file')->name('*.php'); |
|---|
| 30 |
foreach ($phpFinder->in(array_merge($this->getProjectClassDirectories(), $this->getProjectConfigDirectories())) as $file) |
|---|
| 31 |
{ |
|---|
| 32 |
$content = file_get_contents($file); |
|---|
| 33 |
$content = str_replace( |
|---|
| 34 |
array('sf_cache_dir', 'sf_root_cache_dir', 'sf_base_cache_dir'), |
|---|
| 35 |
array('sf_app_cache_dir', 'sf_cache_dir', 'sf_app_base_cache_dir'), |
|---|
| 36 |
$content, $count |
|---|
| 37 |
); |
|---|
| 38 |
|
|---|
| 39 |
if ($count) |
|---|
| 40 |
{ |
|---|
| 41 |
$this->logSection('environment', sprintf('Migrating %s', $file)); |
|---|
| 42 |
file_put_contents($file, $content); |
|---|
| 43 |
} |
|---|
| 44 |
} |
|---|
| 45 |
|
|---|
| 46 |
touch(sfConfig::get('sf_data_dir').'/environment.migrated'); |
|---|
| 47 |
} |
|---|
| 48 |
} |
|---|
| 49 |
|
|---|