Browse Source

Added trace messages.

tags/2.0.0-beta
Qiang Xue 12 years ago
parent
commit
682c0a346f
  1. 3
      framework/yii/base/Action.php
  2. 1
      framework/yii/base/Controller.php
  3. 3
      framework/yii/base/InlineAction.php
  4. 1
      framework/yii/web/Application.php

3
framework/yii/base/Action.php

@ -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
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);
} }
} }

1
framework/yii/base/Controller.php

@ -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;

3
framework/yii/base/InlineAction.php

@ -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
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);
} }
} }

1
framework/yii/web/Application.php

@ -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;

Loading…
Cancel
Save