Merge "Add framework for file warnings"
[lhc/web/wiklou.git] / includes / parser / CacheTime.php
index 6fb3e0a..950c0d4 100644 (file)
@@ -32,41 +32,25 @@ class CacheTime {
         */
        public $mUsedOptions;
 
-       var     $mVersion = Parser::VERSION,  # Compatibility check
+       public $mVersion = Parser::VERSION,  # Compatibility check
                $mCacheTime = '',             # Time when this object was generated, or -1 for uncacheable. Used in ParserCache.
-               $mCacheExpiry = null,         # Seconds after which the object should expire, use 0 for uncachable. Used in ParserCache.
-               $mContainsOldMagic,           # Boolean variable indicating if the input contained variables like {{CURRENTDAY}}
+               $mCacheExpiry = null,         # Seconds after which the object should expire, use 0 for uncacheable. Used in ParserCache.
                $mCacheRevisionId = null;     # Revision ID that was parsed
 
        /**
         * @return string TS_MW timestamp
         */
-       function getCacheTime() {
+       public function getCacheTime() {
                return wfTimestamp( TS_MW, $this->mCacheTime );
        }
 
-       /**
-        * @return bool
-        */
-       function containsOldMagic() {
-               return $this->mContainsOldMagic;
-       }
-
-       /**
-        * @param bool $com
-        * @return bool
-        */
-       function setContainsOldMagic( $com ) {
-               return wfSetVar( $this->mContainsOldMagic, $com );
-       }
-
        /**
         * setCacheTime() sets the timestamp expressing when the page has been rendered.
         * This does not control expiry, see updateCacheExpiry() for that!
         * @param string $t
         * @return string
         */
-       function setCacheTime( $t ) {
+       public function setCacheTime( $t ) {
                return wfSetVar( $this->mCacheTime, $t );
        }
 
@@ -74,7 +58,7 @@ class CacheTime {
         * @since 1.23
         * @return int|null Revision id, if any was set
         */
-       function getCacheRevisionId() {
+       public function getCacheRevisionId() {
                return $this->mCacheRevisionId;
        }
 
@@ -82,7 +66,7 @@ class CacheTime {
         * @since 1.23
         * @param int $id Revision id
         */
-       function setCacheRevisionId( $id ) {
+       public function setCacheRevisionId( $id ) {
                $this->mCacheRevisionId = $id;
        }
 
@@ -96,7 +80,7 @@ class CacheTime {
         *
         * @param int $seconds
         */
-       function updateCacheExpiry( $seconds ) {
+       public function updateCacheExpiry( $seconds ) {
                $seconds = (int)$seconds;
 
                if ( $this->mCacheExpiry === null || $this->mCacheExpiry > $seconds ) {
@@ -118,12 +102,12 @@ class CacheTime {
         * value of $wgParserCacheExpireTime.
         * @return int|mixed|null
         */
-       function getCacheExpiry() {
+       public function getCacheExpiry() {
                global $wgParserCacheExpireTime;
 
                if ( $this->mCacheTime < 0 ) {
                        return 0;
-               } // old-style marker for "not cachable"
+               } // old-style marker for "not cacheable"
 
                $expire = $this->mCacheExpiry;
 
@@ -133,12 +117,8 @@ class CacheTime {
                        $expire = min( $expire, $wgParserCacheExpireTime );
                }
 
-               if ( $this->containsOldMagic() ) { //compatibility hack
-                       $expire = min( $expire, 3600 ); # 1 hour
-               }
-
                if ( $expire <= 0 ) {
-                       return 0; // not cachable
+                       return 0; // not cacheable
                } else {
                        return $expire;
                }
@@ -147,7 +127,7 @@ class CacheTime {
        /**
         * @return bool
         */
-       function isCacheable() {
+       public function isCacheable() {
                return $this->getCacheExpiry() > 0;
        }