Commit graph

313 commits

Author SHA1 Message Date
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
Roan Kattouw
3c52c2c64b * API: (bug 15935) Add action=userrights to the API
* Add ustoken=userrights to list=users
* Move the non-UI part of UserrightsPage::saveUserGroups() to the static and more generic doSaveUserGroups()
* Add a $reason parameter to UserrightsPage::addLogEntry() and make it and its helpers static
* Move UserrightsPage::changeableGroups() and changeableByGroup() to the User class and make the latter static
* In doSaveUserGroups(), drop groups that the user doesn't have from $remove (and those that they do have from $add), and return array($add, $remove)
* Fix up a comment in ApiQueryRecentChanges
2009-03-24 16:04:50 +00:00