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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
ff4307be
Commit
ff4307be
authored
May 22, 2014
by
MDMunir
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2 from yiisoft/master
merge
parents
8f8ec23d
bfb39ed8
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
34 additions
and
2 deletions
+34
-2
README.md
README.md
+1
-0
intro-upgrade-from-v1.md
docs/guide/intro-upgrade-from-v1.md
+11
-0
CHANGELOG.md
framework/CHANGELOG.md
+1
-0
RateLimiter.php
framework/filters/RateLimiter.php
+1
-1
HtmlTest.php
tests/unit/framework/helpers/HtmlTest.php
+20
-1
No files found.
README.md
View file @
ff4307be
...
...
@@ -24,6 +24,7 @@ which is the latest stable release of Yii.
[
![Code Coverage
](
https://scrutinizer-ci.com/g/yiisoft/yii2/badges/coverage.png?s=31d80f1036099e9d6a3e4d7738f6b000b3c3d10e
)
](https://scrutinizer-ci.com/g/yiisoft/yii2/)
[
![Dependency Status
](
https://www.versioneye.com/php/yiisoft:yii2/dev-master/badge.png
)
](https://www.versioneye.com/php/yiisoft:yii2/dev-master)
[
![Scrutinizer Quality Score
](
https://scrutinizer-ci.com/g/yiisoft/yii2/badges/quality-score.png?s=b1074a1ff6d0b214d54fa5ab7abbb90fc092471d
)
](https://scrutinizer-ci.com/g/yiisoft/yii2/)
[
![Code Climate
](
https://codeclimate.com/github/yiisoft/yii2.png
)
](https://codeclimate.com/github/yiisoft/yii2)
DIRECTORY STRUCTURE
-------------------
...
...
docs/guide/intro-upgrade-from-v1.md
View file @
ff4307be
...
...
@@ -447,6 +447,17 @@ as arrays, which can significantly reduce the needed CPU time and memory if larg
$customers
=
Customer
::
find
()
->
asArray
()
->
all
();
```
Another change is that you can't define attribute default values through public properties anymore.
If you need those, you should set them in the init method of your record class.
```
php
public
function
init
()
{
parent
::
init
();
$this
->
status
=
self
::
STATUS_NEW
;
}
```
There are many other changes and enhancements to Active Record. Please refer to
the
[
Active Record
](
db-active-record.md
)
section for more details.
...
...
framework/CHANGELOG.md
View file @
ff4307be
...
...
@@ -29,6 +29,7 @@ Yii Framework 2 Change Log
-
Bug #3436: Fixed the issue that
`ServiceLocator`
still returns the old component after calling
`set()`
with a new definition (qiangxue)
-
Bug #3458: Fixed the bug that the image rendered by
`CaptchaAction`
was using a wrong content type (MDMunir, qiangxue)
-
Bug #3522: Fixed BaseFileHelper::normalizePath to allow a (.) for the current path. (skotos)
-
Bug #3548: Fixed the bug that X-Rate-Limit-Remaining header is always zero when using RateLimiter (qiangxue)
-
Bug: Fixed inconsistent return of
`\yii\console\Application::runAction()`
(samdark)
-
Enh #2264:
`CookieCollection::has()`
will return false for expired or removed cookies (qiangxue)
-
Enh #2435:
`yii\db\IntegrityException`
is now thrown on database integrity errors instead of general
`yii\db\Exception`
(samdark)
...
...
framework/filters/RateLimiter.php
View file @
ff4307be
...
...
@@ -110,7 +110,7 @@ class RateLimiter extends ActionFilter
throw
new
TooManyRequestsHttpException
(
$this
->
errorMessage
);
}
else
{
$user
->
saveAllowance
(
$request
,
$action
,
$allowance
-
1
,
$current
);
$this
->
addRateLimitHeaders
(
$response
,
$limit
,
0
,
(
int
)
((
$limit
-
$allowance
)
*
$window
/
$limit
));
$this
->
addRateLimitHeaders
(
$response
,
$limit
,
$allowance
-
1
,
(
int
)
((
$limit
-
$allowance
)
*
$window
/
$limit
));
}
}
...
...
tests/unit/framework/helpers/HtmlTest.php
View file @
ff4307be
...
...
@@ -293,12 +293,19 @@ EOD;
$expected
=
<<<EOD
<select name="test" size="4">
<option value="value1<>">text1<></option>
<option value="value 2">text
2</option>
<option value="value 2">text
2</option>
</select>
EOD;
$this
->
assertEqualsWithoutLE
(
$expected
,
Html
::
listBox
(
'test'
,
null
,
$this
->
getDataItems2
()));
$expected
=
<<<EOD
<select name="test" size="4">
<option value="value1<>">text1<></option>
<option value="value 2">text 2</option>
</select>
EOD;
$this
->
assertEqualsWithoutLE
(
$expected
,
Html
::
listBox
(
'test'
,
null
,
$this
->
getDataItems2
(),
[
'encodeSpaces'
=>
true
]));
$expected
=
<<<EOD
<select name="test" size="4">
<option value="value1">text1</option>
<option value="value2" selected>text2</option>
</select>
...
...
@@ -495,8 +502,20 @@ EOD;
'groups'
=>
[
'group12'
=>
[
'class'
=>
'group'
],
],
'encodeSpaces'
=>
true
,
];
$this
->
assertEqualsWithoutLE
(
$expected
,
Html
::
renderSelectOptions
([
'value111'
,
'value1'
],
$data
,
$attributes
));
$attributes
=
[
'prompt'
=>
'please select<>'
,
'options'
=>
[
'value111'
=>
[
'class'
=>
'option'
],
],
'groups'
=>
[
'group12'
=>
[
'class'
=>
'group'
],
],
];
$this
->
assertEqualsWithoutLE
(
str_replace
(
' '
,
' '
,
$expected
),
Html
::
renderSelectOptions
([
'value111'
,
'value1'
],
$data
,
$attributes
));
}
public
function
testRenderAttributes
()
...
...
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