Commit graph

572 commits

Author SHA1 Message Date
Happy-melon
90f04fbb18 Follow-up r89408, r86872: restore IContextSource and ContextSource, to be more carefully reimplemented. 2011-06-27 19:38:30 +00:00
Tim Starling
0e73205470 General database-related code cleanup:
* Merged the 4 simulated implementations of Database*::replace(). I took diffs, they were nearly identical. I made one based on the IBM DB2 version, since it used insert() which looked like a nice touch.
* Provided the non-simulated implementation of Database*::replace() via a protected member function, and made DatabaseMysql::replace() and DatabaseSqlite::replace() into a wrapper for it. 
* Moved the MySQL-specific functionality from masterPosWait(), getSlavePos() and getMasterPos() from DatabaseBase to DatabaseMysql. 
* Renamed getStatus() to getMysqlStatus() and moved it to DatabaseMysql. Removed "unimplemented" errors from two other subclasses. Really there's no way another DBMS could or should implement this function. 
* Split the LoadMonitor class into a no-op class and a MySQL-specific class, to avoid fatal errors due to the getMysqlStatus() call if other DBMSs tried to use LoadBalancer with multiple servers. Of course there are lots of other reasons it won't work, I'm just fixing the architecture issue here.

And while I have a replicated test setup handy:
* On MySQL 4.1.9 and later, use SHOW SLAVE STATUS to get the lag instead of SHOW PROCESSLIST. This has the advantage of reading zero when there are no events for a while.
2011-06-23 03:14:11 +00:00
Alexandre Emsenhuber
e275ea28a9 Moved action=info to an Action subclass; also changed display to use a table (a bit like Special:Statistics) with a column for the page and one for the talk page 2011-06-20 18:55:17 +00:00
Brian Wolff
35740d5b64 (follow-up r86567) per CR rename the class JpegOrTiffHandler to ExifBitmapHandler. 2011-06-17 03:37:59 +00:00
Tim Starling
b1e8887f68 Maintenance script for exporting the preprocessed wikitext from installer document pages, plus relevant refactoring. For use in updating http://www.mediawiki.org/wiki/Release_notes/1.17 etc. 2011-06-14 03:09:49 +00:00
Krinkle
32d29b93ea (bug 28556) Remove MacBinary
* IE5 for Mac is history.
2011-06-13 19:00:49 +00:00
Alexandre Emsenhuber
535a8adea8 Moved action=deletetrackback and action=markpatrolled to Action class.
Also fixed order in DefaultSettings.php
2011-06-12 18:46:07 +00:00
Alexandre Emsenhuber
7245d8dca6 * Made Special:RevisionDelete use the local variables stored in the RequestContext object instead of global ones and removed the $skin member
* Also updated classes in includes/revisiondelete that were using the $skin member of Special:RevisionDelete
* Handle action=revisiondelete (or rather action=historysubmit&revisiondelete=1) with an Action object that sets the RequestContext object of the SpecialPage object, and in this case get the target Title object through the context instead of $wgTitle
2011-06-11 08:30:19 +00:00
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