86 return get_called_class();
152 $fields = array_filter( $this->
getFieldInfo(),
function ( $info ) {
153 return $info[
'type'] !==
'null';
159 foreach ( $fields
as $field => $info ) {
164 if ( $info[
'type'] ===
'checkbox' || $info[
'type'] ===
'button' ) {
165 $this->$field = isset( $data[$field] ) && $data[$field] !==
false
166 || isset( $data[
"{$field}_x"] ) && $data[
"{$field}_x"] !==
false;
167 if ( !$this->$field && empty( $info[
'optional'] ) ) {
174 if ( !isset( $data[$field] ) && $info[
'type'] ===
'multiselect' ) {
178 if ( !isset( $data[$field] ) ) {
181 if ( $data[$field] ===
'' || $data[$field] === [] ) {
182 if ( empty( $info[
'optional'] ) ) {
186 switch ( $info[
'type'] ) {
188 if ( !isset( $info[
'options'][$data[$field]] ) ) {
194 $data[$field] = (
array)$data[$field];
195 $allowed = array_keys( $info[
'options'] );
196 if ( array_diff( $data[$field], $allowed ) !== [] ) {
203 $this->$field = $data[$field];
227 'provider' => new \RawMessage(
'$1', [ get_called_class() ] ),
228 'account' => new \RawMessage(
'$1', [ $this->
getUniqueId() ] ),
239 return array_values( array_filter( $reqs,
function (
$req )
use ( $data ) {
240 return $req->loadFromSubmission( $data );
254 $requests = array_filter( $reqs,
function (
$req )
use ( $class, $allowSubclasses ) {
255 if ( $allowSubclasses ) {
256 return is_a(
$req, $class,
false );
258 return get_class(
$req ) === $class;
276 foreach ( $reqs
as $req ) {
277 $info = $req->getFieldInfo();
278 if ( $info && array_key_exists(
'username', $info ) && $req->username !== null ) {
281 $otherClass = get_class( $req );
282 } elseif (
$username !== $req->username ) {
283 $requestClass = get_class( $req );
284 throw new \UnexpectedValueException(
"Conflicting username fields: \"{$req->username}\" from "
285 .
"$requestClass::\$username vs. \"$username\" from $otherClass::\$username" );
302 $primaryRequests = array_filter( $reqs,
function (
$req ) {
305 $sharedRequiredPrimaryFields = array_reduce( $primaryRequests,
function ( $shared,
$req ) {
307 return empty(
$options[
'optional'] );
309 if ( $shared === null ) {
312 return array_intersect( $shared,
$required );
316 foreach ( $reqs
as $req ) {
317 $info = $req->getFieldInfo();
325 $req->required === self::OPTIONAL
328 || $req->required === self::PRIMARY_REQUIRED
329 && !in_array(
$name, $sharedRequiredPrimaryFields,
true )
338 if ( !array_key_exists(
$name, $merged ) ) {
341 throw new \UnexpectedValueException(
"Field type conflict for \"$name\", " .
342 "\"{$merged[$name]['type']}\" vs \"{$options['type']}\""
345 if ( isset(
$options[
'options'] ) ) {
346 if ( isset( $merged[
$name][
'options'] ) ) {
356 $merged[
$name][
'sensitive'] = $merged[
$name][
'sensitive'] || $options[
'sensitive'];
374 foreach ( $data
as $k => $v ) {
the array() calling protocol came about after MediaWiki 1.4rc1.
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses & $ret
Apache License January AND DISTRIBUTION Definitions License shall mean the terms and conditions for use
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist e g Watchlist removed from all revisions and log entries to which it was applied This gives extensions a chance to take it off their books as the deletion has already been partly carried out by this point or something similar the user will be unable to create the tag set and then return false from the hook function Ensure you consume the ChangeTagAfterDelete hook to carry out custom deletion actions as context called by AbstractContent::getParserOutput May be used to override the normal model specific rendering of page content as context as context $options
Allows to change the fields on the form that will be generated are created Can be used to omit specific feeds from being outputted You must not use this hook to add use OutputPage::addFeedLink() instead.&$feedLinks hooks can tweak the array to change how login etc forms should look $requests
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
this hook is for auditing only $req
Allows to change the fields on the form that will be generated $name