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
7437e21d
Commit
7437e21d
authored
Apr 04, 2014
by
Qiang Xue
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2976 from jeicd/urlmanager_fix
Fixed UrlManager rules caching
parents
4283342e
76402ea0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
UrlManager.php
framework/web/UrlManager.php
+4
-4
No files found.
framework/web/UrlManager.php
View file @
7437e21d
...
@@ -148,9 +148,9 @@ class UrlManager extends Component
...
@@ -148,9 +148,9 @@ class UrlManager extends Component
$this
->
cache
=
Yii
::
$app
->
get
(
$this
->
cache
,
false
);
$this
->
cache
=
Yii
::
$app
->
get
(
$this
->
cache
,
false
);
}
}
if
(
$this
->
cache
instanceof
Cache
)
{
if
(
$this
->
cache
instanceof
Cache
)
{
$
k
ey
=
__CLASS__
;
$
cacheK
ey
=
__CLASS__
;
$hash
=
md5
(
json_encode
(
$this
->
rules
));
$hash
=
md5
(
json_encode
(
$this
->
rules
));
if
((
$data
=
$this
->
cache
->
get
(
$
k
ey
))
!==
false
&&
isset
(
$data
[
1
])
&&
$data
[
1
]
===
$hash
)
{
if
((
$data
=
$this
->
cache
->
get
(
$
cacheK
ey
))
!==
false
&&
isset
(
$data
[
1
])
&&
$data
[
1
]
===
$hash
)
{
$this
->
rules
=
$data
[
0
];
$this
->
rules
=
$data
[
0
];
return
;
return
;
...
@@ -177,8 +177,8 @@ class UrlManager extends Component
...
@@ -177,8 +177,8 @@ class UrlManager extends Component
}
}
$this
->
rules
=
$rules
;
$this
->
rules
=
$rules
;
if
(
isset
(
$
k
ey
,
$hash
))
{
if
(
isset
(
$
cacheK
ey
,
$hash
))
{
$this
->
cache
->
set
(
$
k
ey
,
[
$this
->
rules
,
$hash
]);
$this
->
cache
->
set
(
$
cacheK
ey
,
[
$this
->
rules
,
$hash
]);
}
}
}
}
...
...
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