3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 * http://www.gnu.org/copyleft/gpl.html
27 const NO_TEMPLATES
= 2;
28 const STRIP_COMMENTS
= 4;
30 const RECOVER_COMMENTS
= 16;
33 const RECOVER_ORIG
= self
::NO_ARGS | self
::NO_TEMPLATES | self
::NO_IGNORE |
34 self
::RECOVER_COMMENTS | self
::NO_TAGS
;
36 /** This constant exists when $indexOffset is supported in newChild() */
37 const SUPPORTS_INDEX_OFFSET
= 1;
40 * Create a child frame
42 * @param array|bool $args
43 * @param bool|Title $title
44 * @param int $indexOffset A number subtracted from the index attributes of the arguments
48 public function newChild( $args = false, $title = false, $indexOffset = 0 );
51 * Expand a document tree node, caching the result on its parent with the given key
52 * @param string|int $key
53 * @param string|PPNode $root
57 public function cachedExpand( $key, $root, $flags = 0 );
60 * Expand a document tree node
61 * @param string|PPNode $root
65 public function expand( $root, $flags = 0 );
68 * Implode with flags for expand()
71 * @param string|PPNode $args,...
74 public function implodeWithFlags( $sep, $flags /*, ... */ );
77 * Implode with no flags specified
79 * @param string|PPNode $args,...
82 public function implode( $sep /*, ... */ );
85 * Makes an object that, when expand()ed, will be the same as one obtained
88 * @param string|PPNode $args,...
91 public function virtualImplode( $sep /*, ... */ );
94 * Virtual implode with brackets
95 * @param string $start
98 * @param string|PPNode $args,...
101 public function virtualBracketedImplode( $start, $sep, $end /*, ... */ );
104 * Returns true if there are no arguments in this frame
108 public function isEmpty();
111 * Returns all arguments of this frame
114 public function getArguments();
117 * Returns all numbered arguments of this frame
120 public function getNumberedArguments();
123 * Returns all named arguments of this frame
126 public function getNamedArguments();
129 * Get an argument to this frame by name
130 * @param int|string $name
131 * @return string|bool
133 public function getArgument( $name );
136 * Returns true if the infinite loop check is OK, false if a loop is detected
138 * @param Title $title
141 public function loopCheck( $title );
144 * Return true if the frame is a template frame
147 public function isTemplate();
150 * Set the "volatile" flag.
152 * Note that this is somewhat of a "hack" in order to make extensions
153 * with side effects (such as Cite) work with the PHP parser. New
154 * extensions should be written in a way that they do not need this
155 * function, because other parsers (such as Parsoid) are not guaranteed
156 * to respect it, and it may be removed in the future.
160 public function setVolatile( $flag = true );
163 * Get the "volatile" flag.
165 * Callers should avoid caching the result of an expansion if it has the
168 * @see self::setVolatile()
171 public function isVolatile();
174 * Get the TTL of the frame's output.
176 * This is the maximum amount of time, in seconds, that this frame's
177 * output should be cached for. A value of null indicates that no
178 * maximum has been specified.
180 * Note that this TTL only applies to caching frames as parts of pages.
181 * It is not relevant to caching the entire rendered output of a page.
185 public function getTTL();
188 * Set the TTL of the output of this frame and all of its ancestors.
189 * Has no effect if the new TTL is greater than the one already set.
190 * Note that it is the caller's responsibility to change the cache
191 * expiry of the page as a whole, if such behavior is desired.
193 * @see self::getTTL()
196 public function setTTL( $ttl );
199 * Get a title of frame
203 public function getTitle();