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
dc73de10
Commit
dc73de10
authored
Feb 07, 2007
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--no commit message
--no commit message
parent
ddb45098
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
1 deletion
+26
-1
Cache.php
lib/Doctrine/Cache.php
+26
-1
No files found.
lib/Doctrine/Cache.php
View file @
dc73de10
...
...
@@ -39,6 +39,7 @@ class Doctrine_Cache extends Doctrine_Db_EventListener implements Countable, Ite
'lifeTime'
=>
3600
,
'statsSlamDefense'
=>
0.75
,
'saveSlamDefense'
=>
0.80
,
'cleanPropability'
=>
0.98
,
'statsFile'
=>
'../data/stats.cache'
,
);
/**
...
...
@@ -53,6 +54,10 @@ class Doctrine_Cache extends Doctrine_Db_EventListener implements Countable, Ite
* @var array $data current cache data array
*/
protected
$_data
;
/**
* @var boolean $success the success of last operation
*/
protected
$_success
=
false
;
/**
* constructor
*
...
...
@@ -194,6 +199,13 @@ class Doctrine_Cache extends Doctrine_Db_EventListener implements Countable, Ite
{
return
new
ArrayIterator
(
$this
->
_queries
);
}
/**
* @return boolean whether or not the last cache operation was successful
*/
public
function
isSuccessful
()
{
return
$this
->
_success
;
}
/**
* save
*
...
...
@@ -265,6 +277,8 @@ class Doctrine_Cache extends Doctrine_Db_EventListener implements Countable, Ite
$data
=
$this
->
_driver
->
fetch
(
md5
(
$query
));
$this
->
success
=
(
$data
)
?
true
:
false
;
$this
->
_data
=
$data
;
return
true
;
...
...
@@ -316,9 +330,11 @@ class Doctrine_Cache extends Doctrine_Db_EventListener implements Countable, Ite
if
(
substr
(
trim
(
strtoupper
(
$query
)),
0
,
6
)
==
'SELECT'
)
{
$this
->
add
(
$query
,
$event
->
getInvoker
()
->
getDbh
()
->
getName
());
$data
=
$this
->
_driver
->
fetch
(
md5
(
serialize
(
array
(
$query
,
$event
->
getParams
()))));
$this
->
success
=
(
$data
)
?
true
:
false
;
$this
->
_data
=
$data
;
return
true
;
...
...
@@ -326,6 +342,15 @@ class Doctrine_Cache extends Doctrine_Db_EventListener implements Countable, Ite
return
false
;
}
/**
* onExecute
* listens the onExecute event of Doctrine_Db_Statement
*
* adds the issued query to internal query stack
* and checks if cached element exists
*
* @return boolean
*/
/**
* destructor
*
...
...
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