Commit graph

45 commits

Author SHA1 Message Date
Alex Monk
aa838b52de Try to fix some other broken-looking legacy maintenance script options
Bug: T125748
Change-Id: I2004d9b1fd7389623a3f2da6682f9007efd679dc
2016-03-12 00:47:36 +00:00
Kunal Mehta
6e9b4f0e9c Convert all array() syntax to []
Per wikitech-l consensus:
 https://lists.wikimedia.org/pipermail/wikitech-l/2016-February/084821.html

Notes:
* Disabled CallTimePassByReference due to false positives (T127163)

Change-Id: I2c8ce713ce6600a0bb7bf67537c87044c7a45c4b
2016-02-17 01:33:00 -08:00
Timo Tijhof
304eaf2868 objectcache: Reduce MediaWiki-specificness from Memcached classes
Follows-up f36b73e96c, which moved these classes to libs/objectcache.

* Fix wrong @throws in MemcachedPeclBagOStuff.
* Fix wrong @returns in MemcachedBagOStuff::getClient().
* Rename MWMemcached to MemcachedClient.
* Remove mention of 'memcached.php', which doesn't exist anymore.

Change-Id: I34dbc859be4778cea489fd2344f233f30452605c
2015-11-10 03:32:58 +00:00
Timo Tijhof
beb1c4a0ec phpcs: More require/include is not a function
Follows-up I1343872de7, Ia533aedf63 and I2df2f80b81.

Also updated usage in text in documentation and the
installer LocalSettingsGenerator.

Most of them were handled by this regex:
- find: (require|include|require_once|include_once)\s*\(\s*(.+?)\s*\)\s*;$
- replace: $1 $2;

Change-Id: I6b38aad9a5149c9c43ce18bd8edbab14b8ce43fa
2013-05-21 23:26:28 +02:00
umherirrender
b114f5e1c1 Fixed some spacing in maintenance folder
Added spaces before if, foreach
Added some braces for one line statements

Change-Id: I9657f72996358f8c1c154cea1ea97970d973723c
2013-04-18 20:48:44 +02:00
Aaron Schulz
cef7179057 Added a --cache option to mctest.php and mcc.php.
* This lets the server list used be that of different object caches.

Change-Id: I88039370affec6e431c931337d220f7472f6eaeb
2013-03-14 23:09:24 -07:00
Antoine Musso
952a88eec4 mcc can now set memcached debug mode and has help
This patch let us set the debug mode on the memcached connection. Simply
pass --debug as an argument.  I have also added basic usage
documentation with --help, listing the interacting commands as well.

Example output:

$ php mcc.php --help
Usage:
	mcc.php [--debug]
	mcc.php --help

MemCached Command (mcc) is an interactive command tool that let you
interact
with the MediaWiki memcached cache.

Options:
	--debug Set debug mode on the memcached connection.
	--help  This help screen.

Interactive commands:
	get    : grabs something
	getsock: lists sockets
	set    : changes something
	delete : deletes something
	history: show command line history
	server : show current memcached server
	dumpmcc: shows the whole thing
	exit   : exit mcc
	quit   : exit mcc
	help   : help about a command

$

Change-Id: Ib4603eecbd6a8e6f3ba8bf3cf350c0e3df652d3b
2013-01-17 15:25:49 +00:00
Reedy
5db75ef6a4 Bug 43688 - mcc.php doesn't work with new WMF memcached config
Change-Id: Ic0d87d27e6db78314d92968d7c6d265cf6d24013
2013-01-16 14:05:27 +00:00
jeroendedauw
38c7f444e1 Use __DIR__ instead of dirname( __FILE__ )
We can now do this since we finally switched to PHP 5.3 for MW 1.20 and get rid of the silly dirname(__FILE__) stuff :)

Change-Id: Id9b2c9cd2e678197aa81c78adced5d1d31ff57b1
2012-08-27 21:45:00 +02:00
Tim Starling
be76d86932 * Rewrote ObjectCache.php to conform to the modern coding style, and to be less convoluted about how CACHE_ANYTHING and CACHE_ACCEL are resolved. Moved most functionality to static members of a new ObjectCache class.
* Moved the global functions to GlobalFunctions.php, where they are now just convenience wrappers. Made them return non-references. Updated callers (none found in extensions). 
* Added an advanced configuration method, $wgObjectCaches, which allows a lot more detail in the object cache configuration than $wgMainCacheType. 
* Made all object cache classes derive from BagOStuff. 
* Split the MWMemcached class into a generic client class and a MediaWiki-specific wrapper class. The wrapper class presents a simple BagOStuff interface to calling code, hiding memcached client internals, and will simplify the task of supporting the PECL extension.
* Added some extra constructor parameters to MWMemcached, configurable via $wgObjectCaches.
* Removed the *_multi() methods from BagOStuff, my grepping indicates that they are not used.
* Rewrote FakeMemCachedClient as a BagOStuff subclass, called EmptyBagOStuff.
* Added an optional "server" parameter to SQLBagOStuff. This allows the server holding the objectcache table to be different from the server holding the core DB.
* Added MultiWriteBagOStuff: a cache class which writes to multiple locations, and reads from them in a defined fallback sequence. This can be used to extend the cache space by adding disk-backed storage to existing in-memory caches.
* Made MWMemcached::get() return false on failure instead of null, to match the BagOStuff documentation and the other BagOStuff subclasses. Anything that was relying on it returning null would have already been broken with SqlBagOStuff.
* Fixed a bug in the memcached client causing keys with spaces or line breaks in them to break the memcached protocol, injecting arbitrary commands or parameters. Since the PECL client apparently also has this flaw, I implemented the fix in the wrapper class.
* Renamed BagOStuff::set_debug() to setDebug(), since we aren't emulating the memcached client anymore
* Fixed spelling error in MWMemcached: persistant -> persistent
2011-03-03 09:37:37 +00:00
Alexandre Emsenhuber
9f5d06527c Part of bug 26280: added license headers to PHP files in maintenance 2010-12-16 19:15:12 +00:00
Antoine Musso
9fdd07b82d Max command length using one line of code
Follow-up r76621 code review
2010-12-04 08:58:32 +00:00
Antoine Musso
0ea43dd530 justify help memcached console help 2010-11-13 10:33:30 +00:00
Chad Horohoe
670602f082 Trying to kill install-utils.inc/old install crap:
* Cripple the old installer (entry point is gone, supporting code immediately exits). Keeping the latter for reference still :)
* Move posix_isatty() wrapper to Maintenance.php, all CLI scripts include this
* Clarify docs on archive() deprecation and removal - hasn't been used going back thru 1.15
* Clarify docs on dbsource() deprecation and removal - was in wide use thru 1.15. 1.16 removed all extension usages
* Move the two PHP bug tests to a file with the other installer files, moved them to more logical places in new install/update sequence
* Remove mw_have_dl/mw_get_session_save_path, zero callers
* Move readconsole() and helpers to be a static method on Maintenance, no extensions have used it since 1.15 either
2010-11-06 22:16:19 +00:00
Sam Reed
659778619c Stylize maintenance folder.. 2010-05-22 16:50:39 +00:00
Alexandre Emsenhuber
0bd52e9050 Avoid "PHP Warning: Division by zero in maintenance/mcc.php on line 92" if there's only a single server 2010-01-23 19:00:56 +00:00
Chad Horohoe
c64f41dd21 Use correct variable name 2010-01-22 18:13:18 +00:00
Chad Horohoe
cb6a63f837 Cleanup needless code duplication 2010-01-22 18:04:40 +00:00
Alexandre Emsenhuber
002fb024b0 * (bug 21403) memcached class renamed to MWMemecached to avoid conflict with PHP's memcached extension
* Put MemCachedClientforWiki in memcached-client.php so that maintenance/mctest.php doesn't crash when $wgMainCacheType is not CACHE_MEMCACHED
Based on a patch by Kim Hyun-Joon
2009-11-20 15:37:28 +00:00
Chad Horohoe
567f244e36 Revert r54244 which was stupid and fix this properly. Require commandLine.inc/Maintenance.php using the full path every time. 2009-08-03 21:56:41 +00:00
Alexandre Emsenhuber
53f770b89f avoid E_NOTICE if only one argument is given to the "get" command 2009-03-14 20:09:48 +00:00
Alexandre Emsenhuber
087a9f70c5 WARNING: HUGE COMMIT
Doxygen documentation update:
* Changed alls @addtogroup to @ingroup. @addtogroup adds the comment to the group description, but doesn't add the file, class, function, ... to the group like @ingroup does. See for example http://svn.wikimedia.org/doc/group__SpecialPage.html where it's impossible to see related files, classes, ... that should belong to that group.
* Added @file to file description, it seems that it should be explicitely decalred for file descriptions, otherwise doxygen will think that the comment document the first class, variabled, function, ... that is in that file.
* Removed some empty comments
* Removed some ?>

Added following groups:
* ExternalStorage
* JobQueue
* MaintenanceLanguage

One more thing: there are still a lot of warnings when generating the doc.
2008-05-20 17:13:28 +00:00
Aryeh Gregor
a15c419b3d Remove ?>'s from files. They're pointless, and just asking for people to mess with the files and add trailing whitespace. (Yes, I looked over every one and reverted those that were bogus. Slash-enter a million times in less worked well enough, although it was a bit mind-numbing.) 2007-06-29 01:19:14 +00:00
Brion Vibber
72a4abe588 * Skip additional setting of include_path in commandLine.inc (for non-Wikimedia mode)
* Fix some scripts that assumed include_path was set with various additional directories
Stuff now seems to mostly work when not overriding include_path.
Taking that out of LocalSettings is the next step... whee!
2007-06-06 16:01:14 +00:00
Antoine Musso
c771fc9c96 Use Doxygen @addtogroup instead of phpdoc @package && @subpackage 2007-01-20 15:09:52 +00:00
Brion Vibber
d88bf87284 Apply most of the code tweaks from the live site:
* use configured cache servers for mctest.php
* bucket details in mcc.php
* fix input validation and remove debugging code in compressOld
* full ID range for moveToExternal
* fix resolveStubs.php for compatibility with older serialized data
* maximum line length for bar graphs in getLagTimes.php
* recognize specieswiki in rebuildInterwiki.inc
* --purge option to do additional parser-cache purging for purgeList.php
* default changed in MiniDonation extension
* profile unicode cleanup in Xml
* log slow parses in Article.php
* profile wfMsgReal
* log mkdir failures
* profile AutoLoader
* rebuild empty DjVu metadata containing ''
* security fix for DjVu metadata retrieval
2007-01-17 00:54:54 +00:00
Brion Vibber
6fae318406 Remove some stray executable bits 2006-04-04 07:57:48 +00:00
Ævar Arnfjörð Bjarmason
a26d5a49d7 * s~\t+$~~ 2006-01-07 13:31:29 +00:00
Antoine Musso
32dbdf547c better history 2005-12-04 00:00:06 +00:00
Antoine Musso
11ed2df86b 'server' command from live 2005-12-03 18:14:19 +00:00
Antoine Musso
365d5e55c2 implement 'history' command 2005-12-03 17:46:21 +00:00
Antoine Musso
ef4ea1ee11 dumb help messages. FIXME 2005-12-03 17:41:34 +00:00
Antoine Musso
2c529dd068 code formatting 2005-12-03 17:02:22 +00:00
Brion Vibber
47b6c60638 Committing live hack: enable memcached debug mode in mcc tester 2005-08-17 20:05:22 +00:00
River Tarnell
c3a7c7a4e1 error handling is your friend 2005-07-07 02:29:55 +00:00
River Tarnell
e4a87e105a implement "action=render" 2005-07-03 04:00:33 +00:00
Tim Starling
c69b7ca3f3 a couple of extra functions, useful for debugging 2004-09-25 16:54:31 +00:00
Antoine Musso
6bbcf091bf Phpdoc comments and place holder. Part of the subpackage "maintenance", archives in subpackage "maintenanceArchive" 2004-09-03 20:33:01 +00:00
Brion Vibber
be2913ebc8 Add a comment explaining what this is for :) 2004-08-11 09:40:44 +00:00
Tim Starling
f48ddd1366 using new commandLine.inc style, readconsole() moved to install-utils() 2004-06-13 04:36:53 +00:00
Tim Starling
595fa488da updated to work with new client 2004-06-01 07:42:32 +00:00
Tim Starling
8f22cb45b1 include_once -> require_once 2004-05-07 13:43:10 +00:00
Tim Starling
bc2120f9c0 Various enhancements 2003-11-30 08:21:40 +00:00
Tim Starling
17428f7d2f Support for systems without readline 2003-11-21 05:00:22 +00:00
Tim Starling
f814d27dfe MemCached command line client 2003-10-20 13:41:43 +00:00