|
Revision 7397, 1.1 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 sfComponentUpgrade extends sfUpgrade |
|---|
| 20 |
{ |
|---|
| 21 |
public function upgrade() |
|---|
| 22 |
{ |
|---|
| 23 |
$phpFinder = $this->getFinder('file')->name('*.php'); |
|---|
| 24 |
$dirs = glob(sfConfig::get('sf_apps_dir').'/*/modules/*/actions'); |
|---|
| 25 |
foreach ($phpFinder->in($dirs) as $file) |
|---|
| 26 |
{ |
|---|
| 27 |
$content = file_get_contents($file); |
|---|
| 28 |
$content = str_replace( |
|---|
| 29 |
array('$this->sendEmail', '$this->getPresentationFor'), |
|---|
| 30 |
array('$this->getController()->sendEmail', '$this->getController()->getPresentationFor'), |
|---|
| 31 |
$content, $count |
|---|
| 32 |
); |
|---|
| 33 |
if ($count) |
|---|
| 34 |
{ |
|---|
| 35 |
$this->logSection('component', sprintf('Migrating %s', $file)); |
|---|
| 36 |
file_put_contents($file, $content); |
|---|
| 37 |
} |
|---|
| 38 |
} |
|---|
| 39 |
} |
|---|
| 40 |
} |
|---|
| 41 |
|
|---|