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
517bb664
Commit
517bb664
authored
Mar 30, 2010
by
guilhermeblanco
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[2.0] Implemented single cache lookup in AnnotationReader
parent
62e7146d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
13 deletions
+10
-13
AnnotationReader.php
lib/Doctrine/Common/Annotations/AnnotationReader.php
+10
-13
No files found.
lib/Doctrine/Common/Annotations/AnnotationReader.php
View file @
517bb664
...
...
@@ -106,10 +106,9 @@ class AnnotationReader
{
$cacheKey
=
$class
->
getName
()
.
self
::
$CACHE_SALT
;
//FIXME: Just use ->fetch(), otherwise some drivers, i.e. APC will fetch twice because they
// implement contains() in terms of fetch(), *sigh*.
if
(
$this
->
_cache
->
contains
(
$cacheKey
))
{
return
$this
->
_cache
->
fetch
(
$cacheKey
);
// Attempt to grab data from cache
if
((
$data
=
$this
->
_cache
->
fetch
(
$cacheKey
))
!==
false
)
{
return
$data
;
}
$annotations
=
$this
->
_parser
->
parse
(
$class
->
getDocComment
(),
"class "
.
$class
->
getName
());
...
...
@@ -143,12 +142,11 @@ class AnnotationReader
{
$cacheKey
=
$property
->
getDeclaringClass
()
->
getName
()
.
'$'
.
$property
->
getName
()
.
self
::
$CACHE_SALT
;
//FIXME: Just use ->fetch(), otherwise some drivers, i.e. APC will fetch twice because they
// implement contains() in terms of fetch(), *sigh*.
if
(
$this
->
_cache
->
contains
(
$cacheKey
))
{
return
$this
->
_cache
->
fetch
(
$cacheKey
);
// Attempt to grab data from cache
if
((
$data
=
$this
->
_cache
->
fetch
(
$cacheKey
))
!==
false
)
{
return
$data
;
}
$context
=
"property "
.
$property
->
getDeclaringClass
()
->
getName
()
.
"::
\$
"
.
$property
->
getName
();
$annotations
=
$this
->
_parser
->
parse
(
$property
->
getDocComment
(),
$context
);
$this
->
_cache
->
save
(
$cacheKey
,
$annotations
,
null
);
...
...
@@ -181,10 +179,9 @@ class AnnotationReader
{
$cacheKey
=
$method
->
getDeclaringClass
()
->
getName
()
.
'#'
.
$method
->
getName
()
.
self
::
$CACHE_SALT
;
//FIXME: Just use ->fetch(), otherwise some drivers, i.e. APC will fetch twice because they
// implement contains() in terms of fetch(), *sigh*.
if
(
$this
->
_cache
->
contains
(
$cacheKey
))
{
return
$this
->
_cache
->
fetch
(
$cacheKey
);
// Attempt to grab data from cache
if
((
$data
=
$this
->
_cache
->
fetch
(
$cacheKey
))
!==
false
)
{
return
$data
;
}
$context
=
"method "
.
$method
->
getDeclaringClass
()
->
getName
()
.
"::"
.
$method
->
getName
()
.
"()"
;
...
...
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