Commit 682c0a34 by Qiang Xue

Added trace messages.

parent ec28988a
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
namespace yii\base; namespace yii\base;
use Yii;
/** /**
* Action is the base class for all controller action classes. * Action is the base class for all controller action classes.
* *
...@@ -75,6 +77,7 @@ class Action extends Component ...@@ -75,6 +77,7 @@ class Action extends Component
throw new InvalidConfigException(get_class($this) . ' must define a "run()" method.'); throw new InvalidConfigException(get_class($this) . ' must define a "run()" method.');
} }
$args = $this->controller->bindActionParams($this, $params); $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); return call_user_func_array(array($this, 'run'), $args);
} }
} }
...@@ -107,6 +107,7 @@ class Controller extends Component ...@@ -107,6 +107,7 @@ class Controller extends Component
{ {
$action = $this->createAction($id); $action = $this->createAction($id);
if ($action !== null) { if ($action !== null) {
Yii::trace("Route to run: " . $action->getUniqueId(), __METHOD__);
$oldAction = $this->action; $oldAction = $this->action;
$this->action = $action; $this->action = $action;
$result = null; $result = null;
......
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
namespace yii\base; namespace yii\base;
use Yii;
/** /**
* InlineAction represents an action that is defined as a controller method. * InlineAction represents an action that is defined as a controller method.
* *
...@@ -44,6 +46,7 @@ class InlineAction extends Action ...@@ -44,6 +46,7 @@ class InlineAction extends Action
public function runWithParams($params) public function runWithParams($params)
{ {
$args = $this->controller->bindActionParams($this, $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); return call_user_func_array(array($this->controller, $this->actionMethod), $args);
} }
} }
...@@ -65,6 +65,7 @@ class Application extends \yii\base\Application ...@@ -65,6 +65,7 @@ class Application extends \yii\base\Application
$params = array_splice($this->catchAll, 1); $params = array_splice($this->catchAll, 1);
} }
try { try {
Yii::trace("Route requested: '$route'", __METHOD__);
$result = $this->runAction($route, $params); $result = $this->runAction($route, $params);
if ($result instanceof Response) { if ($result instanceof Response) {
return $result; return $result;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment