Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
Tomáš Trávníček
doctrine-dbal
Commits
99629012
Commit
99629012
authored
Nov 01, 2014
by
Antonio Vilar
Committed by
Marco Pivetta
May 02, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Used connection params in cache key generation
parent
1b3c36b4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
4 deletions
+9
-4
QueryCacheProfile.php
lib/Doctrine/DBAL/Cache/QueryCacheProfile.php
+8
-3
Connection.php
lib/Doctrine/DBAL/Connection.php
+1
-1
No files found.
lib/Doctrine/DBAL/Cache/QueryCacheProfile.php
View file @
99629012
...
...
@@ -88,17 +88,22 @@ class QueryCacheProfile
}
/**
* Generates the real cache key from query, params
and type
s.
* Generates the real cache key from query, params
, types and connection parameter
s.
*
* @param string $query
* @param array $params
* @param array $types
* @param array $connectionParams
*
* @return array
*/
public
function
generateCacheKeys
(
$query
,
$params
,
$types
)
public
function
generateCacheKeys
(
$query
,
$params
,
$types
,
$connectionParams
=
array
()
)
{
$realCacheKey
=
$query
.
"-"
.
serialize
(
$params
)
.
"-"
.
serialize
(
$types
);
$realCacheKey
=
'query='
.
$query
.
'¶ms='
.
serialize
(
$params
)
.
'&types='
.
serialize
(
$types
)
.
(
!
empty
(
$connectionParams
)
?
serialize
(
$connectionParams
)
:
''
);
// should the key be automatically generated using the inputs or is the cache key set?
if
(
$this
->
cacheKey
===
null
)
{
$cacheKey
=
sha1
(
$realCacheKey
);
...
...
lib/Doctrine/DBAL/Connection.php
View file @
99629012
...
...
@@ -879,7 +879,7 @@ class Connection implements DriverConnection
throw
CacheException
::
noResultDriverConfigured
();
}
list
(
$cacheKey
,
$realKey
)
=
$qcp
->
generateCacheKeys
(
$query
,
$params
,
$types
);
list
(
$cacheKey
,
$realKey
)
=
$qcp
->
generateCacheKeys
(
$query
,
$params
,
$types
,
$this
->
getParams
()
);
// fetch the row pointers entry
if
(
$data
=
$resultCache
->
fetch
(
$cacheKey
))
{
...
...
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