Commit graph

714 commits

Author SHA1 Message Date
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
Sam Reed
82b16eb1d6 Try r66856 again - Less fail this time
Part of bug 23332

Move everything that isn't the SpecialRevisionDelete class out of specials/SpecialRevisiondelete.php into RevisionDelete.php
2010-05-24 23:32:05 +00:00
Sam Reed
a4a31c5534 Revert r66856, due to the complete rubbish commit summary (dupe of another revision) 2010-05-24 23:28:00 +00:00
Sam Reed
c0ab171334 bug 18608 done in a fashion much closer to how I should've done it originally.
Latching onto bug 22061 output

Following up r62195 and r61125Part of bug 23332

Move everything that isn't the SpecialRevisionDelete class out of specials/SpecialRevisiondelete.php into RevisionDelete.php
2010-05-24 23:24:17 +00:00
Sam Reed
5b5bf3ba53 Part 1 of Bug 23524 - Api Modules as followup to bug 14473 (Add iwlinks table to track inline interwiki link usage)
Addition of ApiQueryIWLinks (prop=iwlinks)
2010-05-14 20:54:55 +00:00
Mark A. Hershberger
e5cc87957f Move jobqueue classes to their own directory. 2010-05-14 16:23:26 +00:00
Chad Horohoe
42208a64ee (bug 22844) Support Micosoft Windows Cache aka WINCACHE 2010-05-13 17:41:13 +00:00
Andrew Garrett
59e7d4374f Function accessibility changes, documentation, revert function rename for r66267 2010-05-12 13:37:45 +00:00
Andrew Garrett
c9ebbcd09b Rewrite of XML Dump Processing:
* Full rewrite of the WikiImporter class to a new class, XMLDumpImporter, which uses XMLReader instead of the deprecated PHP SAX interface.
* Fixes for the following bugs:
** XML Dump Processor chokes on unrecognised tags.
** Special:Import does not allow you to import a dump including only log entries.
* Added hooks to allow extensions to handle tags in any part of the XML document.
* Fully source-compatible with the previous interface.
2010-05-12 13:28:13 +00:00
Sam Reed
e4eca2c65e * (bug 21346) Make deleted images searchable by hash
Based roughly on ApiQueryAllimages
2010-05-10 22:41:16 +00:00
Chad Horohoe
a4393915e2 Merge new-installer branch to trunk
* This is not complete yet, and should not be used outside of testing. Using it on a production database may ruin everything. This is the reason for the second entry point of new-index.php. You've been warned. 
* Known issues are at [[mw:New-installer_issues]]. Please add new items to the list if you find them.
2010-05-07 12:25:01 +00:00
Chad Horohoe
967510a4b6 Remove current MSSQL implementation from trunk. See wikitech-l for discussion. 2010-04-21 16:29:29 +00:00
Mark A. Hershberger
9c7a7e57f0 * New UploadFromUrlJob class to handle Upload-by-Copy
* Define variable for ApiUserrights.php that wasn't defined before.
* Add convertVerifyErrorToStatus and getVerificationErrorCode to
  UploadBase to translate error consts since UploadFromUrl will
  need a message to display to end-users.
* refactor mime-checking out of UploadBase::verifyFile into
  UploadBase::verifyMimeType
* Make UploadBase::verifyFile always return arrays for errors
* Use HttpFunctions instead of custom curl handler for async downloading
* TODO: Need a way to feed errors back to the requestor
* TODO: Need to add watchlist param handling and warnings checks.
2010-04-17 02:43:13 +00:00
Happy-melon
38c7c8f895 Overhaul Special:EmailUser, use HTMLForm, a SpecialPage-derived class, and general tidy up. Message change got muddled into r64901. 2010-04-10 21:14:35 +00:00
Happy-melon
edd817184c Revert r64478 - April Fool's is well over. 2010-04-03 10:13:34 +00:00
Happy-melon
d01808060f Follow-up to r64478 - pull out debugging code 2010-04-01 12:44:42 +00:00
Happy-melon
8f58352be6 Rewrite the parser in a more friendly and accessible implementation... 2010-04-01 10:50:43 +00:00
Matthew Britton
f83fb12d1d (bug 22339) "Go" result should be available through the API 2010-03-31 14:08:55 +00:00
Niklas Laxström
61095ced9f New message class up for discussion and development.
Not ment for use yet. It is just isolated file so it really doesn't need branch either.
2010-03-22 17:05:32 +00:00
Chad Horohoe
66dc879194 Refactor MergeHistory to subclass SpecialPage. Ohai unloved code :) 2010-03-18 16:41:53 +00:00
Chad Horohoe
a9bc586e62 Force loading of Sanitizer in setUp() so defines() are always present before tests. 2010-03-12 22:52:11 +00:00
Bryan Tong Minh
dd349d7b3a Merge r63621 and r63636 from REL1_16:
* Rollback chunked uploading support for 1.16
* 	Pass $sessionKey as parameter to UploadFromStash::initialize.
2010-03-12 18:26:12 +00:00
Aaron Schulz
c7b59430ee Moved MediaTransformOutput.php to /media dir 2010-02-26 07:29:38 +00:00
Max Semenik
946fec3399 Removed MMCache support, this thing is dead. Partially implements bug 19193 2010-02-16 12:56:02 +00:00
Siebrand Mazeland
f8b1c4cfb7 Random indentation and code formatting updates. No functional changes. 2010-02-14 22:07:30 +00:00
Alexandre Emsenhuber
b8ac2d6fda Fixed a doxygen warning 2010-02-12 21:37:22 +00:00
Mark A. Hershberger
c74fe71cd8 * new FauxResponse class to help with unit testing
* Add append() method to FileRepo classes to enable chunked uploading
* Change chunksessionkey to chunksession
* Remove echo json stuff
* Fix a multitude of bugs in my own code
* still to test: mwEmbed use of chunked upload
2010-02-10 10:36:11 +00:00
Tim Starling
cb982cfa1c * (bug 21551) Rewrote the Squid purge HTTP client to provide a more robust and general implementation of HTTP, allowing it to purge non-Squid caches such as Varnish. Tested against Squid (keep-alive on or off), Varnish, various kinds of network error, benchmarked at ~3k req/s.
* Reverted what was left of r59178
* Removed $wgDebugSquid, didn't do anything anyway
2010-02-05 03:36:04 +00:00
Tim Starling
c7a8875329 * Fix for r57997 and bug 21222: move math, gallery, pre and nowiki to a new module called CoreTagHooks, analogous to CoreParserFunctions.
* Extended the return interface for tag hooks in a way analogous to the one for parser functions, allowing <nowiki> and <html> to specify that they want to be in the nowiki replacement array instead of the general replacement array.
* Removed ParserOptions::setUseTeX() and related. If <math> is going to be registered in firstCallInit(), then it needs to be stable across multiple parser calls and not change based on parser options. Only one extension caller.

In parserTests.inc: 
* Fixed parser test failures due to $wgMathDirectory not being properly set up. The math directory of the host wiki was being used, leading to a parser test failure if it was not writable.
* Fixed message cache hack from r15502. Made parser tests not fail in the case where a tested message is overwritten by the local wiki. All tests now pass on my installation.
2010-02-03 07:10:58 +00:00
Mark A. Hershberger
62177bc9d1 follow-up r61655 fill out the rest of the missing messages
Add cookie handling to HttpFunctions.
2010-02-03 06:19:47 +00:00
Mark A. Hershberger
c06e4d5fa7 Parser tests now working under phpunit 2010-01-27 07:00:07 +00:00
Tim Starling
fd93e58904 * Removed JS2 stuff from jquery.js. If there's anything we really need from it, it can be re-added to wikibits.js, but that can wait for the extension analysis which I'm going to do next.
* Added Ryan Grove's jsmin.php and wrote a maintenance script wrapper called minify.php
* Added a makefile to rebuild skins/common
* Rebuilt jquery.min.js
2010-01-27 05:17:26 +00:00
Max Semenik
6c7bb57316 Special delivery for Nikerabbit: ability to connect to a SQLite db file directly, no foreplay with global settings needed. 2010-01-22 21:30:23 +00:00
Mark A. Hershberger
c5d228be4c UploadChunks added from js2 branch. Refactored. Still needs to be
tested w/o the UI first.
2010-01-22 04:37:23 +00:00
Mark A. Hershberger
f16507a49c Make tests work, note skipped tests, update autoloader for FakeMemcachedClient, take care of strange variable scoping issues in autoloaded Namespace.php. 2010-01-11 03:47:04 +00:00
Max Semenik
4b0299a765 Severely refactored the SearchResultSet descendants system, consolidating most od the code into one class. Ping r58322. 2010-01-09 14:30:55 +00:00
Tim Starling
ed9273a250 Add missing class LanguageConverter 2010-01-04 05:55:33 +00:00
Alexandre Emsenhuber
b8b19d733e Follow-up r60412: forgot to remove the class from AutoLoader 2009-12-26 16:51:15 +00:00
Aryeh Gregor
984be432fc Add rudimentary MediaWiki support to ExternalAuth 2009-12-10 01:51:22 +00:00
Aryeh Gregor
d4c6696bb7 Add new ExternalAuth mechanism, Hardcoded
This just lets you enter the database by hand in LocalSettings.php, for
testing.  Now other people can actually test ExternalAuth without having
a vBulletin license.  23 lines not counting whitespace/comments/closing
braces, and took me ~20 minutes to write.
2009-12-10 01:05:13 +00:00
Tim Starling
7688101426 Removed JS2 work (has been moved to the js2-work branch). Has been lightly tested, should mostly work. Some of the more complicated associated changes are listed below.
* Reverted HttpFunctions.php to r45549 and renamed wgSyncHTTPTimeout back to wgHTTPTimeout
* Edited out the asynchronous features from UploadFromUrl. Made fetchFile() use the curlCopy() function from new-upload r47811 instead of Http::doDownload(). Wrote my own URL validity check to avoid having to use either of the two buggy precedents.
* Removed UploadFromChunk
* Removed chunk upload and background status from ApiUpload.php
* Reverted r54669, use of addScriptClass()
* Left getHeadScripts() in its current location (OutputPage) instead of moving it back to SkinTemplate, just added wikibits.js to it to replace the removed addCoreScripts2Top()
2009-11-26 12:00:36 +00:00
Alexandre Emsenhuber
002fb024b0 * (bug 21403) memcached class renamed to MWMemecached to avoid conflict with PHP's memcached extension
* Put MemCachedClientforWiki in memcached-client.php so that maintenance/mctest.php doesn't crash when $wgMainCacheType is not CACHE_MEMCACHED
Based on a patch by Kim Hyun-Joon
2009-11-20 15:37:28 +00:00
Roan Kattouw
1d471caa46 API: (bug 19004) Add support for tags. Patch by Matthew Britton 2009-11-01 10:42:41 +00:00
Max Semenik
798cfc5ade Merge SQLite search from branches/sqlite/ to trunk 2009-10-29 16:19:35 +00:00
Chad Horohoe
dcac5f193e (bug 19859) Remove HTMLDiff. Could possibly be salvaged as an extension one day, but not today. DifferenceEngine and friends will need some refactoring to allow spinning this off. In the meantime, removing the mostly-broken experimental feature. Its always in the logs if anyone wants to reuse the code somewhere else one day 2009-10-28 18:18:05 +00:00
Chad Horohoe
25a68735f7 Add bunch of missing classes to the Autoloader 2009-10-25 13:37:15 +00:00
Max Semenik
acea2c14c0 Follow-up to r58067: removed UploadFormMogile from AutoLoader 2009-10-25 13:13:22 +00:00
Max Semenik
ae57ab1eec (bug 20275) Fixed LIKE queries on SQLite backend
* All manually built LIKE queries in the core are replaced with a wrapper function Database::buildLike()
* This function automatically performs all escaping, so Database::escapeLike() is now almost never used
2009-10-21 19:53:03 +00:00
Bryan Tong Minh
91e4d80448 Rewrote Special:Upload to allow easier extension. Mostly backwards compatible towards the end user: tested with Commons' upload scripts.
* Special:Upload now uses HTMLForm for form generation
* Upload errors that can be solved by changing the filename now do not require reuploading.
2009-10-18 19:41:01 +00:00
Michael Dale
0df1f91e53 * stubs for api iFrame Proxy system. Early summary in /js2/mwEmbed/apiProxy/
** testing page for proxy setup (hard coded to localhost) 
** added basic support to skin.php for enabling of apiproxy (off by default) 

* added flickrSearch as another remote repository
* other refactoring, cleanup of remoteSearchDriver (add-media-wizard) 

* removed query.json.1-3.js 
* removed jquery.secureEvalJSON.js 
* replaced with official http://www.JSON.org/json2.js script which is only included if JSON is undefined
2009-10-17 10:35:46 +00:00
Aaron Schulz
1c4e82f84d Moved UI diff stuff into its own DifferenceInterface file 2009-09-30 15:36:55 +00:00
Brion Vibber
0d1d984313 Revert broken rewrite of login system; totally broken.
* Login doesn't attach to session properly, so can't stay logged in!
* Password field shown in plaintext!

If it just DOESN'T WORK please keep it on a work branch, don't put it in trunk!

Reverted:
r56682
r56683
r56684
r56686
r56688
r56696
r56699
r56702
r56703
r56704
r56782
r56896
2009-09-26 00:49:32 +00:00
Happy-melon
d3f901b029 Merge in Login rewrite, second time lucky. 2009-09-20 20:28:27 +00:00
Alexandre Emsenhuber
92bd0ac1a0 Only set "unserialize_callback_func" if we use it, otherwise it can throw warning saying that __autoload() is not defined 2009-09-17 21:52:40 +00:00
Michael Dale
3d958564ec * Enhanced OutputPage to support js2 style javascript without scriptloader enabled
** loadGM output
** unique request id based on wikiTitle revision / file time
* Moved jsAutoLoadClasses to setup.php ( made conditional )
2009-09-17 01:19:02 +00:00
Michael Dale
1e4165061b more (bug 20336)
* added json folder 
* moved Services_JSON.php there
* moved Format JSON into its own class
* updated AutoLoader
2009-09-10 14:33:25 +00:00
Brion Vibber
841014ad91 Revert broken rewrite of login forms:
r55990 "* Totally refactor includes/specials/SpecialUserlogin.php:"
r55991 "Followup to r55990 - Remove debugging hack :("
r55994 "Followup to r55990 - rename method to avoid PHP Strict warnings"
r55997 "Follow-up to r55990, per comments:"

Continued reports of breakage with the new version...
Non-vital changes of this magnitude should probably be worked up on a branch to ensure everything's consistent before pushing them to trunk.
2009-09-08 18:40:05 +00:00
Andrew Garrett
8ce84340bf Add AJAX category management system. Includes suggestion system, dialogs for setting edit summaries and confirming, and methods for adding and removing all categories, but only directly in the page text (as categories in templates cannot be removed). 2009-09-08 15:02:41 +00:00
Happy-melon
fca012212f * Totally refactor includes/specials/SpecialUserlogin.php:
** Split backend stuff out into includes/Login.php
** Split account creation and login stuff up, into includes/specials/CreateAccount.php and includes/specials/Userlogin.php.
* Reimplement the special pages as subclasses of SpecialPage
* Use HTMLForm to generate the input forms
** Deprecate and delete includes/templates/Userlogin.php, which is horrible and old :D

This changes the syntax of the UserLoginForm and UserCreateForm hooks, and AuthPlugin::modifyUITemplate; they now receive the SpecialPage subclass rather than the template to work with. Update everything I could find in SVN to accommodate this.
2009-09-07 19:00:49 +00:00
Brion Vibber
8919302663 Revert r54291 "(bug 19004) Added support for tags to the API. Patch by Matthew Britton."
Per notes on code review, this doesn't handle multiple tags correctly right now.
2009-08-19 17:34:08 +00:00
Benjamin Lees
65a9d3729a Follow-up to http://www.mediawiki.org/wiki/Special:Code/MediaWiki/54561: use the class autoloader. 2009-08-19 05:41:42 +00:00
Tim Starling
3b4e961c47 * Renamed PageHistory to HistoryPage. Brion gave me permission to do this a couple of years ago, I thought it was about time. Provides naming consistency with ImagePage, RawPage, etc.
* Moved historyLine(), beginHistoryList(), endHistoryList() and related helper functions to the pager class.
* Renamed HistoryPage member variables, removed "m" prefix.
* Added declaration for IndexPager::$mIsFirst
2009-08-17 05:09:36 +00:00
Tim Starling
831b6d2bf7 * Per my CR comments on r44560: merged FileCache into RepoGroup and fixed wfFindFile() global function bloat. Did not port unused functions such as the batch loading functions.
* Fixed the formal parameter bloat in the file finding functions by making wfFindFile(), RepoGroup::findFile() and FileRepo::findFile() take an associative array of options instead of a rapidly growing collection of formal parameters. Maintained backwards compatibility for the $time parameter, which was the only one used in an extension.
* Took the advice of the todo comment on FileRepo::findFiles() and implemented a calling convention for specifying times (and other options)
* Removed the file object cache from Parser, redundant with the RepoGroup file cache
* Deleted clueless and non-functional LocalRepo::findFiles(). Does not respect redirects, deletion bitfields, or anything else nuanced about FileRepo::findFile(). Does not have the same calling convention as FileRepo::findFiles().
2009-08-15 09:59:59 +00:00
Aryeh Gregor
7aa4a8f90c For HTML 5, drop type="" attributes for CSS/JS
This time done in a nice, centralized fashion, reducing LOC for callers
even if HTML 5 is disabled.  The implementation is a new Html class,
similar to Xml but intended to be HTML-specific from the beginning
instead of half-heartedly attempting to provide generic XML services but
actually with lots of HTML-specific stuff tacked on.

As part of the new Html class, a global config option $wgWellFormedXml
is added.  It's set to true by default, but if set to false, the Html
class will drop some things that HTML 5 doesn't require, like
self-closing " />" syntax and attribute quotation marks (sometimes).
2009-08-11 00:09:24 +00:00
Niklas Laxström
aa58f44af4 Support script loader 2009-08-09 16:20:14 +00:00
Bryan Tong Minh
1ac223539e (bug 19004) Added support for tags to the API. Patch by Matthew Britton. 2009-08-03 17:48:01 +00:00
Andrew Garrett
e5343317b8 (bug 16451) Fix application of scaling limits for animated GIFs.
* Creates a new media handler for GIF files, and extracts metadata such as duration, whether or not the GIF is looped, and the number of frames.
* Uses the extracted metadata for the long file description.
* Considers number of frames in the calculation of image area (multiplies by width and height to get the "time-area", or so to speak).

After this patch is deployed, the work-around to disable GIF scaling on Wikimedia sites can be eliminated.
2009-08-03 15:01:51 +00:00
Bryan Tong Minh
95e16a5837 Revert r53678, r53704, r53705, r53773, r53930, r54199, r54201: Addition of ApiQueryBrokenRedirects and ApiQueryDoubleRedirects.
This is pure code duplication and should be done by fetching data from the respective query pages. This has as advantage that other query pages can be readily added to the API as well. See the querypage-work branch.
2009-08-03 11:06:24 +00:00
Chad Horohoe
a1c51e18af Merge maintenance-work branch (now with less errors!):
* Docs have been updated to indicate the standard on how to write maintenance scripts (MW.org docs will follow) Have ported vast majority of maintenance scripts to new format. Remaining ones (mostly FiveUpgrade-related) are a bit more tricky. commandLine.inc is untouched for now. Many have gotten code-style updates as well. Deleted .inc files were only used by their .php counterparts, and have been merged into single files.
* (bug 11867) Lock error on redirect table when running orphans.php
* (bug 16322) Allow maintenance scripts to accept DB user/pass over input or params
* (bug 18566) Maintenance script to un/protect pages
* initStats overhaul, now uses class SiteStatsInit. Also fixes bug 18930
2009-08-02 19:35:17 +00:00
Alex Shih-Han Lin
86a52284fb Comment out ApiQueryDoubleRedirects and ApiQueryBrokenRedirects for non-cached query 2009-08-02 12:03:24 +00:00
Chad Horohoe
94434b82fd Yeah I can't spell. 2009-07-31 00:18:09 +00:00
Chad Horohoe
e0bd61b317 typofix. 2009-07-31 00:16:00 +00:00
Chad Horohoe
7196442927 Move search related includes to includes/search/ 2009-07-30 22:45:38 +00:00
Aaron Schulz
c2f7745f85 rm more SpecialSearchOld cruft 2009-07-30 18:36:09 +00:00
Alex Shih-Han Lin
f1dc78ac2d +Add BrokenRedirects and DoubleRedirects API script for bot development. 2009-07-23 16:25:31 +00:00
Aryeh Gregor
1d1ecfa10f Add experimental new auth framework, ExternalAuth
This should not affect any existing behavior.  (Except that it reorders
some error conditions in attemptAutoCreate(), but probably no one cares
about that.)  It adds a new database table, but it will be unused unless
you enable external authentication.

An outline of the rationale for this system, and the design planning, is
at <http://www.mediawiki.org/wiki/ExternalAuth>.  Essentially,
AuthPlugin puts too much of a burden on plugin authors, requiring them
to write a lot of policy logic instead of just handling the actual
interface to the external user database.  This system uses a standard
framework to decide policy questions, and auth plugins only need to
provide some low-level, clearly-specified data.

There are lots of features still missing, marked in the code, but basic
functionality is present.  The commit includes initial support for one
type of external authentication, the forum software vBulletin (which I
happen to know well, and want to integrate with my MediaWiki).

I'm encouraging the inclusion of ExternalAuth plugins in core because in
this framework, the amount of code required to add an additional backend
is quite small -- well under 100 lines in this case.  I'd hope to see a
lot more of these, and it seems unreasonable to make an armada of tiny
extensions instead of letting them live happily in their own directory
out of everyone's way.
2009-07-19 22:02:00 +00:00
Chad Horohoe
c90b9b93ec (bug 16497) Paginate Special:AllMessages 2009-07-15 02:03:21 +00:00
Jack Phoenix
de7fa9061b follow-up to r53282:
*coding style tweaks
*added __METHOD__ to some wfDebug calls
*removed php ending tag from mwScriptLoader.php
*some doxygen docs added
2009-07-15 00:55:58 +00:00
Michael Dale
aefc40d749 here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview

= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions

== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php

* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)

== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.

= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader

* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html  )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.

= js2 system  / mwEmbed=
$wgEnableJS2system = false

* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)

* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.

= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs  <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)

== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.

== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00
Roan Kattouw
562dfb5de4 Revert r53147, r53149 and r53163 ("Add API module for QueryPage-based special pages"): this has already been worked on more extensively and cleanly in the querypage-work branch, if you wanna work on this please finalize the implementation there rather than reinventing the wheel. 2009-07-13 12:40:19 +00:00
Bryan Tong Minh
cb7471a46e (bug 14869) Allow access to QueryPage-based special pages via API
Only brokenredirects for now, until I find out which other special pages are suitable.
2009-07-12 21:51:47 +00:00
Tim Starling
1353a8ba29 Implemented the PoolCounter feature and did some general refactoring in the areas that it touched.
* Renamed Article::outputFromWikitext() to Article::getOutputFromWikitext()
* Factored out cascade protection updates
* Removed recently-added Article::tryParserCache(): misnamed, can be done in one line of code in the caller. Deprecated OutputPage::tryParserCache().
* Made some functions public instead of protected when they could be useful from hooks.
* In ParserCache, removed PHP 4-style ampersands

In Article::view():
* Factored out robot policy logic, "redirected from" header, patrol footer, diff page, revdelete header, CSS/JS formatting, footer, namespace header, missing article error
* Removed some variables, renamed some others, fixed incorrect use of empty()
* Used the refactored footer section to do a couple of early returns and unindent a massive if(!$outputDone) block
* Removed fantasy interpretation of $this->getContent()===false in comment
* Don't try the parser cache when ArticleViewHeader specified $outputDone=true
* Move timing hack to getOutputFromWikitext()
* Stop using $wgOut->parserOptions() with save/restore nonsense every time you want to change something in it. This is meant to be OOP.
* Don't overwrite the article text with an error message and then pretend to write it to the cache, that's confusing
2009-07-08 08:12:35 +00:00
Tim Starling
371eb5b6e7 (bug 19447) Disable the localisation store backend during install and update. 2009-07-03 06:56:46 +00:00
Jack Phoenix
564b2b306a make ActiveUsers subclass SpecialPage 2009-07-03 00:22:22 +00:00
Tim Starling
23cfebd3d2 * Introduced a new system for localisation caching. The system is based around fast fetches of individual messages, minimising memory overhead and startup time in the typical case. It handles both core messages (formerly in Language.php) and extension messages (formerly in MessageCache.php). Profiling indicates a significant win for average throughput.
* The serialized message cache, which would have been redundant, has been removed. Similar performance characteristics can be achieved with $wgLocalisationCacheConf['manualRecache'] = true;
* Added a maintenance script rebuildLocalisationCache.php for offline rebuilding of the localisation cache.
* Extension i18n files can now contain any of the variables which can be set in Messages*.php. It is possible, and recommended, to use this feature instead of the hooks for special page aliases and magic words. 
* $wgExtensionAliasesFiles, LanguageGetMagic and LanguageGetSpecialPageAliases are retained for backwards compatibility. $wgMessageCache->addMessages() and related functions have been removed. wfLoadExtensionMessages() is a no-op and can continue to be called for b/c. 
* Introduced $wgCacheDirectory as a default location for the various local caches that have accumulated. Suggested $IP/cache as a good place for it in the default LocalSettings.php and created this directory with a deny-all .htaccess.
* Patched Exception.php to avoid using the message cache when an exception is thrown from within LocalisationCache, since this tends to fail horribly.
* Removed Language::getLocalisationArray(), Language::loadLocalisation(), Language::load()
* Fixed FileDependency::__sleep()
* In Cdb.php, fixed newlines in debug messages

In MessageCache::get(): 
* Replaced calls to $wgContLang capitalisation functions with plain PHP functions, reducing the typical case from 99us to 93us. Message cache keys are already documented as being restricted to ASCII.
* Implemented a more efficient way to filter out bogus language codes, reducing the "foo/en" case from 430us to 101us
* Optimised wfRunHooks() in the typical do-nothing case, from ~30us to ~3us. This reduced MessageCache::get() typical case time from 93us to 38us.
* Removed hook MessageNotInMwNs to save an extra 3us per cache hit. Reimplemented the only user (LocalisationUpdate) using the new hook LocalisationCacheRecache.
2009-06-28 07:11:43 +00:00
Niklas Laxström
8eb1398a03 Added subclasses of HTMLField to autoloader... so that extensions can subclass them
(Was triggering fatal errors, due to wfLoadAllExtensions() loading all classes)
2009-06-26 14:32:54 +00:00
Tim Starling
d93ea4874e Added PHP port of CDB, with abstraction layer. Tested for correctness with a differential fuzz tester, not yet benchmarked. The idea is to open up new applications for CDB, and benefit both shell and shared hosting users.
Ported existing uses of CDB to the new abstraction layer.
2009-06-20 15:59:56 +00:00
Chad Horohoe
0fafc4512e Refactor Blankpage to subclass SpecialPage like a normal special page. :) 2009-06-19 23:46:33 +00:00
Roan Kattouw
c51063fcdc Moving ConfEditor class from switch-master to core 2009-06-17 17:20:01 +00:00
Aryeh Gregor
31492fc3f1 Move some stuff from DatabaseBase to DatabaseMysql
I moved a number of methods and marked them abstract in DatabaseBase,
namely those that met the following criteria:

1) Used some mysql_* function, so would obviously fail on any other DB.
2) Were already implemented by all five non-MySQL subclasses.

It would be reasonable to revisit these and make the less essential ones
return a dummy value instead of being abstract.  And document them.  And
move more methods that are MySQL-specific.  But one thing at a time.

I also split the classes Database, DatabaseMysql, and MySQLMasterPos to
DatabaseMysql.php.

This should theoretically have no practical changes, but it's a bunch of
changed code, so it will possibly break something by accident.

Followup to r51795.
2009-06-15 18:39:41 +00:00
Chad Horohoe
12f42d0ff6 Put actual location of these two classes. 2009-06-12 19:24:03 +00:00
Aryeh Gregor
d20794df5c Make Database into abstract class DatabaseBase
All other databases were changed to extend DatabaseBase instead of
Database.  Database was kept as an alias for DatabaseMysql for
compatibility.  Existing explicit references to Database that I could
find were changed to DatabaseMysql for the sake of clarity.

Should cause no functional changes.
2009-06-12 17:59:04 +00:00
Tim Starling
bc35951c93 In Special:RevisionDelete:
* Refactored to remove massive duplication
* Removed page parameter and associated contextPage member variable, doesn't seem to do anything.
* Put ID lists into a single ids parameter and member variable instead of having one for each type.
* Fixed inappropriate call of Title::newFromUrl(), always wrong
* Don't pretend to use the return value from functions that don't return anything, this reduces readability.
* Use the table names for deleteKey/typeName values, they look more like English
* Use protected not private
* Remove requirement for log type to be specified in the target
* Use POST for RevisionDelete entry forms, to avoid URL size limits and issues with non-PATH_INFO URLs
* Don't purge all pages that use the given file
* LocalFile::purgeCache() already calls purgeHistory,() no need to do it again. But do call purgeDescription(). 
* Removed token from unhide=1 links, unnecessary
* Tokens are necessary on file streaming links, added them
* Fixed private data leakage due to incorrect use of LocalRepo::newFromArchiveName(). Non-existent placeholder file was returned which meant that $oimage->userCan(File::DELETED_FILE) was always true. Pass the archive name to tryShowFile() instead of the storage key.
* Using ls_field='oi_timestamp' is not correct, oi_timestamp refers to the timestamp of the revision in question, whereas the key that is stored is the timestamp of the previous revision (i.e. the timestamp in oi_archive_name). oi_archive_name would be more correct, although only half the field is used.

Elsewhere:
* Added missing message filehist-missing
* Fixed double asterisk in Status::getWikiText()
* Fixed escaping of the target parameter to Special:RevisionDelete from ImagePage
* Deleted FileStore.php. Deprecated in filerepo refactor except for get()/export() but somehow resurrected by RevisionDelete. Hopefully this will be the end of it. New interfaces will be added for wfStreamFile() in a later commit.
* Added convenience function File::getStorageKey(), factored out of Special:Undelete
* Added convenience function Revision::newFromArchiveRow(), factored out of Special:Undelete and Special:RevisionDelete
* Fixed notice in Special:Upload, uninitialised $pageText

FIXME: current revision can be suppressed on undeletion causing an unauthenticated unsuppress. Comments indicate this is a known issue. I fixed the parser cache pollution in this case but not the rest.
2009-06-01 11:37:06 +00:00
Brion Vibber
11c751d812 Revert r49880, r49883, r49885 - add uniwiki/CreatePage extension to core
This looks pretty funky...

  A page with the title Main Page already exists. Would you like to edit the existing page?

  Yes. I want to contribute to the existing page.
  Yes. I want to contribute to the existing page.

Lack of interlinking tools means that this would promote creation of orphan pages, and the UI isn't very good. Doesn't seem to be a clear way to disable it in favor of alternate creation methods either.
2009-04-27 19:04:21 +00:00
Siebrand Mazeland
b3d5dbfed1 * add uniwiki/CreatePage extension to core
* add 'Create a page' to default sidebar
* remove uniwiki/CreatePage from Translate
* remove uniwiki/CreatePage from UniwikiSettings.php
* add special page aliases of CreatePage extension to MessagesXx.php
2009-04-25 18:47:41 +00:00
Andrew Garrett
155ddf6de4 Branch merge of preferences work branch. Includes fixes for several bugs. WARNING: Breaks some extensions which have not been adapted to use it properly (basically anything not used on Wikimedia). 2009-04-24 01:31:17 +00:00
Chad Horohoe
9d91ed5e93 Make Whatlinkshere subclass SpecialPage. 2009-04-15 04:39:49 +00:00
Chad Horohoe
d59dd932e1 (bug 18151) Clean up duplicate code between Special:WantedPages, WantedFiles, WantedTemplates
* New WantedQueryPage class for all of these Wanted*s, moved some identical methods to it
* Removed sortDescending() because it was already defined as returning true @ QueryPage, no need to duplicate
2009-04-15 03:35:59 +00:00
Roan Kattouw
549b1688cc Redo r48746 (API userrights, reverted in r48909 and r48910) in a way that doesn't break CentralAuth. Basically, this works around PHP's inability (at least in < 5.3) to override static methods by adding a hook. Changes to CentralAuth in next commit. 2009-03-28 19:08:47 +00:00
Andrew Garrett
d4d0329547 Revert r48746 (API userrights). Breaks Special:GlobalGroupMembership by changing overridden methods to static methods, which cannot be overridden. Also reverts r48747, r48814, r48778, r48775 2009-03-27 05:59:42 +00:00
Andrew Garrett
6a91f0640c Move WikiMap class from CentralAuth to core, since it's used in 2 extensions at least now, and doesn't depend on CentralAuth 2009-03-26 13:31:30 +00:00