|
Revision 11471, 1.4 kB
(checked in by fabien, 5 years ago)
|
[1.2] added a lot of REST goodness to symfony 1.2 (live from symfony camp)
|
- Property svn:mime-type set to
text/x-php
- Property svn:eol-style set to
native
- Property svn:keywords set to
Id Rev Date
|
| Line | |
|---|
| 1 |
<?php |
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
class sfError404Exception extends sfException |
|---|
| 20 |
{ |
|---|
| 21 |
|
|---|
| 22 |
* Forwards to the 404 action. |
|---|
| 23 |
*/ |
|---|
| 24 |
public function printStackTrace() |
|---|
| 25 |
{ |
|---|
| 26 |
$exception = is_null($this->wrappedException) ? $this : $this->wrappedException; |
|---|
| 27 |
|
|---|
| 28 |
if (sfConfig::get('sf_debug') && !sfConfig::get('sf_test')) |
|---|
| 29 |
{ |
|---|
| 30 |
$response = sfContext::getInstance()->getResponse(); |
|---|
| 31 |
if (is_null($response)) |
|---|
| 32 |
{ |
|---|
| 33 |
$response = new sfWebResponse(sfContext::getInstance()->getEventDispatcher()); |
|---|
| 34 |
sfContext::getInstance()->setResponse($response); |
|---|
| 35 |
} |
|---|
| 36 |
|
|---|
| 37 |
$response->setStatusCode(404); |
|---|
| 38 |
|
|---|
| 39 |
return parent::printStackTrace(); |
|---|
| 40 |
} |
|---|
| 41 |
else |
|---|
| 42 |
{ |
|---|
| 43 |
|
|---|
| 44 |
if (!sfConfig::get('sf_test')) |
|---|
| 45 |
{ |
|---|
| 46 |
error_log($this->getMessage()); |
|---|
| 47 |
} |
|---|
| 48 |
|
|---|
| 49 |
sfContext::getInstance()->getController()->forward(sfConfig::get('sf_error_404_module'), sfConfig::get('sf_error_404_action')); |
|---|
| 50 |
} |
|---|
| 51 |
} |
|---|
| 52 |
} |
|---|
| 53 |
|
|---|