29 require_once __DIR__ .
'/commandLine.inc';
46 print "MediaWiki isn't configured with a cache named '$cache'";
55 print "MediaWiki isn't configured for Memcached usage\n";
68 MemCached Command (mcc)
is an interactive
command tool
that let you interact
73 --help This help screen.
86 'get' =>
'grabs something',
87 'getsock' =>
'lists sockets',
88 'set' =>
'changes something',
89 'delete' =>
'deletes something',
90 'history' =>
'show command line history',
91 'server' =>
'show current memcached server',
92 'dumpmcc' =>
'shows the whole thing',
95 'help' =>
'help about a command',
101 $max_cmd_len = max( array_map(
'strlen', array_keys( $commandList ) ) );
102 foreach ( $commandList
as $cmd => $desc ) {
103 $output .= sprintf(
"%-{$max_cmd_len}s: %s\n", $cmd, $desc );
105 } elseif ( isset( $commandList[
$command] ) ) {
106 $output .=
"$command: $commandList[$command]\n";
108 $output .=
"$command: command does not exist or no help for it\n";
120 if (
$line ===
false ) {
136 if ( array_key_exists( 1,
$args ) ) {
139 print "Getting {$args[0]}[$sub]\n";
141 if ( array_key_exists( 1,
$args ) ) {
144 if (
$res ===
false ) {
145 # print 'Error: ' . $mcc->error_string() . "\n";
146 print "MemCached error\n";
147 } elseif ( is_string(
$res ) ) {
161 if (
$mcc->_single_sock !== null ) {
167 for ( $i = 0; $i < 3; $i++ ) {
174 $key = array_shift(
$args );
175 if (
$args[0] ==
"#" && is_numeric(
$args[1] ) ) {
181 # print 'Error: ' . $mcc->error_string() . "\n";
182 print "MemCached error\n";
187 $key = implode(
' ',
$args );
188 if ( !
$mcc->delete( $key ) ) {
189 # print 'Error: ' . $mcc->error_string() . "\n";
190 print "MemCached error\n";
195 if ( function_exists(
'readline_list_history' ) ) {
196 foreach ( readline_list_history()
as $num =>
$line ) {
197 print "$num: $line\n";
200 print "readline_list_history() not available\n";
219 print "Bad command\n";
222 if ( function_exists(
'readline_add_history' ) ) {
223 readline_add_history(
$line );
MediaWiki has optional support for memcached
#define the
table suitable for use with IDatabase::select()
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 then executing the whole list after the page is displayed We don t do anything smart like collating updates to the same table or such because the list is almost always going to have just one item on if that
memcached client class implemented using (p)fsockopen()
you have access to all of the normal MediaWiki so you can get a DB use the cache
Some quick notes on the file repository architecture Functionality is
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
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
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 the output can only depend on parameters provided to this hook not on global state indicating whether full HTML should be generated If generation of HTML may be but other information should still be present in the ParserOutput object & $output
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
static readconsole($prompt= '> ')
Prompt the console for input.
unless you explicitly specified the no dev flag during the install In this case just run composer update Otherwise follow the installation instructions in the PHPUnit Manual the tests runs are controlled with a makefile Run command
$wgObjectCaches
Advanced object cache configuration.
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 on
you have access to all of the normal MediaWiki so you can get a DB connection
mccShowUsage()
Show this command line tool usage.