X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;ds=sidebyside;f=includes%2FCacheDependency.php;h=1d48c383e732025ffa87d569c94923c963197023;hb=0495f90ebb83c0295f67b9da410ddf3b0534ca38;hp=6a591767d4bff94bd0291aca9991df4b5b6ecc80;hpb=07940059beedada6e5b93708bf783e88a75da239;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/CacheDependency.php b/includes/CacheDependency.php index 6a591767d4..1d48c383e7 100644 --- a/includes/CacheDependency.php +++ b/includes/CacheDependency.php @@ -4,6 +4,7 @@ * This class stores an arbitrary value along with its dependencies. * Users should typically only use DependencyWrapper::getFromCache(), rather * than instantiating one of these objects directly. + * @addtogroup Cache */ class DependencyWrapper { var $value; @@ -81,7 +82,7 @@ class DependencyWrapper { $callbackParams = array(), $deps = array() ) { $obj = $cache->get( $key ); - if ( $obj && !$obj->isExpired() ) { + if ( is_object( $obj ) && $obj instanceof DependencyWrapper && !$obj->isExpired() ) { $value = $obj->value; } elseif ( $callback ) { $value = call_user_func_array( $callback, $callbackParams ); @@ -95,6 +96,9 @@ class DependencyWrapper { } } +/** + * @addtogroup Cache + */ abstract class CacheDependency { /** * Returns true if the dependency is expired, false otherwise @@ -107,6 +111,9 @@ abstract class CacheDependency { function loadDependencyValues() {} } +/** + * @addtogroup Cache + */ class FileDependency extends CacheDependency { var $filename, $timestamp; @@ -163,6 +170,9 @@ class FileDependency extends CacheDependency { } } +/** + * @addtogroup Cache + */ class TitleDependency extends CacheDependency { var $titleObj; var $ns, $dbk; @@ -219,6 +229,9 @@ class TitleDependency extends CacheDependency { } } +/** + * @addtogroup Cache + */ class TitleListDependency extends CacheDependency { var $linkBatch; var $timestamps; @@ -244,7 +257,7 @@ class TitleListDependency extends CacheDependency { # Do the query if ( count( $timestamps ) ) { - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $where = $this->getLinkBatch()->constructSet( 'page', $dbr ); $res = $dbr->select( 'page', array( 'page_namespace', 'page_title', 'page_touched' ), @@ -299,6 +312,9 @@ class TitleListDependency extends CacheDependency { } } +/** + * @addtogroup Cache + */ class GlobalDependency extends CacheDependency { var $name, $value; @@ -312,6 +328,9 @@ class GlobalDependency extends CacheDependency { } } +/** + * @addtogroup Cache + */ class ConstantDependency extends CacheDependency { var $name, $value; @@ -325,4 +344,4 @@ class ConstantDependency extends CacheDependency { } } -?> +