From ec28988a37daaf1c3ca157b753db5eb6a5057f29 Mon Sep 17 00:00:00 2001 From: Qiang Xue Date: Sat, 6 Jul 2013 08:24:33 -0400 Subject: [PATCH] Added UrlRule::name. --- framework/yii/log/Logger.php | 21 +++++++++++++-------- framework/yii/web/UrlRule.php | 7 +++++++ 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/framework/yii/log/Logger.php b/framework/yii/log/Logger.php index abe6d8b..6a36a5c 100644 --- a/framework/yii/log/Logger.php +++ b/framework/yii/log/Logger.php @@ -102,14 +102,6 @@ class Logger extends Component /** - * @var integer how many messages should be logged before they are flushed from memory and sent to targets. - * Defaults to 1000, meaning the [[flush]] method will be invoked once every 1000 messages logged. - * Set this property to be 0 if you don't want to flush messages until the application terminates. - * This property mainly affects how much memory will be taken by the logged messages. - * A smaller value means less memory, but will increase the execution time due to the overhead of [[flush()]]. - */ - public $flushInterval = 1000; - /** * @var array logged messages. This property is managed by [[log()]] and [[flush()]]. * Each log message is of the following structure: * @@ -124,10 +116,23 @@ class Logger extends Component */ public $messages = array(); /** + * @var array debug data. This property stores various types of debug data reported at + * different instrument places. + */ + public $data = array(); + /** * @var array|Target[] the log targets. Each array element represents a single [[Target|log target]] instance * or the configuration for creating the log target instance. */ public $targets = array(); + /** + * @var integer how many messages should be logged before they are flushed from memory and sent to targets. + * Defaults to 1000, meaning the [[flush]] method will be invoked once every 1000 messages logged. + * Set this property to be 0 if you don't want to flush messages until the application terminates. + * This property mainly affects how much memory will be taken by the logged messages. + * A smaller value means less memory, but will increase the execution time due to the overhead of [[flush()]]. + */ + public $flushInterval = 1000; /** * Initializes the logger by registering [[flush()]] as a shutdown function. diff --git a/framework/yii/web/UrlRule.php b/framework/yii/web/UrlRule.php index fc19ea3..4b15601 100644 --- a/framework/yii/web/UrlRule.php +++ b/framework/yii/web/UrlRule.php @@ -28,6 +28,10 @@ class UrlRule extends Object const CREATION_ONLY = 2; /** + * @var string the name of this rule. If not set, it will use [[pattern]] as the name. + */ + public $name; + /** * @var string the pattern used to parse and create the path info part of a URL. * @see host */ @@ -106,6 +110,9 @@ class UrlRule extends Object $this->verb = array(strtoupper($this->verb)); } } + if ($this->name === null) { + $this->name = $this->pattern; + } $this->pattern = trim($this->pattern, '/');