Commit graph

549 commits

Author SHA1 Message Date
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