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
313437f3
Commit
313437f3
authored
May 23, 2014
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes #3284: Added support for checking multiple ETags by `yii\filters\HttpCache`.
parent
05525f18
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
6 deletions
+19
-6
CHANGELOG.md
framework/CHANGELOG.md
+1
-0
Application.php
framework/base/Application.php
+3
-5
HttpCache.php
framework/filters/HttpCache.php
+1
-1
Request.php
framework/web/Request.php
+14
-0
No files found.
framework/CHANGELOG.md
View file @
313437f3
...
...
@@ -48,6 +48,7 @@ Yii Framework 2 Change Log
-
Enh #3230: Added
`yii\filters\AccessControl::user`
to support access control with different actors (qiangxue)
-
Enh #3232: Added
`export()`
and
`exportAsString()`
methods to
`yii\helpers\BaseVarDumper`
(klimov-paul)
-
Enh #3252: Added support for case insensitive matching using ILIKE to PostgreSQL QueryBuilder (cebe)
-
Enh #3284: Added support for checking multiple ETags by
`yii\filters\HttpCache`
(qiangxue)
-
Enh #3298: Supported configuring
`View::theme`
using a class name (netyum, qiangxue)
-
Enh #3328:
`BaseMailer`
generates better text body from html body (armab)
-
Enh #3472: Added configurable option to encode spaces in dropDownLists and listBoxes (kartik-v)
...
...
framework/base/Application.php
View file @
313437f3
...
...
@@ -82,12 +82,10 @@ abstract class Application extends Module
/**
* @var string the namespace that controller classes are located in.
* This namespace will be used to load controller classes by prepending it to the controller
* class name.
* The default namespace is "app\controllers".
* This namespace will be used to load controller classes by prepending it to the controller class name.
* The default namespace is `app\controllers`.
*
* See also the [guide section on autoloading][guide-concept-autoloading] to learn more about
* defining namespaces and how classes are loaded.
* Please refer to the [guide about class autoloading][guide-concept-autoloading] for more details.
*/
public
$controllerNamespace
=
'app\\controllers'
;
/**
...
...
framework/filters/HttpCache.php
View file @
313437f3
...
...
@@ -153,7 +153,7 @@ class HttpCache extends ActionFilter
if
(
$lastModified
!==
null
&&
(
!
isset
(
$_SERVER
[
'HTTP_IF_MODIFIED_SINCE'
])
||
@
strtotime
(
$_SERVER
[
'HTTP_IF_MODIFIED_SINCE'
])
<
$lastModified
))
{
return
false
;
}
else
{
return
$etag
===
null
||
i
sset
(
$_SERVER
[
'HTTP_IF_NONE_MATCH'
])
&&
$_SERVER
[
'HTTP_IF_NONE_MATCH'
]
===
$etag
;
return
$etag
===
null
||
i
n_array
(
$etag
,
Yii
::
$app
->
request
->
getEtags
(),
true
)
;
}
}
...
...
framework/web/Request.php
View file @
313437f3
...
...
@@ -1136,6 +1136,20 @@ class Request extends \yii\base\Request
}
/**
* Gets the Etags.
*
* @return array The entity tags
*/
public
function
getETags
()
{
if
(
isset
(
$_SERVER
[
'HTTP_IF_NONE_MATCH'
]))
{
return
preg_split
(
'/[\s,]+/'
,
$_SERVER
[
'HTTP_IF_NONE_MATCH'
],
-
1
,
PREG_SPLIT_NO_EMPTY
);
}
else
{
return
[];
}
}
/**
* Returns the cookie collection.
* Through the returned cookie collection, you may access a cookie using the following syntax:
*
...
...
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