Browse Source

Merge branch 'master' of github.com:yiisoft/yii2

tags/2.0.0-beta
Paul Klimov 11 years ago
parent
commit
d1f18e43f7
  1. 32
      build/controllers/PhpDocController.php
  2. 2
      framework/yii/base/Application.php
  3. 2
      framework/yii/db/ActiveRecord.php
  4. 3
      framework/yii/mail/BaseMailer.php
  5. 2
      framework/yii/mail/BaseMessage.php
  6. 2
      framework/yii/web/Controller.php
  7. 20
      framework/yii/web/Request.php

32
build/controllers/PhpDocController.php

@ -278,11 +278,35 @@ class PhpDocController extends Controller
. ' See [[get'.ucfirst($propName).'()]] and [[set'.ucfirst($propName).'()]] for details.';
}
} elseif (isset($prop['get'])) {
$note = ' This property is read-only.';
// $docline .= '-read';
// check if parent class has setter defined
$c = $className;
$parentSetter = false;
while($parent = get_parent_class($c)) {
if (method_exists($parent, 'set' . ucfirst($propName))) {
$parentSetter = true;
break;
}
$c = $parent;
}
if (!$parentSetter) {
$note = ' This property is read-only.';
// $docline .= '-read';
}
} elseif (isset($prop['set'])) {
$note = ' This property is write-only.';
// $docline .= '-write';
// check if parent class has getter defined
$c = $className;
$parentGetter = false;
while($parent = get_parent_class($c)) {
if (method_exists($parent, 'set' . ucfirst($propName))) {
$parentGetter = true;
break;
}
$c = $parent;
}
if (!$parentGetter) {
$note = ' This property is write-only.';
// $docline .= '-write';
}
} else {
continue;
}

2
framework/yii/base/Application.php

@ -15,6 +15,7 @@ use yii\web\HttpException;
* Application is the base class for all application classes.
*
* @property \yii\rbac\Manager $authManager The auth manager for this application. This property is read-only.
* @property string $basePath The root directory of the application.
* @property \yii\caching\Cache $cache The cache application component. Null if the component is not enabled.
* This property is read-only.
* @property \yii\db\Connection $db The database connection. This property is read-only.
@ -261,6 +262,7 @@ abstract class Application extends Module
* Sets the root directory of the applicaition and the @app alias.
* This method can only be invoked at the beginning of the constructor.
* @param string $path the root directory of the application.
* @property string the root directory of the application.
* @throws InvalidParamException if the directory does not exist.
*/
public function setBasePath($path)

2
framework/yii/db/ActiveRecord.php

@ -29,6 +29,8 @@ use yii\helpers\Inflector;
* @property mixed $oldPrimaryKey The old primary key value. An array (column name => column value) is
* returned if the primary key is composite or `$asArray` is true. A string is returned otherwise (null will be
* returned if the key value is null). This property is read-only.
* @property array $populatedRelations An array of relation data indexed by relation names. This property is
* read-only.
* @property mixed $primaryKey The primary key value. An array (column name => column value) is returned if
* the primary key is composite or `$asArray` is true. A string is returned otherwise (null will be returned if
* the key value is null). This property is read-only.

3
framework/yii/mail/BaseMailer.php

@ -20,7 +20,8 @@ use yii\web\View;
*
* @see BaseMessage
*
* @property View|array $view view instance or its array configuration.
* @property View $view View instance. Note that the type of this property differs in getter and setter. See
* [[getView()]] and [[setView()]] for details.
*
* @author Paul Klimov <klimov.paul@gmail.com>
* @since 2.0

2
framework/yii/mail/BaseMessage.php

@ -18,7 +18,7 @@ use Yii;
*
* @see BaseMailer
*
* @property BaseMailer $mailer mailer component instance. This property is read-only.
* @property MailerInterface $mailer The mailer component. This property is read-only.
*
* @author Paul Klimov <klimov.paul@gmail.com>
* @since 2.0

2
framework/yii/web/Controller.php

@ -14,6 +14,8 @@ use yii\helpers\Html;
/**
* Controller is the base class of web controllers.
*
* @property string $canonicalUrl This property is read-only.
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @since 2.0
*/

20
framework/yii/web/Request.php

@ -31,6 +31,8 @@ use yii\helpers\Security;
* @property string $csrfToken The random token for CSRF validation. This property is read-only.
* @property string $csrfTokenFromHeader The CSRF token sent via [[CSRF_HEADER]] by browser. Null is returned
* if no such header is sent. This property is read-only.
* @property array $delete The DELETE request parameter values. This property is read-only.
* @property array $get The GET request parameter values. This property is read-only.
* @property string $hostInfo Schema and hostname part (with port number if needed) of the request URL (e.g.
* `http://www.yiiframework.com`).
* @property boolean $isAjax Whether this is an AJAX (XMLHttpRequest) request. This property is read-only.
@ -47,11 +49,14 @@ use yii\helpers\Security;
* read-only.
* @property string $method Request method, such as GET, POST, HEAD, PUT, PATCH, DELETE. The value returned is
* turned into upper case. This property is read-only.
* @property array $patch The PATCH request parameter values. This property is read-only.
* @property string $pathInfo Part of the request URL that is after the entry script and before the question
* mark. Note, the returned path info is already URL-decoded.
* @property integer $port Port number for insecure requests.
* @property array $post The POST request parameter values. This property is read-only.
* @property string $preferredLanguage The language that the application should use. Null is returned if both
* [[getAcceptedLanguages()]] and `$languages` are empty. This property is read-only.
* @property array $put The PUT request parameter values. This property is read-only.
* @property string $queryString Part of the request URL that is after the question mark. This property is
* read-only.
* @property string $rawBody The request body. This property is read-only.
@ -304,12 +309,22 @@ class Request extends \yii\base\Request
}
/**
* Returns the GET request parameter values.
* @return array the GET request parameter values
*/
public function getGet()
{
return $_GET;
}
/**
* Returns the named POST parameter value.
* If the POST parameter does not exist, the second parameter to this method will be returned.
* @param string $name the POST parameter name. If not specified, whole $_POST is returned.
* @param mixed $defaultValue the default parameter value if the POST parameter does not exist.
* @property array the POST request parameter values
* @return mixed the POST parameter value
* @see getParam
* @see get
*/
public function getPost($name = null, $defaultValue = null)
{
@ -323,6 +338,7 @@ class Request extends \yii\base\Request
* Returns the named DELETE parameter value.
* @param string $name the DELETE parameter name. If not specified, an array of DELETE parameters is returned.
* @param mixed $defaultValue the default parameter value if the DELETE parameter does not exist.
* @property array the DELETE request parameter values
* @return mixed the DELETE parameter value
*/
public function getDelete($name = null, $defaultValue = null)
@ -337,6 +353,7 @@ class Request extends \yii\base\Request
* Returns the named PUT parameter value.
* @param string $name the PUT parameter name. If not specified, an array of PUT parameters is returned.
* @param mixed $defaultValue the default parameter value if the PUT parameter does not exist.
* @property array the PUT request parameter values
* @return mixed the PUT parameter value
*/
public function getPut($name = null, $defaultValue = null)
@ -351,6 +368,7 @@ class Request extends \yii\base\Request
* Returns the named PATCH parameter value.
* @param string $name the PATCH parameter name. If not specified, an array of PATCH parameters is returned.
* @param mixed $defaultValue the default parameter value if the PATCH parameter does not exist.
* @property array the PATCH request parameter values
* @return mixed the PATCH parameter value
*/
public function getPatch($name = null, $defaultValue = null)

Loading…
Cancel
Save