81 public function add( $name, $default,
$type = self::AUTO ) {
83 $option[
'default'] = $default;
84 $option[
'value'] =
null;
85 $option[
'consumed'] =
false;
87 if (
$type !== self::AUTO ) {
88 $option[
'type'] =
$type;
103 unset( $this->
options[$name] );
118 if ( is_bool( $data ) ) {
120 } elseif ( is_int( $data ) ) {
122 } elseif ( is_float( $data ) ) {
124 } elseif ( is_string( $data ) ) {
126 } elseif ( is_array( $data ) ) {
144 if ( !isset( $this->
options[$name] ) ) {
166 if ( !$force &&
$value === $this->
options[$name][
'default'] ) {
193 if ( $option[
'value'] !==
null ) {
194 return $option[
'value'];
196 return $option[
'default'];
238 foreach ( $names as $name ) {
272 if (
$type !== self::INT &&
$type !== self::FLOAT ) {
273 throw new MWException(
"Option $name is not of type INT or FLOAT" );
291 foreach ( $this->
options as $name => $data ) {
292 if ( !$data[
'consumed'] ) {
293 if ( $all || $data[
'value'] !==
null ) {
309 foreach ( $this->
options as $name => $data ) {
310 if ( $data[
'value'] !==
null ) {
311 $values[
$name] = $data[
'value'];
325 foreach ( $this->
options as $name => $data ) {
345 if ( !$optionKeys ) {
346 $optionKeys = array_keys( $this->
options );
349 foreach ( $optionKeys as $name ) {
393 return isset( $this->
options[$name] );
419 $this->
delete(
$name );
The WebRequest class encapsulates getting at data passed in the URL or via a POSTed form stripping il...
getIntOrNull( $name)
Fetch an integer value from the input or return null if empty.
getArray( $name, $default=null)
Fetch an array from the input or return $default if it's not set.
getFloat( $name, $default=0.0)
Fetch a floating point value from the input or return $default if not set.
getBool( $name, $default=false)
Fetch a boolean value from the input or return $default if not set.
getInt( $name, $default=0)
Fetch an integer value from the input or return $default if not set.
getText( $name, $default='')
Fetch a text string from the given array or return $default if it's not set.
We ve cleaned up the code here by removing clumps of infrequently used code and moving them off somewhere else It s much easier for someone working with this code to see what s _really_ going and make changes or fix bugs In we can take all the code that deals with the little used title reversing options(say) and put it in one place. Instead of having little title-reversing if-blocks spread all over the codebase in showAnArticle
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that probably a stub it is not rendered in wiki pages or galleries in category pages allow injecting custom HTML after the section Any uses of the hook need to handle escaping see BaseTemplate::getToolbox and BaseTemplate::makeListItem for details on the format of individual items inside of this array or by returning and letting standard HTTP rendering take place modifiable or by returning false and taking over the output $out
Allows to change the fields on the form that will be generated $name