✏️ 编辑:sfError404Exception.class.php
路径:
/virtual/bigbrother/sns/lib/symfony/exception/sfError404Exception.class.php
大小:1.44 KB · 修改:2010-08-11 06:11:37 · 权限:0644 · 可写
← 返回目录
👁 查看
⬇ 下载
<?php /* * This file is part of the symfony package. * (c) 2004-2006 Fabien Potencier <fabien.potencier@symfony-project.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /** * sfError404Exception is thrown when a 404 error occurs in an action. * * @package symfony * @subpackage exception * @author Fabien Potencier <fabien.potencier@symfony-project.com> * @version SVN: $Id: sfError404Exception.class.php 11471 2008-09-12 10:03:49Z fabien $ */ class sfError404Exception extends sfException { /** * Forwards to the 404 action. */ public function printStackTrace() { $exception = is_null($this->wrappedException) ? $this : $this->wrappedException; if (sfConfig::get('sf_debug') && !sfConfig::get('sf_test')) { $response = sfContext::getInstance()->getResponse(); if (is_null($response)) { $response = new sfWebResponse(sfContext::getInstance()->getEventDispatcher()); sfContext::getInstance()->setResponse($response); } $response->setStatusCode(404); return parent::printStackTrace(); } else { // log all exceptions in php log if (!sfConfig::get('sf_test')) { error_log($this->getMessage()); } sfContext::getInstance()->getController()->forward(sfConfig::get('sf_error_404_module'), sfConfig::get('sf_error_404_action')); } } }
💾 保存
取消
保存为 UTF-8,换行统一为 LF