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
29ec4b63
Commit
29ec4b63
authored
Apr 03, 2013
by
Qiang Xue
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of git.yiisoft.com:yii2
parents
62fd92bf
b9a83551
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
31 deletions
+19
-31
ChainedDependency.php
framework/caching/ChainedDependency.php
+1
-1
DbDependency.php
framework/caching/DbDependency.php
+8
-10
ExpressionDependency.php
framework/caching/ExpressionDependency.php
+1
-12
FileDependency.php
framework/caching/FileDependency.php
+9
-7
FragmentCache.php
framework/widgets/FragmentCache.php
+0
-1
No files found.
framework/caching/ChainedDependency.php
View file @
29ec4b63
...
@@ -57,7 +57,7 @@ class ChainedDependency extends Dependency
...
@@ -57,7 +57,7 @@ class ChainedDependency extends Dependency
if
(
!
$dependency
instanceof
Dependency
)
{
if
(
!
$dependency
instanceof
Dependency
)
{
$dependency
=
\Yii
::
createObject
(
$dependency
);
$dependency
=
\Yii
::
createObject
(
$dependency
);
}
}
$dependency
->
evalu
l
ateDependency
();
$dependency
->
evaluateDependency
();
}
}
}
}
...
...
framework/caching/DbDependency.php
View file @
29ec4b63
...
@@ -28,25 +28,23 @@ class DbDependency extends Dependency
...
@@ -28,25 +28,23 @@ class DbDependency extends Dependency
public
$db
=
'db'
;
public
$db
=
'db'
;
/**
/**
* @var string the SQL query whose result is used to determine if the dependency has been changed.
* @var string the SQL query whose result is used to determine if the dependency has been changed.
* Only the first row of the query result will be used.
* Only the first row of the query result will be used. This property must be always set, otherwise
* an exception would be raised.
*/
*/
public
$sql
;
public
$sql
;
/**
/**
* @var array the parameters (name=>value) to be bound to the SQL statement specified by [[sql]].
* @var array the parameters (name=>value) to be bound to the SQL statement specified by [[sql]].
*/
*/
public
$params
;
public
$params
=
array
()
;
/**
/**
* Constructor.
* Initializes the database dependency object.
* @param string $sql the SQL query whose result is used to determine if the dependency has been changed.
* @param array $params the parameters (name=>value) to be bound to the SQL statement specified by [[sql]].
* @param array $config name-value pairs that will be used to initialize the object properties
*/
*/
public
function
__construct
(
$sql
,
$params
=
array
(),
$config
=
array
()
)
public
function
init
(
)
{
{
$this
->
sql
=
$sql
;
if
(
$this
->
sql
===
null
)
{
$this
->
params
=
$params
;
throw
new
InvalidConfigException
(
'DbDependency::sql must be set.'
)
;
parent
::
__construct
(
$config
);
}
}
}
/**
/**
...
...
framework/caching/ExpressionDependency.php
View file @
29ec4b63
...
@@ -22,18 +22,7 @@ class ExpressionDependency extends Dependency
...
@@ -22,18 +22,7 @@ class ExpressionDependency extends Dependency
/**
/**
* @var string the PHP expression whose result is used to determine the dependency.
* @var string the PHP expression whose result is used to determine the dependency.
*/
*/
public
$expression
;
public
$expression
=
'true'
;
/**
* Constructor.
* @param string $expression the PHP expression whose result is used to determine the dependency.
* @param array $config name-value pairs that will be used to initialize the object properties
*/
public
function
__construct
(
$expression
=
'true'
,
$config
=
array
())
{
$this
->
expression
=
$expression
;
parent
::
__construct
(
$config
);
}
/**
/**
* Generates the data needed to determine if dependency has been changed.
* Generates the data needed to determine if dependency has been changed.
...
...
framework/caching/FileDependency.php
View file @
29ec4b63
...
@@ -7,6 +7,8 @@
...
@@ -7,6 +7,8 @@
namespace
yii\caching
;
namespace
yii\caching
;
use
yii\base\InvalidConfigException
;
/**
/**
* FileDependency represents a dependency based on a file's last modification time.
* FileDependency represents a dependency based on a file's last modification time.
*
*
...
@@ -20,19 +22,19 @@ class FileDependency extends Dependency
...
@@ -20,19 +22,19 @@ class FileDependency extends Dependency
{
{
/**
/**
* @var string the name of the file whose last modification time is used to
* @var string the name of the file whose last modification time is used to
* check if the dependency has been changed.
* check if the dependency has been changed. This property must be always set,
* otherwise an exception would be raised.
*/
*/
public
$fileName
;
public
$fileName
;
/**
/**
* Constructor.
* Initializes the database dependency object.
* @param string $fileName name of the file whose change is to be checked.
* @param array $config name-value pairs that will be used to initialize the object properties
*/
*/
public
function
__construct
(
$fileName
=
null
,
$config
=
array
()
)
public
function
init
(
)
{
{
$this
->
fileName
=
$fileName
;
if
(
$this
->
file
===
null
)
{
parent
::
__construct
(
$config
);
throw
new
InvalidConfigException
(
'FileDependency::fileName must be set.'
);
}
}
}
/**
/**
...
...
framework/widgets/FragmentCache.php
View file @
29ec4b63
...
@@ -8,7 +8,6 @@
...
@@ -8,7 +8,6 @@
namespace
yii\widgets
;
namespace
yii\widgets
;
use
Yii
;
use
Yii
;
use
yii\base\InvalidConfigException
;
use
yii\base\Widget
;
use
yii\base\Widget
;
use
yii\caching\Cache
;
use
yii\caching\Cache
;
use
yii\caching\Dependency
;
use
yii\caching\Dependency
;
...
...
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