=== array() => empty()

This commit is contained in:
Alexander Kochetov
2013-05-07 19:51:29 +04:00
parent 901dabc301
commit d7df7053e0
11 changed files with 25 additions and 23 deletions

View File

@ -107,7 +107,7 @@ class FragmentCache extends Widget
$data = array($content, $this->dynamicPlaceholders);
$this->cache->set($this->calculateKey(), $data, $this->duration, $this->dependency);
if ($this->view->cacheStack === array() && !empty($this->dynamicPlaceholders)) {
if (empty($this->view->cacheStack) && !empty($this->dynamicPlaceholders)) {
$content = $this->updateDynamicContent($content, $this->dynamicPlaceholders);
}
echo $content;
@ -133,7 +133,7 @@ class FragmentCache extends Widget
if (is_array($data) && count($data) === 2) {
list ($content, $placeholders) = $data;
if (is_array($placeholders) && count($placeholders) > 0) {
if ($this->view->cacheStack === array()) {
if (empty($this->view->cacheStack)) {
// outermost cache: replace placeholder with dynamic content
$content = $this->updateDynamicContent($content, $placeholders);
}
@ -171,4 +171,4 @@ class FragmentCache extends Widget
}
return $this->cache->buildKey($factors);
}
}
}