Merge "Correct field used to detect incomplete POST"
[lhc/web/wiklou.git] / includes / parser / Preprocessor.php
index 4cd5694..e7ccd10 100644 (file)
@@ -40,7 +40,8 @@ interface Preprocessor {
        function newFrame();
 
        /**
-        * Create a new custom frame for programmatic use of parameter replacement as used in some extensions
+        * Create a new custom frame for programmatic use of parameter replacement
+        * as used in some extensions.
         *
         * @param array $args
         *
@@ -49,7 +50,8 @@ interface Preprocessor {
        function newCustomFrame( $args );
 
        /**
-        * Create a new custom node for programmatic use of parameter replacement as used in some extensions
+        * Create a new custom node for programmatic use of parameter replacement
+        * as used in some extensions.
         *
         * @param array $values
         */
@@ -84,14 +86,19 @@ interface PPFrame {
        /**
         * Create a child frame
         *
-        * @param array $args
-        * @param Title $title
+        * @param array|bool $args
+        * @param bool|Title $title
         * @param int $indexOffset A number subtracted from the index attributes of the arguments
         *
         * @return PPFrame
         */
        function newChild( $args = false, $title = false, $indexOffset = 0 );
 
+       /**
+        * Expand a document tree node, caching the result on its parent with the given key
+        */
+       function cachedExpand( $key, $root, $flags = 0 );
+
        /**
         * Expand a document tree node
         */
@@ -158,6 +165,30 @@ interface PPFrame {
         */
        function isTemplate();
 
+       /**
+        * Set the "volatile" flag.
+        *
+        * Note that this is somewhat of a "hack" in order to make extensions
+        * with side effects (such as Cite) work with the PHP parser. New
+        * extensions should be written in a way that they do not need this
+        * function, because other parsers (such as Parsoid) are not guaranteed
+        * to respect it, and it may be removed in the future.
+        *
+        * @param bool $flag
+        */
+       function setVolatile( $flag = true );
+
+       /**
+        * Get the "volatile" flag.
+        *
+        * Callers should avoid caching the result of an expansion if it has the
+        * volatile flag set.
+        *
+        * @see self::setVolatile()
+        * @return bool
+        */
+       function isVolatile();
+
        /**
         * Get a title of frame
         *