Commit graph

714 commits

Author SHA1 Message Date
Sam Reed
b161823573 * (bug 26763) Make RSS/Atom of user contributions more visible
Add ApiFeedContributions module

Somewhat duplicated against Special:Contributions?feed=atom

Going to strip out that functionality
2011-06-06 14:50:34 +00:00
Tim Starling
f3f1fcdc2c * Added a REQUEST_URI check to the bug 28235 handling.
* Moved most of the bug 28235 code out to a separate library class, since I was running out of distinct function names. 
* Merged the QUERY_STRING and PATH_INFO security checks, since they are dealing with the exact same problem. Removed WebRequest::isQueryStringBad(). 
* Deal with img_auth.php by having it specify what extension it expects to be streaming out. This extension can then be compared with the extension that IE might detect.
2011-06-06 11:59:20 +00:00
Brion Vibber
94c04f7cd1 Provisional revert of r89406, r89414: reference-related warnings need cleanup before applying code like this
Per CR http://www.mediawiki.org/wiki/Special:Code/MediaWiki/89406#c17545 :
'Here is a third one: Strict Standards: Only variables should be passed by reference in /www/sandwiki/includes/Wiki.php on line 177 '

Offending bit is this:
-			SpecialPageFactory::executePath( $this->context->title, $this->context );
+			SpecialPageFactory::executePath( $this->getTitle(), $this->getContext() );

That function demands reference paramters for $title and $context, which is being violated here where we now pass function return values:

public static function executePath( Title &$title, RequestContext &$context, $including = false ) {

The $title does sometimes get replaced within the function body, but $context does not appear to ever be replaced (its *contents* are modified, which does not require passing by reference)
If replacing it is something it should be doing, then we need to be able to replace it upstream presumably, so $this->getTitle() probably isn't appropriate.
The $context probably should have the reference simply removed.
2011-06-03 18:48:59 +00:00
Happy-melon
6e7eb67b43 Start unpicking r85288 (magic __get() accessor for RequestContext). Instead, bring back some of r86872 (abstract base class for classes providing access to RequestContext methods), which is a more 'classical' solution. 2011-06-03 10:54:13 +00:00
Chad Horohoe
5cca2119e3 rvv: r89398. Tim wants me to wait 2011-06-03 05:44:28 +00:00
Chad Horohoe
3465e3f083 Kill off action=raw from index.php
* One less entry point to worry about
* Completely obsolete by load.php and api.php
* Left $wgDebugRawPage in place, also affects load.php requests (docs already reflect)
* Affects dumpHTML (probably broken anyway, has anyone RL-ified this?), and two abandoned/obsolete extensions
2011-06-03 05:39:32 +00:00
Chad Horohoe
7830a165d4 Missing , 2011-06-03 04:05:04 +00:00
Chad Horohoe
46caa4d6df Add Maintenance and FakeMaintenance to the autoloader for paranoia 2011-06-03 03:59:27 +00:00
Tim Starling
5235082095 Explored some ideas for HipHop optimisation. Made a preprocessor implementation, based on a copy of Preprocessor_Hash, with a preprocessToObj() which is optimised. It takes 33% less time than Preprocessor_Hash for a certain realistic test case (the Barack Obama article). Some notes about what I did:
* Set EnableHipHopSyntax=true to enable string and integer type hints. I gave the file a .hphp extension to avoid false alarms in syntax checking scripts. 
* Made sure almost all the local variables in preprocessToObj() have a specific type, instead of being variants. This is useful for integers, but has the largest impact for objects, since dynamic method calls can be avoided. 
* Stopped using extract() since it forces all local variables to be variants, and adds some hashtable initialisation overhead.
* Found a way to cast a variant to a specific object class, by abusing argument type hinting. The method does not require special syntax; it is harmless in Zend PHP.
* Wrapped various internal function calls with type casts. strspn() and substr() need to be wrapped with intval() and strval() respectively, since they return a variant to support special error return values. HipHop isn't smart enough to know whether the error case will be triggered.
* Replaced most instances of double-equals with triple-equals. Profiling indicates that this makes a very large difference when comparing strings, much more so than in Zend.
2011-06-02 02:44:33 +00:00
Chad Horohoe
0bafff5109 Misc. exception handling cleanup--moved it out of global function namespace
Also removed htmlHeader() and htmlFooter() since it has zero callers anywhere.
Not sure why useOutputPage() was checking isArticleRelated(), we should be able do use it with other stuff too
2011-05-30 00:18:10 +00:00
Sam Reed
00707e04a6 * (bug 29144) Move action=dublincore and action=creativecommons to extensions
Moved CreativeCommonsRDF out to extension
2011-05-26 00:08:16 +00:00
Sam Reed
27c3b22bff * (bug 29144) Move action=dublincore and action=creativecommons to extensions
Moved dublincore out to extension
2011-05-25 23:55:15 +00:00
Sam Reed
97c371697c Move DB utility classes into own file
Updated AutoLoader to match
2011-05-25 17:06:04 +00:00
Sam Reed
6bb0325f52 Move DB(.*?)Error classes into own file
Updated AutoLoader to match
2011-05-25 17:03:15 +00:00
Krinkle
634a758924 Adding user.tokens module and loading by default. (ResourceLoaderUserTokensModule Class) 2011-05-21 22:52:32 +00:00
Chad Horohoe
7131283a7b Initial commit of configuration management backend proposal. Feedback desired before I go much further.
* Common use case is Conf::get( 'myVar' );
* Support for default install (new `config` table) added, should be trivial to add backends for CDB, Memcache, etc...
*
2011-05-16 21:04:55 +00:00
Domas Mituzas
a181db4587 unbreak ProfilerSimpleTrace, some Profile refactoring made it not worky :( Also, add it to AutoLoader 2011-05-16 12:50:02 +00:00
Tim Starling
db07bafb5b HipHop build fixes:
* Generate the file list from the autoloader so that it won't break so often
* Removed spyc.php from AutoLoader.php, was deleted in r86302
2011-05-15 12:25:36 +00:00
Sam Reed
6eb9588bf0 * (bug 28963) add langbacklinks module to api
Completely untested at this point, that's being done next
2011-05-14 11:29:45 +00:00
Sam Reed
959edbe49d * (bug 24711) MV_EditPageAjax.php uses deprecated LogReader and LogViewer
Not fixing usage, just SVN copy'd it from trunk into MetavidWiki extension as it's the only place still using it
2011-05-07 23:46:16 +00:00
Happy-melon
ddbf831bb0 Autoloader entries for r86041. 2011-05-07 15:30:46 +00:00
Sam Reed
c8079f0b81 * (bug 27185) API: Add Special:ComparePages 2011-05-01 21:56:02 +00:00
Sam Reed
93df2f1ac8 Move 5 more classes into cache/ 2011-04-25 21:38:48 +00:00
Sam Reed
8e0ac8db63 Move 3 files into cache directory
Move in AutoLoader to cache section also
2011-04-25 21:33:38 +00:00
Siebrand Mazeland
02e44a71b0 Revert r86872: Breaks LiquidThreads page moves with the below failure. Threads are lost and nowhere to be found any more.
[25-Apr-2011 18:12:45] /wiki/Special:MoveThread/Thread:User_talk:Siebrand/test/One_new_message: Exception: MWNamespace::getTalk does not make any sense for given namespace -1
#0 /www/w/includes/Namespace.php(81): MWNamespace::isMethodValidFor(-1, 'MWNamespace::ge...')
#1 /www/w/includes/WatchedItem.php(73): MWNamespace::getTalk(-1)
#2 /www/w/includes/User.php(2304): WatchedItem->addWatch()
#3 /www/w/includes/actions/WatchAction.php(53): User->addWatch(Object(Title))
#4 /www/w/includes/Action.php(376): WatchAction->onView()
#5 /www/w/extensions/LiquidThreads/classes/Thread.php(115): FormlessAction->execute()
#6 /www/w/extensions/LiquidThreads/classes/Thread.php(435): Thread::create(Object(Article), Object(Article), NULL, 1, 'One new message')
#7 /www/w/extensions/LiquidThreads/classes/Thread.php(414): Thread->leaveTrace('move test', Object(Title), Object(Title))
#8 /www/w/extensions/LiquidThreads/pages/SpecialMoveThread.php(107): Thread->moveToPage(Object(Title), 'move test', true)
#9 [internal function]: SpecialMoveThread->trySubmit(Array)
#10 /www/w/includes/HTMLForm.php(279): call_user_func(Array, Array)
#11 /www/w/includes/HTMLForm.php(228): HTMLForm->trySubmit()
#12 /www/w/includes/HTMLForm.php(242): HTMLForm->tryAuthorizedSubmit()
#13 /www/w/extensions/LiquidThreads/pages/ThreadActionPage.php(37): HTMLForm->show()
#14 /www/w/includes/SpecialPageFactory.php(459): ThreadActionPage->execute('Thread:User_tal...')
#15 /www/w/includes/Wiki.php(252): SpecialPageFactory::executePath(Object(Title), Object(RequestContext))
#16 /www/w/includes/Wiki.php(98): MediaWiki->handleSpecialCases()
#17 /www/w/index.php(145): MediaWiki->performRequestForTitle(NULL)
#18 {main}
2011-04-25 18:20:53 +00:00
Happy-melon
70bdc008c4 Implement an interface and abstract class to hold the widely-reused get(Request|User|Title|Lang|Skin|Output) accessors for objects acting as a context source. Article is rather messier because both getTitle() and getUser() are in use for other things, and Article::$mTitle is in extremely wide use both within Article.php and outside. 2011-04-25 17:37:43 +00:00
Daniel Friesen
99c94d0c7c Move the Interwiki class to includes/interwiki/ to make way for a more flexible Interwiki system. Do this first since svn doesn't support editing and moving a file in the same commit. 2011-04-23 02:35:21 +00:00
Brian Wolff
19a66a3238 Remove the JPEG/TIFF specific metadata code from BitmapHandler and put it in JpegOrTiff handler
to stop mostly irrelevent classes from getting it.

Also remove a method that is an exact duplicate of a base class (not sure whats with that).

This also coincidently fixes the issue with when a foreign file repo uses PagedTiffHandler
and the local one does not, and the builtin Tiff handler tries to treat the metadata as if
it was its own form.
2011-04-20 23:15:13 +00:00
Happy-melon
399f95577b (bug 13015, bug 18347, bug 18996, bug 20473, bug 23669, bug 28244) separate the password-reset request dialogue from SpecialUserlogin.
* Refactor with all the latest bells and whistles
* Allow wikis to enable resettting by entering an email address (bug 13015).  This is currently an unindexed query, but it is disabled by default so no immediate problem.
* Allow resetting to be disabled entirely (bug 20473).
* Don't send registered users' IP addresses in the emails (bug 18347)
* Check that a user is not globally blocked before letting them send messages (bug 23669)
* Display a more useful error message when an account exists globally but not locally (bug 18996).
2011-04-20 15:27:09 +00:00
Happy-melon
99f0f00879 Follow-up r86255: don't special-case redirecting special pages in executePath(), make them subclass a RedirectSpecialPage and have their execute() method do the redirection. Fixes fatal errors seen on TWN where executePath() was trying to call SpecialMyPage::execute(), which bubbled up to SpecialPage::execute() and made a horrible mess. 2011-04-19 15:45:03 +00:00
Max Semenik
f7c1ecc5ee Removed JavaScriptDistiller: unused 2011-04-19 10:13:25 +00:00
Happy-melon
f144bcfb6b Add ThrottledError to throw when the user hits a rate limit. 2011-04-18 22:29:23 +00:00
Happy-melon
0c896dcf85 Tidy and reorganise the AutoLoader array, because its almost-alphabetical-but-not-quite status was annoying me inordinately... :D classes are now divided strictly by subfolder, the subfolders are in alphabetical order, and classes within each subfolder are strictly in alphabetical order. 2011-04-17 23:42:22 +00:00
Happy-melon
1a80d46370 Rename Special:Resetpass to Special:ChangePassword. "pass" is vague and unintuitive, "reset" is only half of the page's function, and I'd quite like "Special:ResetPassword" for a much cleaner implementation of the 'enter-something-to-be-sent-a-reset-email' interface for bug 28244, bug 13015, etc. Diff looks much worse than it is because I had to update 95 language files... 2011-04-17 20:29:24 +00:00
Happy-melon
2c9cfd7cce Refactor the factory/i18n/list/etc static methods from SpecialPage into their own class; there's no reason we need to be parsing them in every single SpecialPage subclass. Leave all the methods as stubs in SpecialPage.php; if we required PHP 5.3 they could be replaced by a a __callStatic() magic method, but that doesn't work on PHP 5.2.
Also make a few changes to the functions available.  SpecialPageFactory::resolveAlias() now takes an optional subpage and returns array(<name>,<subpage>).  Similarly merge getPage() and getPageByAlias().  There were many examples of (extensions particularly) making dubious assumptions about the presence or absence of subpages or canonical-ness.

I didn't deprecate SpecialPage::getTitleFor() as it's got over six hundred calls.  I'm rather undecided on the best position of getPage()/executePath().  Although the latter needs cleanup anyway.
2011-04-17 11:31:11 +00:00
Sam Reed
7976d76041 Fix autoloader from r86175 2011-04-16 11:09:20 +00:00
Chad Horohoe
e376ee65f7 First step of reorganizing profiling files:
* Move them all to includes/profiling/* - If you're using StartProfiler, you'll need to update that
* Make ProfileStub subclass the Profiler rather than duplicating function definitions conditionally
* Removed unused params to wfGetProfilingOutput(), only used in the stub, and they didn't do anything with them
* TODO: Kill $wgProfiling, make $wgProfiler a config array and move the various options to that. Also make into a singleton, rather than global (not much calls it outside of core)
2011-04-16 02:19:40 +00:00
Brian Wolff
74f16767e7 Merge to trunk everything in img_metadata branch.
Hope I did this in an ok fashion. svn merge --re-integrate was giving me issues
so I just essentially over-wrote my working copy with the version at img_metadata.
2011-04-16 01:23:15 +00:00
Chad Horohoe
efe4525d2c Merge r81448 from REL1_17: reverting RevisionMove feature back out until somebody has the time to work on it again. Reverts r67094 and its followups in trunk: r67099, r67111, r67112, r67115, r67398, r81425, r81427 2011-04-15 23:28:13 +00:00
Chad Horohoe
c4f3fceb0b Revert r77555 and followups r77563, r77572, r78116 (merge DisableAccount to core).
Per CR at the time: this creates a nearly irreversable action that is not nearly well documented enough (even if disabled by default). 

We already have the $wgBlockDisablesLogin kludge in place for this. If we're going to do more work on this idea, it should be well thought out, not another hack.
2011-04-15 22:49:03 +00:00
Happy-melon
9e85c48612 Recommit r84805, but without removing UsersPager, which is actually a Good Thing to use for this class of queries. Yay for the end of global-function-based special pages in core. About fifteen left in extensions now... 2011-04-14 13:27:50 +00:00
Happy-melon
8779f4b55f r86001, now with less scariness :P I took out the delete action and did purge instead, which is a much more self-contained action-with-a-form. Also implement a few changes suggested by Brion on IRC last night. 2011-04-14 10:38:29 +00:00
Happy-melon
bc4a096805 Revert r86001: Brion says it's too scary :D will recommit in pieces 2011-04-13 23:36:27 +00:00
Happy-melon
6dc8136d12 New infrastructure for actions, as discussed on wikitech-l. Fairly huge commit.
* Actions come in two flavours: the show-a-form-then-do-something-with-the-result (delete, protect, edit, etc) and the just-do-something (watch, rollback, patrol, etc).  Create abstract base classes Action and FormlessAction to support these two cases.  HTMLForm is an integral part of the form-based structure.
* Look mum, no globals!  :D  Fully context-based.
* Implement watch/unwatch, credits and delete actions in the new system as proof-of-concept.  This also gives the delete frontend a much-needed overhaul.
* Stub out the newly-deprecated functions from Article.php.  This already reduces its linecount by about 15%, and there are plenty more actions still to do.
* Centralising actions like this is going to render a lot of hooks type-incompatible.  There's simply nowhere you can put the ArticleConfirmDelete hook, for instance, where it can be passed an OutputPage as the second parameter.  On the other hand, we can implement new hooks like ActionModifyFormFields and ActionBeforeFormDisplay, which can do much prettier stuff to the forms, like adding extra fields the 'right' way.  Update LiquidThreads to use these new hooks where appropriate.
2011-04-13 23:04:07 +00:00
Happy-melon
47e3f922da Implement user-is-blocked and wiki-is-read-only as exceptions. 2011-04-13 14:30:55 +00:00
Happy-melon
bb5460b771 Follow-up r85928: AutoLoader entry. 2011-04-12 23:02:02 +00:00
Brion Vibber
129b35f104 Revert r84856: restore version that works before destruction of the UsersPager class 2011-04-12 17:08:31 +00:00
Brion Vibber
02f82927d2 Revert r84805: broke CentralAuth by removing base UsersPager class used in other special pages 2011-04-12 17:04:56 +00:00
Leons Petrazickis
491259a9b2 Fixes to DB2 support. DB2 support integration with 1.17 Installer and Updater. Developed by Andre, Tiago, Diego, and Cesar as described in wikitech-l message. Reviewed by me. 2011-04-12 16:35:41 +00:00
Sam Reed
c68957c5e3 Add MWInit to AutoLoader, see if we unbreak doxygen 2011-04-11 17:37:09 +00:00
Brion Vibber
ff0524b3bc Initial stab at breaking math/texvc out to Math extension.
* (bug 14202) $wgUseTeX has been superseded by the Math extension. To re-enable
  math conversion after upgrading, obtain the Math extension from SVN or from
  http://www.mediawiki.org/wiki/Extension:Math and add to LocalSettings.php:
  require_once "$IP/extensions/Math/Math.php";

This is an initial stab, and a few things remain to be cleaned up:
* messages need to be moved from core to extension
* MW_MATH_* constants should be moved to the extension from core
* old back-compat math names interfaces using those constants should be removed from message files
* classic edit toolbar's math button should be added from the extension (or else dropped) -- currently there's not a clean hook, but could do it by JS
* couple of things like the 'armourMath' function on Language & LanguageConverter may want to be redone just as an unconditional, if that's simpler.

Setting $wgUseTeX alone will no longer have any affect. The var's still there for the moment as a few bits still need to be fully moved out from core.
2011-04-09 00:39:40 +00:00
Happy-melon
5fc6bb9f16 Fix for catchable fatals thrown on invalid titles, follow-up to miscellaneous Context commit pulled out of a hat (let's go for r85252). We must always have a Title object, even on invalid titles, for the purposes of not melting the Skin. The previous method was to make that a barely-existent half-title from SpecialPage::getTitleFor( 'Badtitle' ), where that is a special page which is not actually defined, but exists in the localisation alias lists. Instead, subclass Title as an explicit BadTitle which we can test for. The badtitle error page, which has empty string for its name in all forms, would probably be quite a good test of our JavaScript error checking. 2011-04-04 23:09:21 +00:00
Tim Starling
7bb50c630a The beginnings of HipHop compiled mode support. It works now for parser cache hits.
* Work around HipHop issue 314 (volatile broken) and issue 308 (no compilation detection) by adding some large and ugly compilation detection code to WebStart.php and doMaintenance.php.
* Provide an MW_COMPILED constant which can be used to detect compiled mode throughout the codebase.
* Introduced wfIsHipHop(), which detects either compiled or interpreted mode. Used this to work around unusual eval() return value in eval.php.
* Work around lack of ini_get() in Maintenance.php, by duplicating wfIsHipHop(). 
* In Maintenance::shouldExecute(), accept "include" as an inclusion function name, since all kinds of inclusion give this string in HipHop.
* Introduced new class MWInit, which provides some static functions in the pre-autoloader environment.
* Introduced MWInit::compiledPath(), which provides a relative path for invoking a compiled file, and MWInit::interpretedPath(), which provides an absolute path for interpreting a PHP file. Used these new functions in the appropriate places.
* When we are running compiled code, don't include files which would generate duplicate class, function or constant definitions. Documented the new requirements on the contents of Defines.php and UtfNormalDefines.php.
* In HipHop compiled mode, it's not possible to have executable code in the same file as a class definition. 
  ** Moved MimeMagic initialisation to the constructor.
  ** Moved Namespace.php global variable initialisation to Setup.php.
  ** Moved MemcachedSessions.php initialisation to the caller in GlobalFunctions.php.
  ** Moved Sanitizer.php constants and global variables to static class members. Introduced an accessor function for the attribs regex, as a new place to put code formerly at file level. 
  ** Moved Language.php initialisation of $wgLanguageNames to Language::getLanguageNames(). Removed the global variable, marked "private" since forever.

* In two places: don't use error_log() with type=3 to append to a file, HipHop doesn't support it. Use file_put_contents() with FILE_APPEND instead.
* Work around the terrible breakage of class_exists() by using MWInit::classExists() instead in various places. In WebInstaller::getPageByName(), the class_exists() was marked with a fixme comment already, so I replaced it with an autoloader solution.
2011-04-04 12:59:55 +00:00
Tim Starling
79e5ba4628 Partial revert of r85236: __autoload() is needed for HipHop interpreted mode support. 2011-04-04 01:12:22 +00:00
Happy-melon
4a0500a514 Follow-up to r85240:
* Don't stub RequestContext.  The chances of us getting away without needing to access *any* of the six major globals is nil, and in the meantime it's screwing up strong function typing and throwing catchable fatals everywhere.  

* Stop stubbing $wgOut.  The only path where we can avoid unstubbing it is if we immediately die due to maxlag overflow, and that's a) a pretty uncommon code path, and b) a DB issue which won't be affected by a tiny bit of extra apache load.  That allows us to do strong typing on function parameters with it, which is a Good Thing (TM).

Also make OutputPage::getContext() private; I'm not convinced that a context belongs here (it's *part of* the context, not a consumer of it), let's work through it a it more before we advertise its existence.
2011-04-03 20:40:27 +00:00
Happy-melon
308d853986 AutoLoader entry for r85247. 2011-04-03 14:59:58 +00:00
Daniel Friesen
c08158368c Implement the RequestContext class. Some credit to IAlex, ;) other credit for me and that plethora of bugs and hicoughs I had to deal with in impelenting it.
http://www.mediawiki.org/wiki/Requests_for_comment/Context_object (it's little different though)
2011-04-03 10:41:14 +00:00
Alexandre Emsenhuber
81e9b02ff5 * Drop 5.1 compat code
* Fix one more PHP version requirement
2011-04-03 09:44:50 +00:00
Alexandre Emsenhuber
9c03e7f7ba Removed deprecated Image class per documentation; no use in core or extensions 2011-04-02 09:34:22 +00:00
Sam Reed
0d9080cf24 Fix casing of SpecialListUsers 2011-04-02 00:26:40 +00:00
Happy-melon
3de23c36bb Follow-up r84805: convert SpecialActiveusers to not use the now-absent UsersPager. 2011-03-27 16:49:01 +00:00
Happy-melon
03cdc155b7 Topple the last bastion of global-function-based special pages. Also fix HTMLCheckField to work with GET forms. 2011-03-26 19:18:39 +00:00
Happy-melon
e943d7ed3f Update SpecialListfiles to subclass SpecialPage. Nearly there! 2011-03-26 17:50:50 +00:00
Happy-melon
97da956169 Convert SpecialListusers to subclass SpecialPage. Only two left now! 2011-03-26 16:40:57 +00:00
Happy-melon
205f6431bb Break svn blame on every single line of SpecialWatchlist.php by converting it to subclass SpecialPage and hence changing the indentation :D. SpecialInterwikiWatchlist.php is virtually a clone of this code, so make it subclass in turn and remove duplication; there is probably more that could be removed.
Only three more global-function special page implementations left.  \o/
2011-03-26 13:04:40 +00:00
Happy-melon
c5a80bfb66 Move WatchlistEditor.php to /specials since inside it is essentially a complete special page. Make it subclass SpecialPage and do all the usual stuff. Rewrite it to use HTMLForm and other exciting things, and give it a good general clean up. 2011-03-24 23:28:39 +00:00
Happy-melon
f050fabd6b Complete the trinity of blocking frontend interfaces by rewriting SpecialIpblocklist:
* Move and rename to SpecialBlockList
* Use an HTMLForm in GET mode for the options form
* Use TablePager to organise the results more nicely
* Standardise the filtration for IPs and IP ranges, so looking at blocks for a range will now also show rangeblocks which contain the range
* General tidy up
2011-03-14 16:09:44 +00:00
Roan Kattouw
867fc1cba8 (bug 27528) Incorporate Paul Copperman's minifier 2011-03-14 11:44:33 +00:00
Happy-melon
0a8a3b452c Further massive rewrite of the blocking frontend: spin out unblocking into a new SpecialUnblock.php. This leaves IPBlockList as, astonishingly enough, a list of blocks... :D 2011-03-13 21:33:52 +00:00
Happy-melon
7805997608 Divert a river through the Augean Stables that is SpecialBlockip.php.
* Move to SpecialBlock.php, and rename class appropriately
* Complete refactor
* Use HTMLForm in block form.  This changes most of the ids and field names on the form, but allows proper validation, nicer formatting, clears up several fixmes, and is generally Better(TM).
* Spin various parts out into static functions, several of which properly belong in the backend (but Block.php is a worse mess still)
* Invert some of the block options so that every checkbox makes the block more severe (so "check to disable email" is fine, but "check to allow usertalk edit" (default true) is inverted to "check to disable usertalk edit" (default false). 
* revert r40359 (move doMassUserBlock() to core).  No one seems to be using this function, which has nothing to do with the frontend UI in SpecialBlock (it might perhaps belong in Block.php); it is pretty bespoke for CheckUser, doesn't seem to have very much utility elsewhere.
2011-03-12 21:54:35 +00:00
Happy-melon
b14cde3ca7 First little bit of cleaning out the Augean stables of SpecialBlockip.php: spin out the suppressUserName/unsuppressUserName functions into their own file, to keep them with the rest of the RevDel stuff. 2011-03-11 23:33:36 +00:00
Happy-melon
73134450cd Follow-up r83298: add AutoLoader entry 2011-03-11 18:02:10 +00:00
Sam Reed
350fbc1371 Strip cookie classes out of the middle of HttpFunctions.php into Cookie.php using svn copy 2011-03-07 20:42:55 +00:00
Bryan Tong Minh
f9a36ee7bf (bug 27018) Added action=filerevert to revert files to an old version. Copied procedure from FileRevertForm, as most of the verification procedure is simple enough to not warrant the effort of writing a dedicated backend.
Further changes:
* Added Status::getErrorsByType() which returns the internal error array untouched
* Added ApiResult::convertStatusToArray() which converts a Status object to something useful for the Api
2011-03-05 17:23:35 +00:00
Happy-melon
0ebda6b3e4 Include MediaWiki:Noscript.css in <noscript></noscript> tags in the header, to allow wikis to load styles for users with JS disabled. 2011-03-05 16:01:25 +00:00
Tim Starling
f509ce8060 * Added an Ehcache client.
* Fixed encoding of spaces in memcached keys, in r83140 they would have been encoded as "+".
2011-03-04 06:01:30 +00: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
Tim Starling
d3f36ffd4d More renames and splits for objectcache reorganisation. 2011-03-03 04:48:14 +00:00
Tim Starling
af04dde290 Start of ObjectCache reorganisation. Moved the object cache files to includes/objectcache/. Split BagOStuff.php into single-class files. 2011-03-03 04:38:17 +00:00
Tim Starling
0a21e2de12 * (bug 24230) Added JAR detection. ZIP archives containing a .class file will be rejected by default. Malformed ZIP archives will be rejected due to the danger of ambiguous parsing on the client side.
* Removed the ZIP subtypes from $wgMimeTypeBlacklist, they no longer need to be there.
* Added ZipDirectoryReader. Added some small ZIP files which are used to test its various error cases. Most were constructed with a hex editor.
* Fixed getStatusArray() to return a consistent type regardless of whether the error message has parameters. This allows error messages with no parameters to work with the Status object conversion code in UploadBase::verifyFile().
2011-02-25 04:51:17 +00:00
Tim Starling
a20350dd31 * Rewrote StripState to not use ReplacementArray. The memory usage of FSS was excessive when there were many (>10k) strip items. I used preg_replace_callback(), which is slower than strtr() in the simplest case, but much faster than it when the markers have different lengths, which they usually do.
* It was not necessary to preserve the $stripState->general->setPair() interface since it wasn't used by any extensions.
* Moved StripState to its own file.
* Refactored serialiseHalfParsedText() and unserialiseHalfParsedText() so that the bulk of the functionality is in the relevant modules, instead of using scary direct access to object member variables. Made it support the new StripState. It seemed like a lot of work to go to to support an "emergency optimisation" feature in Cite. Cite updates will be in a subsequent commit.
* Fixed spelling of serialiseHalfParsedText() and unserialiseHalfParsedText(), there is unavoidable interface breakage anyway, due to cache object versioning. 
* Moved transparent tags to their own function, as requested in a fixme comment.
* Added documentation for markerSkipCallback().
* Removed OnlyIncludeReplacer, unused since MW 1.12.
2011-02-23 06:58:15 +00:00
Alexandre Emsenhuber
d18f921b57 Per Tim Starling, follow-up r76252: move WikiDiff.php to DairikiDiff.php to not confuse with the wikidiff extension 2011-02-20 16:28:13 +00:00
Max Semenik
f5377b6d02 Bug 27518: Updater calls PopulateLogSearch before adding logging.log_user_text; populateLogUsertext not called 2011-02-19 11:49:14 +00:00
Happy-melon
95cb5f395a Revert r78585. While I definitely think this is an area where there's scope for improvement in clarity and security, I'm no longer convinced that this is the way to proceed. 2011-02-16 22:29:52 +00:00
Happy-melon
eb9cf4b00c Create a user.groups module in ResourceLoader, which bundles a CSS and JS page for each usergroup the user is a member of (MediaWiki:Sysop.js, MediaWiki:Autoconfirmed.css, etc). Groups '*' and 'user' are not included. 2011-02-16 19:54:02 +00:00
Happy-melon
ef6041d750 revert r82283, loads of unrelated changes 2011-02-16 19:51:25 +00:00
Happy-melon
d64cd26a7c Create a user.groups module in ResourceLoader, which bundles a CSS and JS page for each usergroup the user is a member of (MediaWiki:Sysop.js, MediaWiki:Autoconfirmed.css, etc). Groups '*' and 'user' are not included. 2011-02-16 19:49:37 +00:00
Niklas Laxström
7694c67c99 * (bug 17160) Gender specific display text for User namespace
Second attempt for this thing..
2011-02-12 20:40:40 +00:00
Daniel Friesen
3d220be8d6 Completely remove support for legacy style skins. All legacy skinning options are now part of a SkinLegacy/LegacySkinTemplate pair that inherits from the normal SkinTemplate setup. Also ported our three built in skins to use the new legacy classes. ( ;) if you want to kill legacy skins now, you only have to svn rm 4 files) 2011-02-04 04:18:05 +00:00
Tim Starling
47b728b45b Cleanup for r66268, r66267: merge WikiImporter back into Import.php, where it started. It doesn't really make sense to have a class called WikiImporter in a file called ImportXMLReader.php, and a few little helper classes for it in a file called Import.php. 2011-01-31 07:07:43 +00:00
Tim Starling
0c86b1611a * Fixed a bug causing the installer to ignore the "engine" and "charset" settings when installing a MySQL database.
* Fixed a bug causing the engine and charset settings to not be properly preserved when adding new tables on upgrade.
* Fixed total breakage of SQLite upgrade, by reusing the administrative connection to the SQLite database instead of creating a new one when wfGetDB() is called. Added LBFactory_Single to support this. 
* Introduced a "schema variable" concept to DatabaseBase to avoid the use of globals for communication between the installer and the Database. Removed a lot of old global variable names from Database::replaceVars(), most were only added on a whim and were never used.
* Introduced DatabaseInstaller::getSchemaVars(), to allow schema variables to be supplied by the DatabaseInstaller child classes.
* Removed messages config-mysql-egine-mismatch [sic] and config-mysql-charset-mismatch. In the old installer it was possible for users to request a certain character set for an upgrade, but in the new installer the question is never asked. So these warnings were shown whenever a non-default character set or engine was used in the old database.
* In MysqlInstaller::preUpgrade(), fixed the incorrect strings used to identify the MySQL character sets: mysql5 instead of utf8 and mysql5-binary instead of binary.
* On install, initialise the site_stats table, using code copied from the old installer. Unlike the old installer, use SiteStats to increment the user count when the initial user is added.
* Fixed several instances of inappropriate call-by-reference. 
* Replaced call_user_func_array() with call_user_func() where possible, it is shorter and simpler.	
* Moved the caching boilerplate for DatabaseInstaller::getConnection() to the base class, and have the derived classes override an uncached function openConnection() instead. Updates r80892.
* In MysqlInstaller::getLocalSettings(), escape PHP strings correctly with LocalSettingsGenerator::escapePhpString(). 
* Reduce timeout for checks in dirIsExecutable() to 3 seconds, so that it doesn't take 30s to run when apache is in single-threaded mode for debugging.
* MySQL and SQLite have been tested and they appear to work. PostgreSQL upgrade is totally broken, apparently it was like that before I started. The Oracle code is untested.
2011-01-25 07:37:48 +00:00
Chad Horohoe
44dd1794a1 Partially revert r69738 (splitting Installer/CoreInstaller). As discussed on CR, this probably wasn't the best route to go with this code.
We can figure that out sometime in 1.18
2011-01-21 15:27:16 +00:00
Trevor Parscal
3fe1056d70 Addresses issues raised in an excellent review of r80656. 2011-01-21 00:03:58 +00:00
Trevor Parscal
951103eeb2 Resolved bug 26791 by replacing JSMin with a new library called JavaScriptDistiller, which is an improved version of the minification bits from JavaScriptPacker, an LGPL library. Good news - it's 2x faster than our optimized JSMin anyways, and more configurable to boot. 2011-01-20 21:57:01 +00:00
Tim Starling
eaeea84b44 * Introduced a non-dummy collation for $wgCategoryCollation, namely UCA with default tables.
* Added a maintenance script which generates a list of first letters. Unified Han are omitted for performance, and because they shouldn't be used as headings anyway. A future collation specific to Chinese would provide the KangXi radicals as "first letters".
* Provided a precomputed list of first letters. Used Unicode 6.0.0 data and ICU 4.2. 
* Moved collation functionality from Language to a Collation class hierarchy with factory function. Removed the recently-added methods from Language and updated all callers.
* Changed Title::getCategorySortkey() to separate its parts with a line break instead of a null character. All collations supported by the intl extension ignore the null character, i.e. "ab" == "a\0b". It would have required a lot of hacking to make it work.
* Fixed the uppercase collation to handle non-ASCII characters, redundantly with r80436. I don't think it's necessary to change the collation name as was done there, so I reverted that in the course of my conflict merge. A --force option to updateCollation.php might be nice though.
2011-01-17 14:02:22 +00:00
X!
aa9b9527b9 Add new Hooks class, because $wgHooks globals are evil.
$wgHooks['EventName'][] = $callback; --> Hooks::register( 'EventName', $callback );
wfRunHooks( 'EventName', array() ); --> Hooks::run( 'EventName', array() );
Tests added to complement change. Backwards compatibility added.
2011-01-17 03:35:42 +00:00
Sam Reed
0d0417be56 Fixup some of the ordering of API Autoloader stuff
$reedy->ocd++;
2011-01-11 00:55:20 +00:00
Sam Reed
589f842515 Explicitally add ApiFormatXmlRsd to the AutoLoader 2011-01-10 22:13:01 +00:00
Jure Kajzer
f853d711ac * fixed Oracle code for installer and phpunit tests
* removed ORABlob class
2011-01-10 19:22:27 +00:00
Chad Horohoe
958d82a003 Followup r68129: rename UndeleteForm to SpecialUndelete per CR. Not used in any extensions 2011-01-05 13:20:39 +00:00
X!
cbff3fe980 Followup to r79463: Move fallback functions to new Fallback class 2011-01-02 15:54:18 +00:00
X!
3589532db4 Per my comment on r68760: Make MWfunction class, complete with call_user_func helper functions that automatically
make the callback PHP 5.1 compatible with the Class::Method syntax. Add Unit tests to supplement it.
2011-01-02 06:48:07 +00:00
Alexandre Emsenhuber
8d3285fee1 Made the page_count update defered, as for the site_stats update. I just removed Article::incViewCount() since nothing else was calling this function. 2011-01-01 16:58:00 +00:00
Chad Horohoe
4a5e562591 Refactor table cloning code into its own class so it can maybe be used by things other than the parser tests 2010-12-28 00:44:16 +00:00
Chad Horohoe
c491085fd8 Revert r78903, r78904, r78905, r78906 (changing opendir() to use sfFinder class) per CR and wikitech-l objections.
It's arguable whether the code is cleaner either way, and adding all this code for the (relatively few) places we do file listings just isn't worth it.
2010-12-23 21:49:01 +00:00
X!
c4bdc6f4a1 Per discussion on mailing list, modifying some uses of opendir()/readdir()/closedir() to use new sfFinder class. 2010-12-23 18:20:13 +00:00
Roan Kattouw
1e6add8882 (bug 14869) Add API module for accessing QueryPage-based special pages. Took 2.5 years and a flight to England to get this done, but there you go :) 2010-12-22 20:35:37 +00:00
Roan Kattouw
56b5aa18ed Merge querypage-work2 branch from trunk. The most relevant changes are:
* QueryPage now uses array-based query building instead of raw SQL
* Converted all QueryPage-based special pages that were using old-style wfSpecialFoo functions to new-style SpecialPage subclasses; this is possible because QueryPage is changed to extend SpecialPage
* Backward compatibility for extensions is partly preserved: getSQL() is fallen back on for QueryPage subclasses that don't implement getQueryInfo(), but getOrder() will be ignored (implement getOrderFields() instead). This also means that dual compatibility (1.18 compat and b/c with pre-1.18) is trivial

Extension changes will be merged after this commit.

These changes make it easier to write an API module for QueryPages (bug 14869); this wasn't done in the branch but will be done in trunk soon.
2010-12-22 14:16:25 +00:00
Happy-melon
e0bec9555e Merge in Token class from my branch; would like some second opinions on the concept. This seeks to replace the much-abused $wgUser->editToken() token generator, 90% of the uses of which are not for editing but rather general actions.
Implemented for rollback mainly as a proof-of-concept; obvious further targets are patrol links and HTMLForm.
2010-12-18 23:07:30 +00:00
Chad Horohoe
4fe592b1e0 Fix a few more paths from the tests move 2010-12-16 13:49:48 +00:00
Chad Horohoe
354cb9f51c Fix a few more paths, restore a few files lost in the move 2010-12-14 16:48:44 +00:00
Chad Horohoe
b7a3afbe7e Per r76225 CR: Get rid of Autoloader::loadAllExtensions() "Anything that needs it is badly written and needs to use the AutoLoader properly." 2010-12-14 12:59:17 +00:00
Jeroen De Dauw
2e5e2db491 Follow up to r77883 2010-12-09 09:31:59 +00:00
Daniel Friesen
6016f1f968 Follow up r77893, add BaseTemplate to autoloader. 2010-12-07 16:29:49 +00:00
Sam Reed
6bfb5ec4ae Followup r77679, 1 more for bug 23332 2010-12-04 00:13:56 +00:00
Sam Reed
6c4cea2376 Fixup 1 more autoloader from r77677
Add Abstract classes explicitally to the autoloader

Move abstract classes from RevisionDelete.php to RevisionDeleteAbstracts.php (svn copy and remove of redundant classes)
2010-12-03 20:30:21 +00:00
Sam Reed
0c915ff9fa Followup r77677, fix rest of autoloader entries 2010-12-03 20:25:19 +00:00
Sam Reed
f5e059bced Move includes/RevisionDelete.php to includes/revisiondelete/RevisionDelete.php 2010-12-03 19:56:59 +00:00
Andrew Garrett
cca10f71a8 Merge DisableAccount extension into core, disabled by default because the rights are unassigned 2010-12-02 04:17:11 +00:00
Roan Kattouw
5cf2ad2c16 Fixes for r77451 per CR: add UploadStashZeroLengthFileException to AutoLoader and add $wgUploadStashScalerBaseUrl to DefaultSettings.php 2010-11-30 18:37:08 +00:00
Max Semenik
4345c2c20e Refactoring of *Field classes:
* Made them all implement one common interface (might add more functions to it later)
* Moved MySQLField to DatabaseMysql.php
* Renamed nullable() to isNullable()
* Removed maxLength() from:
** SQLiteField: makes no sense
** MySQLField: doesn't do what people may think, useless for this class' purpose of assisting querying the DB schema
2010-11-21 19:56:51 +00:00
Platonides
6a4f016cb5 Add UploadStashFile 2010-11-21 15:20:04 +00:00
Platonides
c6263590c5 Add PhpHttpRequest, added in r60811 2010-11-21 14:35:39 +00:00
Neil Kandalgaonkar
59339ca723 Fixed bug#25784 (thumbnails of stashed files had wrong description URLs).
This fixes the more general problem that the imageinfo returned with stashed uploads was inaccurate, since it was relying on
code that only worked with non-stashed files.

So, I had to:
- move the ApiQueryStashImageInfo module into core. Which others had asked for anyway, and was anticipated sometime later.
  - add lines to AutoLoader and ApiQuery to accomodate the new module

- add an ugly if/then to UploadBase -- based on the type of uploaded file, it will use a different API module to simulate a getImageInfo call. 
  I left a TODO that this situation wasn't ideal, but the way things are now, imageInfo is constructed by the API modules, when it should probably
  really be the File modules. Then the API can wrap that info into various formats.

- add a few new lines to the tests to check imageinfo information in both regular and stashed upload files
2010-11-16 06:57:46 +00:00
Brian Wolff
8adc7befe5 (Bug 25872) Rename HttpRequest class to MWHttpRequest to avoid conflict with php extension.
This also keeps the old HttpRequest class name around, so it should not break backwards compatability.
2010-11-12 07:32:09 +00:00
Alexandre Emsenhuber
f8f6417965 * (bug 24833) Files name in includes/diff/ are now less confusing
Diff.php                -> WikiDiff3.php, more descriptive
DifferenceEngine.php    -> WikiDiff.php, for consistency with the above and to make way for the file below
DifferenceInterface.php -> DifferenceEngine.php, since it contains the DifferenceEngine class
2010-11-07 16:28:11 +00:00
Chad Horohoe
9b5e160b09 Rm back-compat (was moved to the class in r36353) wfLoadAllExtensions(). Not used anywhere in core since message cache rewrite in 1.16. Can't find any uses in extensions in recent history. 2010-11-07 00:32:35 +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
Roan Kattouw
ed02d5744f Revert r76177 and use AutoLoader 2010-11-06 11:52:14 +00:00
Tim Starling
82f274088a * Introduced Xml::encodeJsCall(), to replace the awkward repetitive code that was doing the same thing throughout the resource loader with varying degrees of security and correctness.
* Modified Xml::encodeJsVar() to allow it to pass through JS expressions without encoding, using a special object.
* In ResourceLoader::makeModuleResponse(), renamed $messages to $messagesBlob to make it clear that it's JSON-encoded, not an array.
* Fixed MessageBlobStore to store {} for an empty message array instead of [].
* In ResourceLoader::makeMessageSetScript(), fixed call to non-existent function mediaWiki.msg.set.
* For security, changed the calling convention of makeMessageSetScript() and makeLoaderImplementScript() to require explicit object construction of XmlJsCode() before interpreting their input as JS code.
* Documented several ResourceLoader static functions.
* In ResourceLoaderWikiModule, for readability, reduced the indenting level by flipping some if blocks and adding continue statements.
* In makeCustomLoaderScript(), allow non-numeric $version. The only caller I can find is already sending a non-numeric $version, presumably it was broken. Luckily there aren't any loader scripts in existence, I had to make one to test it.
* wfGetDb -> wfGetDB
* Added an extra line break in the startup module output, for readability.
* In ResourceLoaderStartUpModule::getModuleRegistrations(), fixed another assignment expression
2010-11-04 07:53:37 +00:00
Neil Kandalgaonkar
902995cb1d core changes for UploadWizard (merged from r73549 to HEAD in branches/uploadwizard/phase3) 2010-11-03 04:32:41 +00:00
Derk-Jan Hartman
d6f2e8e9e6 * Moving wfGetSVGSize() and wfScaleSVGUnit() into a seperate SVGMetadataExtractor.
* SVG metadata is now stored and versioned.

Chosing not to provide fallback for these functions as they seem unused outside of SVG.php (per Google) and grep.
2010-11-01 23:57:09 +00:00
Bryan Tong Minh
e9fd126b9a (bug 25648) API discovery information has been added as RSD link in page <head> and by providing an API module action=rsd. Added hook ApiRsdServiceApis for extensions to add their own service to the services list.
Patch by Brion Vibber and Bryan Tong Minh.
2010-10-28 19:20:21 +00:00
Antoine Musso
6a45ff534c Follow up r67073 : add curly to if statement 2010-10-21 18:26:17 +00:00
Trevor Parscal
70bae52c12 Part 2 of 2, moved ResourceLoader*Module classes to their own files - this commit removes the non file specific code. 2010-10-19 18:31:09 +00:00
Trevor Parscal
ef6baa91de Moved ResourceLoader classes to their own folder, preparing to also split ResourceLoaderModule.php into multiple files (it's getting a bit long now) 2010-10-19 18:21:38 +00:00
Sam Reed
035218f403 Revert r74913, caused many problems, and was only likely to cause more in the future 2010-10-17 21:18:04 +00:00
Sam Reed
47b13d184c Move profiler stuff to own folder, updater AutoLoader to match
ProfilerSimpleTrace isn't in AutoLoader. Neither is ProfilerStub

Profiler also says " * This file is only included if profiling is enabled"...
2010-10-17 19:04:05 +00:00
Chad Horohoe
002cdd47e1 Move parser test related stuff to tests directory
* Moved test record stuff to testHelpers.inc, could be useful for non-parser test stuff?
* Everything else in tests/parser
* parserTestsParserTime from r12533 doesn't seem used?
2010-09-28 12:24:56 +00:00
Priyanka Dhanda
c6c85df11b Followup to r73500. SeleniumTestConfig renamed to SeleniumConfig. Make sure SELENIUMTEST is defined to use it.
Fixed some indents and pass by reference warnings
2010-09-22 21:23:21 +00:00
Max Semenik
baa6b89458 Class doesn't exist anymore 2010-09-22 07:42:59 +00:00
Priyanka Dhanda
0de6d13f50 RunSeleniumTests.php: Cleaned up a few options that this script takes. Settings are now through a file passed into seleniumConfig or via a hook SeleniumSettings. Reasonable default values when some value is not found. 2010-09-22 00:16:43 +00:00
Trevor Parscal
1329158215 * Added exporting of user preferences
* Renamed user.preferences to user.options
* Fixed bug that caused anonomous usernames (such as IP addresses) to be used in user style and script requests
* Fixed user options styles not loading for anon users
2010-09-14 21:47:59 +00:00
Trevor Parscal
7f523d754f Broke part of ResourceLoaderSiteModule into ResourceLoaderWikiModule (abstract parent). This paves the way for ResourceLoaderUserModule which will come next. 2010-09-10 21:40:42 +00:00
Alexandre Emsenhuber
934e7e6df1 Use the AutoLoader instead of manually requiring these files 2010-09-10 16:53:35 +00:00
Trevor Parscal
c5aa835502 Moved stand-alone libraries to includes/libs. 2010-09-09 19:57:11 +00:00
Aryeh Gregor
9ac33a362f Move DatabaseType to Database.php
This way the required method names will show up when grepping
Database.php.  I thought we had no affectedRows() method for a minute
there, until G_SabinoMullane corrected me (good thing I think aloud
in #mediawiki).
2010-09-08 17:48:11 +00:00
Trevor Parscal
8c50f16c24 Merged reorganization work for PHPUnit from branches/phpunit-restructure/ 2010-09-07 23:02:56 +00:00
Roan Kattouw
32377424b9 Merging resourceloader branch into trunk. Full documentation is at http://www.mediawiki.org/wiki/ResourceLoader and a general overview has been posted on wikitech-li <http://lists.wikimedia.org/pipermail/wikitech-l/2010-September/049253.html>. One important change is that all JS is now loaded at the bottom, so any scripts assuming things from wikibits or whatever are present will fail. 2010-09-04 04:00:09 +00:00
Alexandre Emsenhuber
58814d9365 Moved OracleUpdater to its own file so that I can stop asking me why this file is missing 2010-09-03 18:53:19 +00:00
Platonides
5a244555e3 Make a bunch of incompatible changes to the PoolCounter.
It wasn't finished, so it's not a big deal.

* Use the term workers instead of threads, which fits better for a multiserver setup.
* The API is now more accurate for our goals (I hope).
* Add support for using the parse from another worker.
* Use child classes instead of array callbacks.
* The daemon is written in C using libevent instead of python using twistd.
* The hash function used is that of Bob Jenkins, with files hash.c and hash.h directly copied from memcached 1.4.5
* Although similar in a few aspects to memcached assoc.c hash table, this is a different hash table implementation. Most important:
** The usage of a double linked list in the hash table.
** Growing is not performed using a maintenance thread. Since the entries are shortlived, it just waits for the old hash table to disappear.
* Note: valgrind 3.5.0 (2009-8-19) does not support accept4 (added in r10955, 2009-11-25). In the meantime you need to use HAVE_ACCEPT4=0 for running with valgrind (as you would need for a non-linux system).
* Sending SIGUSR1 to the daemon gracefully restarts it. The maximum limits will be doubled until the old instance finishes (ie. all its client connections expire).
* Do not try to test it with instances calling an ?action=purge They will serialize on the "UPDATE  `page` SET page_touched" query instead of being serialized by the PoolCounter.
* The workers parameter is not stored by the poolcounter. It is expected that all requests with the same key will also have the same value. A reduction in new entries will not take effect if that number is working (not even when they end, if there are waiting entries). But an increase will increase throughput even for old queued requests.
2010-08-27 20:57:32 +00:00
Sam Reed
607a74833e Move ApiFormatYaml_spyc.php to spyc.php as per r71763 2010-08-26 23:37:59 +00:00
Chad Horohoe
6095eabaa7 Copy paste fail 2010-08-26 23:31:00 +00:00
Chad Horohoe
8b822ef0c6 Per wikitech-l discussion, it would be kind of cool if we collected our non-MediaWiki-specific classes in one location to encourage reuse. So I moved IEContentAnalyzer to includes/libs and put a README for 3rd party users. Code that goes in includes/libs should call ZERO MediaWiki code. This means no wfProfileIn, no globals, nada 2010-08-26 23:22:17 +00:00
Chad Horohoe
dbad19adc9 Move all abstract stuff that DatabaseBase children must implement to new interface DatabaseType. Puts all of the 'must implement' things in one place. Also lets me use abstract statics, as a workaround for r71441 2010-08-26 23:10:11 +00:00
Alexandre Emsenhuber
1fc0ad5a56 Modified Special:Categories to subclass SpecialPage 2010-08-21 15:39:07 +00:00
Chad Horohoe
4f24580f96 Add a post-update maintenance script list, moved deleteDefaultMessages into it. 2010-08-16 14:23:28 +00:00
Chad Horohoe
f08c6b1df9 Initial refactoring for Postgres; DatabaseUpdater subclass is now passed to LoadExtensionSchemaUpdates 2010-08-15 18:55:08 +00:00
Alexandre Emsenhuber
66bf91c71e Modified Special:Protectedpages and Special:Protectedtitles to subclass SpecialPage 2010-08-15 16:57:07 +00:00
Jeroen De Dauw
b6cef6601d Moved in repository interaction classes from Deployment so it's possible to use them in the new installer for update detection 2010-08-15 09:40:16 +00:00
Chad Horohoe
985e8971c8 Get rid of StubUser. Constructing a user object isn't quite as intensive as it once was. It actually takes more time using the StubUser (construction + unstub on first call) than just initializing User::newFromSession() from the start. Either way, the real overhead starts when you start calling methods (for the nitpicky, the optimization was only about 20µs. The real gain here was eliminating a StubObject) 2010-08-12 17:10:00 +00:00
Max Semenik
a2449fea86 maintenance/sqlite.php: added the ability to check .sql files for SQLite compatibility 2010-08-12 16:06:47 +00:00
Platonides
0825b757f6 Move pieces related to ParserOutput expiry into a new CacheTime class. 2010-08-09 14:58:08 +00:00
X!
a1422fa2be Add format=dump and format=dumpfm, outputs results in PHP's var_dump() format. Finding the type of a variable is a little annoying with txt, and dbg is a little bit harder to parse. 2010-08-09 00:19:55 +00:00
Alexandre Emsenhuber
5be509b0c1 * Standardised file description headers
* Added some descriptions
* Added @file where needed
2010-08-08 14:23:14 +00:00
Chad Horohoe
38e663d0ed Kill NamespaceCompat. Nothing, anywhere (not even comments, since r70692) still references the old class. To do so means to not support 5.3+ 2010-08-08 13:16:10 +00:00
X!
685ef510ee -(bug 24484) Add prop=pageprops module
-Add $wgPageProps global variable
2010-08-07 18:50:23 +00:00
Max Semenik
f926958592 Good bye, SearchMysql4! 2010-08-07 07:51:52 +00:00
Ryan Bies
070122e8b9 DatabaseMssql class and related changes 2010-08-06 23:44:00 +00:00
Markus Glaser
c33219442b load selenium test suite instead of single test 2010-07-31 12:01:12 +00:00
Bryan Tong Minh
546a55a79d (bug 23380) Uploaded files that are larger than allowed by PHP now show a useful error message.
Introduced a WebRequestUpload class which is a wrapper around $_FILES and contains all getUpload* and getFile* methods. This has as advantage that the upload can be passed along without $wgRequest. Also because I like objects.
2010-07-27 20:38:36 +00:00
Max Semenik
20a509c735 Fix autoloader borkage (from Jeroen's refactoring?) 2010-07-24 21:30:41 +00:00
Jeroen De Dauw
a620daf697 Split Installer into Installer and CoreInstaller + made misc style and doc improvements 2010-07-22 17:58:26 +00:00
Chad Horohoe
98ab38038d * Split Mysql/Sqlite updates into their own files
* Rename Update -> DatabaseUpdaters to be more consistent with DatabaseInstaller
* Made DatabaseUpdaters abstract and merged the Updaters interface in, had Mysql/Oracle/Sqlite subclass it. Entry point is now factory DatabaseUpdaters::newForDB()
2010-07-20 22:28:50 +00:00
Jeroen De Dauw
05e8dc29f8 Renamed InstallerDBType to DatabaseInstaller 2010-07-20 09:30:33 +00:00
Jeroen De Dauw
c8f72a02bf Follow up to r69528 (forgot to commit this file) 2010-07-19 04:18:51 +00:00
Alexandre Emsenhuber
2c9d0dc4a4 * Modified Special:Log to extend SpecialPage
* Use FormOptions
2010-07-18 12:10:39 +00:00
Alexandre Emsenhuber
47df637812 * Modified Special:Blockme to subclass UnlistedSpecialPage
* Use content language to get the user name in the "proxyblocker" and added it in $wgReservedUsernames
2010-07-17 18:32:15 +00:00
Chad Horohoe
8b8b40aa63 Add stub OracleUpdater 2010-07-17 12:11:23 +00:00
Niklas Laxström
4f845e3e07 Revert part of r69412 which causes fatal errors 2010-07-16 07:24:45 +00:00
X!
8cc3688dfd Move FakeResultWrapper to Database.php, allowing more special pages and extensions than just Special:Allmessages to use a ResultWrapper-specific class (TablePager comes to mind) 2010-07-15 22:39:48 +00:00
Alexandre Emsenhuber
537b6d6d28 Modified Special:Userlogout to subclass UnlistedSpecialPage 2010-07-11 14:17:17 +00:00
Alexandre Emsenhuber
33cdc2202b * Modified Special:Specialpages to subclass UnlistedSpecialPage instead of using wfSpecialSpecialpages()
* Use Html:: methods
2010-07-10 20:13:06 +00:00
Bryan Tong Minh
55c96b6ca3 Revert r64436, r64437, r64508 per CR r64436 2010-07-09 09:46:05 +00:00
Chad Horohoe
1dc0438117 Change Updaters to Updater 2010-07-08 15:00:00 +00:00
Chad Horohoe
93d24bedf4 Refactor a lot of updaters.inc into some classes in the installer code. Still need all these blasted global functions. And OpenID still uses $wgUpdates, so support for it remains...for now! 2010-07-08 14:57:19 +00:00
Alexandre Emsenhuber
1ade5c518b Modified Special:Filepath to subclass SpecialPage; also changed some calls from Xml:: to Html:: 2010-07-03 18:39:20 +00:00
Mark A. Hershberger
c4100fb83b * Eliminate CLIInstallerOutput per r68645 since, yes, it wasn't needed.
* Make sure output only happens in the top-level Installer implementations.
* Differentiate Status warning messages from Status error messages in the Installer.
* Change abstract method from Install::showStatusError() to Install::showStatusMessage() since we'll use it to show warnings now, too.
* TODO Need a better way to extract/display Status warning messages since, from my look at the Status class, it looks like warnings are implemented, but not really used.
2010-07-02 21:15:13 +00:00
Mark A. Hershberger
2dbed8d5cd * consolidate some installer functionals into the Installer class
* add beginning of CliInstallerOutput class
* make it possible to override LocalSettings from a maint script
* make basic cli installation possible (only tested mysql so far)
2010-06-27 21:48:51 +00:00
Tim Starling
1fcfd134d1 * Integrated the selenium tests into MediaWiki properly, and removed the insecure LocalSeleniumSettings.php concept.
* Removed the insecure web entry point hiding in the maintenance directory, in RunSeleniumTests.php. Replaced it with a special page interface, with CSRF protection and access control. If you wanted a secure web entry point, then I suppose this is how it would be done, but I think it should be killed ASAP.
* As in r68544, removed as many require() calls as possible, since nobody seems to know how to do them properly. Made the usual changes to make classes autoloader-compatible: class constants instead of define(), no file-scope registration code.
2010-06-25 05:55:23 +00:00
Tim Starling
752046eecf * Removed require/require_once from maintenance scripts where possible, replaced by the AutoLoader, since register_globals vulnerabilities and inappropriate include_path dependencies are so common.
* Rearranged PHPUnit startup so that MediaWiki can be started from the file scope, as required by Setup.php and other core MediaWiki startup files. The custom entry point maintenance/tests/phpunit starts MediaWiki and then passes its arguments through to PHPUnit.
* Moved the parser test tag hooks into classes and moved their registration to parserTests.inc, to allow autoloading.
* Renamed ApiSetup to ApiTestSetup, MediaWiki_Setup to MediaWikiTestSetup, PTShell to ParserTestSuiteBackend.
* Moved command-line initialisation code from the file scope of parserTests.inc to parserTests.php to allow autoloading
* Rewrote the interface between PHPUnit and the parser tests. Removed all the hacks designed to make the rest of the PHPUnit tests work without proper teardown of the parser test environment. Moved the PHPUnit_Framework_TestSuite subclass to a file that's not scanned by PHPUnit, to avoid "no tests found" warnings". 
* Removed the {{NUMBEROFARTICLES}} parser test, too hard to make it work consistently.
2010-06-25 02:55:51 +00:00
Mark A. Hershberger
e3644ae2c4 * Adapt install.php to a more “traditional” maintenance-style script so it can extend and use Maintenance class convenience methods.
* Add CliInstaller class and put it in the autoloads.
2010-06-23 01:08:34 +00:00
Derk-Jan Hartman
0ccd98bdb6 Add a new PNG parser in order to recognize APNG (animated PNG) images. 2010-06-20 16:09:12 +00:00
Derk-Jan Hartman
385bd8a911 (bug 23621) New Special:ComparePages to compare (diff) two articles. 2010-06-19 21:17:42 +00:00
Mark A. Hershberger
bd2773b3cd Organise sub-dirs in AutoLoader.php 2010-06-17 22:28:06 +00:00
Alexandre Emsenhuber
2f0c3efd09 Changes to Special:Lockdb and Special:Unlockdb:
* Subclass SpecialPage instead of using wfSpecial*() functions
* Now validate correctly when output is HTML5
2010-06-13 13:52:20 +00:00
Tobias
d73fb3713e New feature RevisionMove (bug 21312). Introducing SpecialRevisionMove.php and revisionmove permission. Experimental, use at own risk (no group has this permission by default, so it should not break anything unless you are foolish enough to experiment with it :)) 2010-05-30 18:00:01 +00:00
Siebrand Mazeland
d279df340e Ran stylize.php, removed trailing whitespace, updated indentation and code formatting. 2010-05-30 14:48:30 +00:00
Andrew Garrett
4e19e40962 Fix r66858 -- reassign classes in the AutoLoader 2010-05-26 06:22:36 +00:00
Sam Reed
411600af87 * (bug 23524) Api Modules as followup to bug 14473 (Add iwlinks table to track inline interwiki link usage
Addition of IWBacklinks... That should be the bug done
2010-05-25 19:50:20 +00:00