Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Rotua Panjaitan
yii2
Commits
2105f092
Commit
2105f092
authored
Mar 26, 2014
by
Qiang Xue
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
git://github.com/yiisoft/yii2
parents
78136d42
f93d871c
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
25 additions
and
29 deletions
+25
-29
TypeDoc.php
extensions/apidoc/models/TypeDoc.php
+2
-2
BaseRenderer.php
extensions/apidoc/renderers/BaseRenderer.php
+4
-4
api.php
extensions/apidoc/templates/bootstrap/layouts/api.php
+1
-0
Command.php
extensions/elasticsearch/Command.php
+3
-3
BaseActiveRecord.php
framework/db/BaseActiveRecord.php
+5
-4
BaseArrayHelper.php
framework/helpers/BaseArrayHelper.php
+1
-1
BaseMarkdown.php
framework/helpers/BaseMarkdown.php
+1
-1
BaseUrl.php
framework/helpers/BaseUrl.php
+1
-1
RateLimiter.php
framework/rest/RateLimiter.php
+1
-2
AccessControl.php
framework/web/AccessControl.php
+3
-3
UploadedFile.php
framework/web/UploadedFile.php
+3
-8
No files found.
extensions/apidoc/models/TypeDoc.php
View file @
2105f092
...
@@ -86,8 +86,8 @@ class TypeDoc extends BaseDoc
...
@@ -86,8 +86,8 @@ class TypeDoc extends BaseDoc
}
}
/**
/**
* @param
null
$visibility
* @param
string|null
$visibility
* @param
null
$definedBy
* @param
string|null
$definedBy
* @return MethodDoc[]
* @return MethodDoc[]
*/
*/
private
function
getFilteredMethods
(
$visibility
=
null
,
$definedBy
=
null
)
private
function
getFilteredMethods
(
$visibility
=
null
,
$definedBy
=
null
)
...
...
extensions/apidoc/renderers/BaseRenderer.php
View file @
2105f092
...
@@ -53,10 +53,10 @@ abstract class BaseRenderer extends Component
...
@@ -53,10 +53,10 @@ abstract class BaseRenderer extends Component
/**
/**
* creates a link to a type (class, interface or trait)
* creates a link to a type (class, interface or trait)
* @param
ClassDoc|InterfaceDoc|TraitDoc|ClassDoc[]|InterfaceDoc[]|TraitDoc
[] $types
* @param
ClassDoc|InterfaceDoc|TraitDoc|ClassDoc[]|InterfaceDoc[]|TraitDoc[]|string|string
[] $types
* @param
string $title
a title to be used for the link TODO check whether [[yii\...|Class]] is supported
* @param
string $title
a title to be used for the link TODO check whether [[yii\...|Class]] is supported
* @param
BaseDoc
$context
* @param
BaseDoc
$context
* @param
array
$options additional HTML attributes for the link.
* @param
array
$options additional HTML attributes for the link.
* @return string
* @return string
*/
*/
public
function
createTypeLink
(
$types
,
$context
=
null
,
$title
=
null
,
$options
=
[])
public
function
createTypeLink
(
$types
,
$context
=
null
,
$title
=
null
,
$options
=
[])
...
...
extensions/apidoc/templates/bootstrap/layouts/api.php
View file @
2105f092
...
@@ -6,6 +6,7 @@ use yii\helpers\StringHelper;
...
@@ -6,6 +6,7 @@ use yii\helpers\StringHelper;
/**
/**
* @var yii\web\View $this
* @var yii\web\View $this
* @var array $types
* @var string $content
* @var string $content
*/
*/
...
...
extensions/elasticsearch/Command.php
View file @
2105f092
...
@@ -95,7 +95,7 @@ class Command extends Component
...
@@ -95,7 +95,7 @@ class Command extends Component
*/
*/
public
function
get
(
$index
,
$type
,
$id
,
$options
=
[])
public
function
get
(
$index
,
$type
,
$id
,
$options
=
[])
{
{
return
$this
->
db
->
get
([
$index
,
$type
,
$id
],
$options
,
null
);
return
$this
->
db
->
get
([
$index
,
$type
,
$id
],
$options
);
}
}
/**
/**
...
@@ -184,7 +184,7 @@ class Command extends Component
...
@@ -184,7 +184,7 @@ class Command extends Component
{
{
$body
=
$configuration
!==
null
?
Json
::
encode
(
$configuration
)
:
null
;
$body
=
$configuration
!==
null
?
Json
::
encode
(
$configuration
)
:
null
;
return
$this
->
db
->
put
([
$index
],
$body
);
return
$this
->
db
->
put
([
$index
],
[],
$body
);
}
}
/**
/**
...
@@ -381,7 +381,7 @@ class Command extends Component
...
@@ -381,7 +381,7 @@ class Command extends Component
'mappings'
=>
(
object
)
$mappings
,
'mappings'
=>
(
object
)
$mappings
,
]);
]);
return
$this
->
db
->
put
([
'_template'
,
$name
],
$body
);
return
$this
->
db
->
put
([
'_template'
,
$name
],
[],
$body
);
}
}
...
...
framework/db/BaseActiveRecord.php
View file @
2105f092
...
@@ -81,7 +81,8 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface
...
@@ -81,7 +81,8 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface
*/
*/
private
$_attributes
=
[];
private
$_attributes
=
[];
/**
/**
* @var array old attribute values indexed by attribute names.
* @var array|null old attribute values indexed by attribute names.
* This is `null` if the record [[isNewRecord|is new]].
*/
*/
private
$_oldAttributes
;
private
$_oldAttributes
;
/**
/**
...
@@ -475,7 +476,7 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface
...
@@ -475,7 +476,7 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface
/**
/**
* Sets the old attribute values.
* Sets the old attribute values.
* All existing old attribute values will be discarded.
* All existing old attribute values will be discarded.
* @param array $values old attribute values to be set.
* @param array
|null
$values old attribute values to be set.
*/
*/
public
function
setOldAttributes
(
$values
)
public
function
setOldAttributes
(
$values
)
{
{
...
@@ -1304,8 +1305,8 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface
...
@@ -1304,8 +1305,8 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface
/**
/**
* @param array $link
* @param array $link
* @param
BaseActiveRecord
$foreignModel
* @param
ActiveRecordInterface
$foreignModel
* @param
BaseActiveRecord
$primaryModel
* @param
ActiveRecordInterface
$primaryModel
* @throws InvalidCallException
* @throws InvalidCallException
*/
*/
private
function
bindModels
(
$link
,
$foreignModel
,
$primaryModel
)
private
function
bindModels
(
$link
,
$foreignModel
,
$primaryModel
)
...
...
framework/helpers/BaseArrayHelper.php
View file @
2105f092
...
@@ -62,7 +62,7 @@ class BaseArrayHelper
...
@@ -62,7 +62,7 @@ class BaseArrayHelper
if
(
$recursive
)
{
if
(
$recursive
)
{
foreach
(
$object
as
$key
=>
$value
)
{
foreach
(
$object
as
$key
=>
$value
)
{
if
(
is_array
(
$value
)
||
is_object
(
$value
))
{
if
(
is_array
(
$value
)
||
is_object
(
$value
))
{
$object
[
$key
]
=
static
::
toArray
(
$value
,
true
);
$object
[
$key
]
=
static
::
toArray
(
$value
,
$properties
,
true
);
}
}
}
}
}
}
...
...
framework/helpers/BaseMarkdown.php
View file @
2105f092
...
@@ -82,7 +82,7 @@ class BaseMarkdown
...
@@ -82,7 +82,7 @@ class BaseMarkdown
* @return \cebe\markdown\Parser
* @return \cebe\markdown\Parser
* @throws \yii\base\InvalidParamException when an undefined flavor is given.
* @throws \yii\base\InvalidParamException when an undefined flavor is given.
*/
*/
pr
ivate
static
function
getParser
(
$flavor
)
pr
otected
static
function
getParser
(
$flavor
)
{
{
/** @var \cebe\markdown\Markdown $parser */
/** @var \cebe\markdown\Markdown $parser */
if
(
!
isset
(
static
::
$flavors
[
$flavor
]))
{
if
(
!
isset
(
static
::
$flavors
[
$flavor
]))
{
...
...
framework/helpers/BaseUrl.php
View file @
2105f092
...
@@ -108,7 +108,7 @@ class BaseUrl
...
@@ -108,7 +108,7 @@ class BaseUrl
* @return string normalized route suitable for UrlManager
* @return string normalized route suitable for UrlManager
* @throws InvalidParamException a relative route is given while there is no active controller
* @throws InvalidParamException a relative route is given while there is no active controller
*/
*/
pr
ivate
static
function
normalizeRoute
(
$route
)
pr
otected
static
function
normalizeRoute
(
$route
)
{
{
$route
=
(
string
)
$route
;
$route
=
(
string
)
$route
;
if
(
strncmp
(
$route
,
'/'
,
1
)
===
0
)
{
if
(
strncmp
(
$route
,
'/'
,
1
)
===
0
)
{
...
...
framework/rest/RateLimiter.php
View file @
2105f092
...
@@ -8,7 +8,6 @@
...
@@ -8,7 +8,6 @@
namespace
yii\rest
;
namespace
yii\rest
;
use
yii\base\Component
;
use
yii\base\Component
;
use
yii\base\Action
;
use
yii\web\Request
;
use
yii\web\Request
;
use
yii\web\Response
;
use
yii\web\Response
;
use
yii\web\TooManyRequestsHttpException
;
use
yii\web\TooManyRequestsHttpException
;
...
@@ -37,7 +36,7 @@ class RateLimiter extends Component
...
@@ -37,7 +36,7 @@ class RateLimiter extends Component
* @param RateLimitInterface $user the current user
* @param RateLimitInterface $user the current user
* @param Request $request
* @param Request $request
* @param Response $response
* @param Response $response
* @param Action $action the action to be executed
* @param
\yii\base\
Action $action the action to be executed
* @throws TooManyRequestsHttpException if rate limit exceeds
* @throws TooManyRequestsHttpException if rate limit exceeds
*/
*/
public
function
check
(
$user
,
$request
,
$response
,
$action
)
public
function
check
(
$user
,
$request
,
$response
,
$action
)
...
...
framework/web/AccessControl.php
View file @
2105f092
...
@@ -64,6 +64,7 @@ class AccessControl extends ActionFilter
...
@@ -64,6 +64,7 @@ class AccessControl extends ActionFilter
* ~~~
* ~~~
*
*
* where `$rule` is this rule, and `$action` is the current [[Action|action]] object.
* where `$rule` is this rule, and `$action` is the current [[Action|action]] object.
* `$rule` will be `null` if access is denied because none of the rules matched.
*/
*/
public
$denyCallback
;
public
$denyCallback
;
/**
/**
...
@@ -79,6 +80,7 @@ class AccessControl extends ActionFilter
...
@@ -79,6 +80,7 @@ class AccessControl extends ActionFilter
*/
*/
public
$rules
=
[];
public
$rules
=
[];
/**
/**
* Initializes the [[rules]] array by instantiating rule objects from configurations.
* Initializes the [[rules]] array by instantiating rule objects from configurations.
*/
*/
...
@@ -114,16 +116,14 @@ class AccessControl extends ActionFilter
...
@@ -114,16 +116,14 @@ class AccessControl extends ActionFilter
}
else
{
}
else
{
$this
->
denyAccess
(
$user
);
$this
->
denyAccess
(
$user
);
}
}
return
false
;
return
false
;
}
}
}
}
if
(
isset
(
$this
->
denyCallback
))
{
if
(
isset
(
$this
->
denyCallback
))
{
call_user_func
(
$this
->
denyCallback
,
$rule
,
$action
);
call_user_func
(
$this
->
denyCallback
,
null
,
$action
);
}
else
{
}
else
{
$this
->
denyAccess
(
$user
);
$this
->
denyAccess
(
$user
);
}
}
return
false
;
return
false
;
}
}
...
...
framework/web/UploadedFile.php
View file @
2105f092
...
@@ -56,6 +56,7 @@ class UploadedFile extends Object
...
@@ -56,6 +56,7 @@ class UploadedFile extends Object
*/
*/
public
$error
;
public
$error
;
/**
/**
* String output.
* String output.
* This is PHP magic method that returns string representation of an object.
* This is PHP magic method that returns string representation of an object.
...
@@ -80,7 +81,6 @@ class UploadedFile extends Object
...
@@ -80,7 +81,6 @@ class UploadedFile extends Object
public
static
function
getInstance
(
$model
,
$attribute
)
public
static
function
getInstance
(
$model
,
$attribute
)
{
{
$name
=
Html
::
getInputName
(
$model
,
$attribute
);
$name
=
Html
::
getInputName
(
$model
,
$attribute
);
return
static
::
getInstanceByName
(
$name
);
return
static
::
getInstanceByName
(
$name
);
}
}
...
@@ -95,7 +95,6 @@ class UploadedFile extends Object
...
@@ -95,7 +95,6 @@ class UploadedFile extends Object
public
static
function
getInstances
(
$model
,
$attribute
)
public
static
function
getInstances
(
$model
,
$attribute
)
{
{
$name
=
Html
::
getInputName
(
$model
,
$attribute
);
$name
=
Html
::
getInputName
(
$model
,
$attribute
);
return
static
::
getInstancesByName
(
$name
);
return
static
::
getInstancesByName
(
$name
);
}
}
...
@@ -108,8 +107,7 @@ class UploadedFile extends Object
...
@@ -108,8 +107,7 @@ class UploadedFile extends Object
*/
*/
public
static
function
getInstanceByName
(
$name
)
public
static
function
getInstanceByName
(
$name
)
{
{
$files
=
static
::
loadFiles
();
$files
=
self
::
loadFiles
();
return
isset
(
$files
[
$name
])
?
$files
[
$name
]
:
null
;
return
isset
(
$files
[
$name
])
?
$files
[
$name
]
:
null
;
}
}
...
@@ -124,7 +122,7 @@ class UploadedFile extends Object
...
@@ -124,7 +122,7 @@ class UploadedFile extends Object
*/
*/
public
static
function
getInstancesByName
(
$name
)
public
static
function
getInstancesByName
(
$name
)
{
{
$files
=
s
tatic
::
loadFiles
();
$files
=
s
elf
::
loadFiles
();
if
(
isset
(
$files
[
$name
]))
{
if
(
isset
(
$files
[
$name
]))
{
return
[
$files
[
$name
]];
return
[
$files
[
$name
]];
}
}
...
@@ -134,7 +132,6 @@ class UploadedFile extends Object
...
@@ -134,7 +132,6 @@ class UploadedFile extends Object
$results
[]
=
self
::
$_files
[
$key
];
$results
[]
=
self
::
$_files
[
$key
];
}
}
}
}
return
$results
;
return
$results
;
}
}
...
@@ -166,7 +163,6 @@ class UploadedFile extends Object
...
@@ -166,7 +163,6 @@ class UploadedFile extends Object
return
copy
(
$this
->
tempName
,
$file
);
return
copy
(
$this
->
tempName
,
$file
);
}
}
}
}
return
false
;
return
false
;
}
}
...
@@ -209,7 +205,6 @@ class UploadedFile extends Object
...
@@ -209,7 +205,6 @@ class UploadedFile extends Object
}
}
}
}
}
}
return
self
::
$_files
;
return
self
::
$_files
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment