/var/www/vhosts/nabawater/vendor/yiisoft/yii2/caching
NameSizeModeActions
migrations/-0755rm
ApcCache.php65390644editdlrm
ArrayCache.php23590644editdlrm
Cache.php260060644editdlrm
CacheInterface.php95640644editdlrm
ChainedDependency.php25270644editdlrm
DbCache.php104980644editdlrm
DbDependency.php22740644editdlrm
DbQueryDependency.php37380644editdlrm
Dependency.php42430644editdlrm
DummyCache.php29150644editdlrm
ExpressionDependency.php19500644editdlrm
FileCache.php108710644editdlrm
FileDependency.php16050644editdlrm
MemCache.php139010644editdlrm
MemCacheServer.php19660644editdlrm
TagDependency.php36010644editdlrm
WinCache.php54640644editdlrm
XCache.php43220644editdlrm
ZendDataCache.php33710644editdlrm
Edit: /var/www/vhosts/nabawater/vendor/yiisoft/yii2/caching/DbDependency.php (2274B)
* @since 2.0 */ class DbDependency extends Dependency { /** * @var string the application component ID of the DB connection. */ public $db = 'db'; /** * @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. */ public $sql; /** * @var array the parameters (name => value) to be bound to the SQL statement specified by [[sql]]. */ public $params = []; /** * Generates the data needed to determine if dependency has been changed. * This method returns the value of the global state. * @param CacheInterface $cache the cache component that is currently evaluating this dependency * @return mixed the data needed to determine if dependency has been changed. * @throws InvalidConfigException if [[db]] is not a valid application component ID */ protected function generateDependencyData($cache) { /* @var $db Connection */ $db = Instance::ensure($this->db, Connection::className()); if ($this->sql === null) { throw new InvalidConfigException('DbDependency::sql must be set.'); } if ($db->enableQueryCache) { // temporarily disable and re-enable query caching $db->enableQueryCache = false; $result = $db->createCommand($this->sql, $this->params)->queryOne(); $db->enableQueryCache = true; } else { $result = $db->createCommand($this->sql, $this->params)->queryOne(); } return $result; } }