MediaWiki  1.29.1
Go to the documentation of this file.
1 <?php
41 if ( PHP_SAPI != 'cli' ) {
42  die( "This filter can only be run from the command line.\n" );
43 }
45 $source = file_get_contents( $argv[1] );
46 $tokens = token_get_all( $source );
48 $buffer = $bufferType = null;
49 foreach ( $tokens as $token ) {
50  if ( is_string( $token ) ) {
51  if ( $buffer !== null && $token === ';' ) {
52  // If we still have a buffer and the statement has ended,
53  // flush it and move on.
54  echo $buffer;
55  $buffer = $bufferType = null;
56  }
57  echo $token;
58  continue;
59  }
60  list( $id, $content ) = $token;
61  switch ( $id ) {
62  case T_DOC_COMMENT:
63  // Escape slashes so that references to namespaces are not
64  // wrongly interpreted as a Doxygen "\command".
65  $content = addcslashes( $content, '\\' );
66  // Look for instances of "@var Type" not followed by $name.
67  if ( preg_match( '#@var\s+([^\s]+)\s+([^\$]+)#s', $content ) ) {
68  $buffer = preg_replace_callback(
69  // Strip the "@var Type" part and remember the type
70  '#(@var\s+)([^\s]+)#s',
71  function ( $matches ) use ( &$bufferType ) {
72  $bufferType = $matches[2];
73  return '';
74  },
75  $content
76  );
77  } else {
78  echo $content;
79  }
80  break;
82  case T_VARIABLE:
83  if ( $buffer !== null ) {
84  echo $buffer;
85  echo "$bufferType $content";
86  $buffer = $bufferType = null;
87  } else {
88  echo $content;
89  }
90  break;
92  default:
93  if ( $buffer !== null ) {
94  $buffer .= $content;
95  } else {
96  echo $content;
97  }
98  break;
99  }
100 }
as see the revision history and available at free of to any person obtaining a copy of this software and associated documentation to deal in the Software without including without limitation the rights to use
Definition: MIT-LICENSE.txt:10
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
Definition: injection.txt:35
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist Do not use this to implement individual filters if they are compatible with the ChangesListFilter and ChangesListFilterGroup structure use sub classes of those in conjunction with the ChangesListSpecialPageStructuredFilters hook This hook can be used to implement filters that do not implement that or custom behavior that is not an individual filter e g Watchlist and Watchlist you will want to construct new ChangesListBooleanFilter or ChangesListStringOptionsFilter objects When constructing you specify which group they belong to You can reuse existing or create your you must register them with $special registerFilterGroup 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 $content
Definition: hooks.txt:1049
Definition: NoLocalSettings.php:24
deferred txt A few of the database updates required by various functions here can be deferred until after the result page is displayed to the user For updating the view updating the linked to tables after a etc PHP does not yet have any way to tell the server to actually return and disconnect while still running these but it might have such a feature in the future We handle these by creating a deferred update object and putting those objects on a global list
Definition: deferred.txt:11
Definition: mwdoc-filter.php:46
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
Definition: distributors.txt:9
Definition: mwdoc-filter.php:45
global $argv
Definition: autoload.ide.php:24
Definition: mwdoc-filter.php:48