|
Revision 10628, 1.1 kB
(checked in by fabien, 5 years ago)
|
introduced send_http_header setting for the response + added an upgrade task
- added a new send_http_header setting for sfWebResponse
- added a project:upgrade1.2 task to upgrade a project from 1.1 to 1.2
- added a UPDATE_TO_1_2 file to explain the main changes in symfony 1.2
|
- 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 sfFactories12Upgrade 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 |
|
|---|
| 28 |
if (!preg_match('/send_http_headers/', $content)) |
|---|
| 29 |
{ |
|---|
| 30 |
$tmp = <<<EOF |
|---|
| 31 |
response: |
|---|
| 32 |
class: sfWebResponse |
|---|
| 33 |
param: |
|---|
| 34 |
send_http_headers: false |
|---|
| 35 |
|
|---|
| 36 |
EOF; |
|---|
| 37 |
|
|---|
| 38 |
$content = str_replace('test:', 'test:'."\n".$tmp, $content); |
|---|
| 39 |
|
|---|
| 40 |
$this->logSection('factories.yml', sprintf('Migrating %s', $file)); |
|---|
| 41 |
file_put_contents($file, $content); |
|---|
| 42 |
} |
|---|
| 43 |
} |
|---|
| 44 |
} |
|---|
| 45 |
} |
|---|
| 46 |
|
|---|