From 682c0a346f68e82c1371297557ed51d1bbbdbb8f Mon Sep 17 00:00:00 2001 From: Qiang Xue Date: Sat, 6 Jul 2013 17:05:29 -0400 Subject: [PATCH] Added trace messages. --- framework/yii/base/Action.php | 3 +++ framework/yii/base/Controller.php | 1 + framework/yii/base/InlineAction.php | 3 +++ framework/yii/web/Application.php | 1 + 4 files changed, 8 insertions(+) diff --git a/framework/yii/base/Action.php b/framework/yii/base/Action.php index 8778cab..1b3efbb 100644 --- a/framework/yii/base/Action.php +++ b/framework/yii/base/Action.php @@ -7,6 +7,8 @@ namespace yii\base; +use Yii; + /** * Action is the base class for all controller action classes. * @@ -75,6 +77,7 @@ class Action extends Component throw new InvalidConfigException(get_class($this) . ' must define a "run()" method.'); } $args = $this->controller->bindActionParams($this, $params); + Yii::trace('Running "' . get_class($this) . '::run()" with parameters: ' . var_export($args, true), __METHOD__); return call_user_func_array(array($this, 'run'), $args); } } diff --git a/framework/yii/base/Controller.php b/framework/yii/base/Controller.php index 471fc63..3f924a3 100644 --- a/framework/yii/base/Controller.php +++ b/framework/yii/base/Controller.php @@ -107,6 +107,7 @@ class Controller extends Component { $action = $this->createAction($id); if ($action !== null) { + Yii::trace("Route to run: " . $action->getUniqueId(), __METHOD__); $oldAction = $this->action; $this->action = $action; $result = null; diff --git a/framework/yii/base/InlineAction.php b/framework/yii/base/InlineAction.php index 75728e0..8a9da85 100644 --- a/framework/yii/base/InlineAction.php +++ b/framework/yii/base/InlineAction.php @@ -7,6 +7,8 @@ namespace yii\base; +use Yii; + /** * InlineAction represents an action that is defined as a controller method. * @@ -44,6 +46,7 @@ class InlineAction extends Action public function runWithParams($params) { $args = $this->controller->bindActionParams($this, $params); + Yii::trace("Running '" . get_class($this->controller) . '::' . $this->actionMethod . "()' with parameters: " . var_export($args, true), __METHOD__); return call_user_func_array(array($this->controller, $this->actionMethod), $args); } } diff --git a/framework/yii/web/Application.php b/framework/yii/web/Application.php index 242a0db..0d1e1a3 100644 --- a/framework/yii/web/Application.php +++ b/framework/yii/web/Application.php @@ -65,6 +65,7 @@ class Application extends \yii\base\Application $params = array_splice($this->catchAll, 1); } try { + Yii::trace("Route requested: '$route'", __METHOD__); $result = $this->runAction($route, $params); if ($result instanceof Response) { return $result;