Add PPFrame::getTTL() and setTTL()
[lhc/web/wiklou.git] / includes / parser / Preprocessor_Hash.php
index ad61eec..bc2b686 100644 (file)
@@ -920,6 +920,7 @@ class PPFrame_Hash implements PPFrame {
        var $depth;
 
        private $volatile = false;
+       private $ttl = null;
 
        /**
         * @var array
@@ -1410,6 +1411,26 @@ class PPFrame_Hash implements PPFrame {
        function isVolatile() {
                return $this->volatile;
        }
+
+       /**
+        * Set the TTL
+        *
+        * @param int $ttl
+        */
+       function setTTL( $ttl ) {
+               if ( $ttl !== null && ( $this->ttl === null || $ttl < $this->ttl ) ) {
+                       $this->ttl = $ttl;
+               }
+       }
+
+       /**
+        * Get the TTL
+        *
+        * @return int|null
+        */
+       function getTTL() {
+               return $this->ttl;
+       }
 }
 
 /**
@@ -1585,6 +1606,11 @@ class PPTemplateFrame_Hash extends PPFrame_Hash {
                parent::setVolatile( $flag );
                $this->parent->setVolatile( $flag );
        }
+
+       function setTTL( $ttl ) {
+               parent::setTTL( $ttl );
+               $this->parent->setTTL( $ttl );
+       }
 }
 
 /**