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
54610f17
Commit
54610f17
authored
May 22, 2013
by
resurtm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better naming. Additional newline. Doctype tiny fix.
parent
ebcc936a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
Dependency.php
framework/yii/caching/Dependency.php
+5
-4
No files found.
framework/yii/caching/Dependency.php
View file @
54610f17
...
@@ -27,11 +27,11 @@ abstract class Dependency extends \yii\base\Object
...
@@ -27,11 +27,11 @@ abstract class Dependency extends \yii\base\Object
public
$data
;
public
$data
;
/**
/**
* @var boolean whether this dependency is reusable or not. True value means that dependent
* @var boolean whether this dependency is reusable or not. True value means that dependent
* data for this cache dependency will
only be generated
once per request. This allows you
* data for this cache dependency will
be generated only
once per request. This allows you
* to use the same cache dependency for multiple separate cache calls while generating the same
* to use the same cache dependency for multiple separate cache calls while generating the same
* page without an overhead of re-evaluating dependency data each time. Defaults to false.
* page without an overhead of re-evaluating dependency data each time. Defaults to false.
*/
*/
public
$reus
eData
=
false
;
public
$reus
able
=
false
;
/**
/**
* @var array static storage of cached data for reusable dependencies.
* @var array static storage of cached data for reusable dependencies.
...
@@ -42,13 +42,14 @@ abstract class Dependency extends \yii\base\Object
...
@@ -42,13 +42,14 @@ abstract class Dependency extends \yii\base\Object
*/
*/
private
$_hash
;
private
$_hash
;
/**
/**
* Evaluates the dependency by generating and saving the data related with dependency.
* Evaluates the dependency by generating and saving the data related with dependency.
* This method is invoked by cache before writing data into it.
* This method is invoked by cache before writing data into it.
*/
*/
public
function
evaluateDependency
()
public
function
evaluateDependency
()
{
{
if
(
!
$this
->
reus
eData
)
{
if
(
!
$this
->
reus
able
)
{
$this
->
data
=
$this
->
generateDependencyData
();
$this
->
data
=
$this
->
generateDependencyData
();
}
else
{
}
else
{
if
(
$this
->
_hash
===
null
)
{
if
(
$this
->
_hash
===
null
)
{
...
@@ -66,7 +67,7 @@ abstract class Dependency extends \yii\base\Object
...
@@ -66,7 +67,7 @@ abstract class Dependency extends \yii\base\Object
*/
*/
public
function
getHasChanged
()
public
function
getHasChanged
()
{
{
if
(
!
$this
->
reus
eData
)
{
if
(
!
$this
->
reus
able
)
{
return
$this
->
generateDependencyData
()
!==
$this
->
data
;
return
$this
->
generateDependencyData
()
!==
$this
->
data
;
}
else
{
}
else
{
if
(
$this
->
_hash
===
null
)
{
if
(
$this
->
_hash
===
null
)
{
...
...
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