Commit graph

878 commits

Author SHA1 Message Date
Daniel Friesen
ed6e876688 Drop __autoload.
spl_autoload_register exists in >=5.1.2, we require >=5.3.2
We no longer support hphpc and it looks like hhvm supports spl_autoload_register

We've got no reason to keep using __autoload.
We'll also need to exclusively use spl_autoload_register when we start using composer.json stuff.

Change-Id: I694b7b96825e5d136fa76461511efc9a002149fa
2013-06-11 00:21:42 +00:00
Aaron Schulz
3bc539e1af Moved job queue aggregator classes to a subdirectory.
Change-Id: Iabbf566b05d44e19770db7b4519abfe00e4a8d90
2013-05-27 14:14:29 +00:00
csteipp
4233341283 SECURITY: Do checks on all upload types
Also, verify file before stashing it

Change-Id: Ib2474cb778d53959a4f479e53d0392f916b18d83
2013-05-21 13:20:06 -07:00
Antoine Musso
ea14e46965 autoloader missed some entries
Jenkins does not run the autoloader test (will be fixed in a different
commit).  This patch fix the main and test autoloader to add in all the
missing entries.

bug: 47750
Change-Id: I285fa7ed24a6fc45a4dc475b54d80cf3816436fb
2013-05-21 11:56:26 +02:00
Timo Tijhof
50e7985d4d phpcs: Fix WhiteSpace.LanguageConstructSpacing warnings
Squiz.WhiteSpace.LanguageConstructSpacing:
   Language constructs must be followed by a single space;
   expected "require_once expression" but found
   "require_once(expression)"

It is a keyword (e.g. like `new`, `return` and `print`). As
such the parentheses don't make sense.

Per our code conventions, we use a space after keywords like
these. We appeared to have an unwritten exception for `require`
that doesn't make sense. About 60% of require/include usage
was missing the space and/or had superfluous parentheses.

It is as silly as print("foo") or return("foo"), it works
because keywords have no significance for whitespace between
it and the expression that follows, and since experessions can
be wrapped in parentheses for clarity (e.g. when doing string
concatenation or mathematical operations) the parenthesis
before and after basiclaly just ignored.

Change-Id: I2df2f80b8123714bea7e0771bf94b51ad5bb4b87
2013-05-09 05:56:26 +02:00
jenkins-bot
afd141c543 Merge "Remove Parser_LinkHooks and CoreLinkFunctions classes" 2013-05-08 19:56:11 +00:00
Chad Horohoe
a6d2365015 Revert "Remove Special:ActiveUsers"
This reverts commit 27104686ab.

Revert "Remove link to Special:ActiveUsers from Special:Statistics"

This reverts commit 62949af09e.

I used a sledgehammer where a scalpel would've done--and I should
be whacked with the cluebat. This should be done per-wiki, plus
improvements.

Change-Id: Ib43b42057b8d9f714a8a71ba9cbe375385254b7c
2013-05-05 23:14:21 +00:00
Reedy
612afc2533 Remove Parser_LinkHooks and CoreLinkFunctions classes
Bug: 45371
Change-Id: I06f890153df0cb8f4fb84a73a06a6f5f4817cf3b
2013-05-02 16:43:39 +01:00
jenkins-bot
85e881945d Merge "Create a Special:Redirect page." 2013-04-30 18:34:11 +00:00
C. Scott Ananian
2849d8a6b3 Create a Special:Redirect page.
The primary purpose of this page is to redirect to a user page given a
numeric id.  The numeric User ID is stable across renames, and is
therefore an appropriate primary key for identifying the user
associated with a given revision.  The Parsoid API would like to
export semantic RDFa in its DOM identifying the author of a revision
by their userid, but in order to do so requires a MW redirect from
userid to the appropriate User page.  (A "permalink" for the user.)

This patch adds that redirect, as
  http://somewiki/Special:Redirect/user/1234

(https://bugzilla.wikimedia.org/show_bug.cgi?id=45206 is the related
Parsoid feature.)

Rather than adding a set of ad-hoc redirection pages, this patch
sets up an infrastructure for redirections.  Special:Redirect also
subsumes the functions of:

* Special:Filepath (Special:Redirect/file/xxxx)
* Special:PermanentLink (Special:Redirect/revision/xxxxx)

This structure is extensible for other redirect types.

Change-Id: I8b0785f4fbdb3dd438a7a45263c5f375ff9d2208
2013-04-30 13:40:54 -04:00
Aaron Schulz
32ac151803 Created ProfileSection class to avoid wfProfileOut() whack-a-mole.
Change-Id: I9f7e0638edd99e1ac07b83054e8f7ef255179281
2013-04-28 23:54:33 +00:00
Matthew Flaschen
af7b20570c Create account form with vertical form appearance
Similar to the login form (change 55847), this presents a compact
vertically-stacked form, if a global variable is set or if you add
?useNew=1 to the query string.

The redesigned create account form also:

* Removes the remember me checkbox (see bugzilla 47267)
* Displays some wiki statistics in a benefits column.
* Repositions the FancyCaptcha image if present using JavaScript (see
  bugzilla 47372).
* Sets the template skin as in change 59577.

Bug: 44628
Bug: 47267
Change-Id: I9b03d519af43de147bff0ac509a1154f67cd3a0a
2013-04-23 15:56:02 -07:00
Alexandre Emsenhuber
98a22b0b58 Update AutoLoader
- Move files in includes/externalstore to their own location for consistency
- Order MWCryptRand alphabetically
- Add missing HTMLButtonField

Change-Id: Ib3798dce6080960df68badd6237968a33473e36b
2013-04-23 16:48:24 +02:00
Aaron Schulz
b41a2f8f68 Moved CryptRand.php to MWCryptRand.php
Change-Id: I03e3742f270ccf05ea923a46e8f8171e6f73ffcd
2013-04-23 11:39:39 +00:00
umherirrender
ef2f507d23 Fixed spacing in files direct in includes folder
Added spaces before if, foreach
Added some braces for one line statements

Change-Id: Ibb8dd102db045522d12ff939075ba7420d95ab6b
2013-04-21 06:38:49 +00:00
Aaron Schulz
fc81192a06 [JobQueue] Added JobQueueFederated class for partitioned queues.
* This lets queues be horizontally partitioned onto
  different servers, with weights assigned to each.
  The queue classes used by the different partitions
  can be hetereogenous or homogeneous.
* How partitioning is done is setup similar to LBFactory,
  where wikis belong to sections and sections have config.

Change-Id: I44d59b67cf417dca28a3e9b25371dac5a7ffcb47
2013-04-19 03:27:15 +00:00
Aaron Schulz
ed01e81359 [LockManager] Added a RedisLockManager class.
Change-Id: I7ade74eb307a5075533f36836768af60f106a6b9
2013-04-18 20:18:54 -07:00
jenkins-bot
dfd1efa0f4 Merge "Revised design of Special:Userlogin" 2013-04-11 23:31:51 +00:00
S Page
b809d516db Revised design of Special:Userlogin
If a global variable is set or if you add ?useNew=1 to the query string,
Special:Userlogin loads a different login template (UserloginVForm.php)
with the new Vertical Form appearance and different messaging.
Otherwise the current unchanged template renders so that wikis can cut
over to the new look when ready (with messages and links). Once they do
so, the variable and flag will be retired.

The new template applies mw-ui-vform and mw-ui-button styles defined in
a new 'mediawiki.ui' CSS module in core to create a compact vertical
form.  The mw-ui styles specify a Helvetica font stack (that we tested
in the Account creation experiment) in the form area, but NOT if the
user is using some other skin than Vector.

The CSS code is developed using Sass. The patch includes the
Sass scss files, along with a Makefile that uses their Compass build
configuration (config.rb).

The redesigned Special:Userlogin also:

* Displays a "secure login" link if HTTPS is available.
* Loads additional CSS for its form features (e.g. more attractive
  errorbox, "Join wiki" messaging).
* Defines new "userlogin-xx" messages; many are the same as
  existing messages but without ':' on the end.
* Uses a distinct title for Login instead of generic "Log in /
  Create account".
* Removes the [mailmypassword] code branch from its login template as it
  is never executed.

Bug: 44628
Change-Id: I489042c50aa060c90ca18b05097dbe25c4ae6395
2013-04-11 22:26:45 +00:00
Aaron Schulz
4c54454be4 Moved ChronologyProtector to its own file.
Change-Id: I01bf0206322454e36633921887d10356a48ab5cb
2013-04-11 14:08:45 -07:00
Chad Horohoe
4be6236352 Remove externaledit/externaldiff preference
Change-Id: Ic3791d188688f556753ab5556a4d9733bbf2e85e
2013-04-11 09:20:36 -04:00
Chad Horohoe
36cade5fe8 Remove ExternalUser authentication code
This was an experimental authentication system intoduced a couple
of years ago with a pretty narrow use-case. It's been pretty much
ignored since introduction, and makes login more complicated than
it needs to be.

I didn't drop the external_user table on the off-chance someone
out there actually has data in it, but they should use AuthPlugin
for their external authentication needs.

Change-Id: I794338dbb75961ee033d41fa44bb7aa22e54f447
2013-04-04 10:09:34 -04:00
Chad Horohoe
8dfd474b53 Remove several ancient skins
Standard, Simple, Chick and MySkin have all been removed.
Nostalgia has been moved to an extension for posterity.

Change-Id: Ia6d73c2deb9428d214b7d69b29235094de75c52e
2013-04-01 17:11:59 -04:00
Aaron Schulz
5f1e95436e Avoid sending multiple UDP packets for the same key in wfIncrStats().
* This should help reduce collector data loss.

Change-Id: Ibe55648422d1b8aac86dd6fa83973d3c8715b0aa
2013-03-29 12:01:42 -07:00
Kevin Israel
79f80cc495 Combine JavaScript and JSON encoding logic
This will help with improving human readability of JS and JSON
objects encoded by both ResourceLoader and the API. This patch
also adds new "utf8" parameter to the JSON formatter of the API.

Changes to FormatJson class:

* Added escaping of '<', '>', and '&' by default to protect against XSS.
* Removed unnecessary escaping of '/' and added an additional option to
  unescape non-ASCII characters (those above U+007F) as well.
* Added PHP 5.3 pretty printing code (to replace Services_JSON) that
  uses a four-space indent as PHP 5.4 does.

Changes to Xml class:

* Defined Xml::encodeJsVar() in terms of FormatJson::encode()
  and added a pretty printing option. Also added a pretty printing
  option to Xml::encodeJsCall() as well.
* Deprecated Xml::escapeJsString() and QuickTemplate::jstext();
  callers have to add quotes themselves, hence the escaping of
  both double quotes and apostrophes.

Bug: 26818
Change-Id: I1987190f1ba5bf41738e7bd611209706c1f6bb5c
2013-03-27 20:22:45 -04:00
jenkins-bot
6ad44a315a Merge "Move subclasses of LogFormatter to their own file" 2013-03-26 08:38:04 +00:00
Chad Horohoe
27104686ab Remove Special:ActiveUsers
This feature was poorly thought out from the start. It's a huge
performance drain when used, for a mimimally useful set of data

Change-Id: I138622e1c184f74e2a7ce13a9a544ab4e610d7a0
2013-03-25 18:19:21 -04:00
Aaron Schulz
1575b24f59 Added a PoolCounterWorkViaCallback convenience class.
Change-Id: I1cbb2cc8a43eea2d28f38cfd2d3a4908dc7d0da9
2013-03-19 23:25:40 -07:00
Alexandre Emsenhuber
744c0c7541 Move subclasses of LogFormatter to their own file
Except LegacyLogFormatter.

includes/logging/LogFormatter.php is getting bigger and bigger with
the addition of new formatters when logs are changed to use them
instead of the old method, so better doing this now before we get
new formatters for remaining log types.

Change-Id: I6aab19c8d68bf47beddad42632b0360a7b12f251
2013-03-15 15:25:33 +01:00
Tyler Anthony Romeo
4dcc7961df Fixed @param tags to conform with Doxygen format.
Doxygen expects parameter types to come before the
parameter name in @param tags. Used a quick regex
to switch everything around where possible. This
only fixes cases where a primitve variable (or a
primitive followed by other types) is the variable
type. Other cases will need to be fixed manually.

Change-Id: Ic59fd20856eb0489d70f3469a56ebce0efb3db13
2013-03-11 13:15:01 -04:00
Aaron Schulz
5cfcb3053d [JobQueue] Added JobQueue::getAllQueuedJobs() function.
* Also added a small MappedIterator class for convenience.

Change-Id: I7dac1001a8e048cb524f7fbfee50a20a32e598ba
2013-03-08 06:34:31 +00:00
Jan Gerber
e288e4036c (bug 33186) image rotate api
add api action imagerotate to rotate images.
	rotations are stored as a new version of the image.

Change-Id: Id15a92d19cda8256917e7e1e5ee4241012214102
2013-03-07 21:38:10 +00:00
umherirrender
d63121016d fix some spacing
Added/removed spaces around logical/arithmetic operator
Reduced multiple empty lines to one empty line
Removed wrong tabs before comments at end of line
Removed too many spaces in assigments

Change-Id: I2bba4e72f9b5f88c53324d7b70e6042f1aad8f6b
2013-03-07 17:53:21 +01:00
jenkins-bot
636d0de4b8 Merge "Adding new subclass to HTMLForm for constructing a checkbox matrix" 2013-03-05 20:09:21 +00:00
jenkins-bot
7027ba7e93 Merge "Remove DB2 support" 2013-03-01 22:00:46 +00:00
Reedy
6f3e4e9806 Kill off and remove HttpRequest class
Change-Id: I0661d483c60fc0d32f0c51937e91bece6960dfcf
2013-02-28 01:45:54 +00:00
Kaldari
043b6b32f6 Adding new subclass to HTMLForm for constructing a checkbox matrix
Also adding corresponding support for using them within preferences

Change-Id: Ie6e77dfd8edaff212655d0be1d048a10eeba341f
2013-02-27 11:56:31 -08:00
jenkins-bot
96eb68f39f Merge "[Upload] Moved async upload stuff to the job queue." 2013-02-26 23:58:32 +00:00
MatmaRex
0c28ca1422 Revert "(bug 29788) Swedish Collation (uppercase-sv). Swaps Ä and Æ"
This workaround is unnecessary now that I838484b9 was merged.

This reverts commit 13dc8ff88f.

Change-Id: I2cd22ad87eb7a56c5742b20c6089a4b8607e5614
2013-02-26 22:18:36 +00:00
Brad Jorsch
307ac55e50 Add PagesWithProp special page and API module
It would be useful to be able to list pages using a particular page
property, particularly in light of the new Disambiguator extension.

This adds a special page Special:PagesWithProp and an API query module
list=pageswithprop to do just this. It also adds an API query module
list=pagepropnames to list the prop names currently in use on the wiki.

Change-Id: Ib0d4e17f22b8d0cb9894eac6095962315480e809
2013-02-26 00:24:31 +00:00
Chad Horohoe
6f4448dd71 Remove DB2 support
Change-Id: I9b294a213a4000f503c0010d88757db6dda927c0
2013-02-25 13:47:03 -08:00
Aaron Schulz
d0985f4f04 [JobQueue] Added aggregate empty/non-empty queue caching.
* The default class is JobQueueAggregatorMemc.
  This essentially has the logic that nextJobDB.php used.
* Also created a JobQueueAggregatorRedis class.
  This is much more efficient and more responsive.
* This can speed up calls to getQueuesWithJobs().
* Removed unused getDefaultQueuesWithJobs() function.

Change-Id: Ifb3c6c881decd643da1b662956ded69db4b39431
2013-02-20 17:34:14 -08:00
Aaron Schulz
fbf34d84ab [Upload] Moved async upload stuff to the job queue.
* (bug 44080) Also carry-over the IP and HTTP header info.
* This adds a RequestContext::importScopedSession() function.

Change-Id: Ie9c0a4d78fb719569c8149b9cc8a5430f0ac5673
2013-02-15 15:00:35 -08:00
Aaron Schulz
fdef79d9f2 [LockManager] Created PostgreSqlLockManager class.
* Made DBLockManager abstract instead of a hacky blocking implementation.
  With a PG and MySQL option, that option is no longer useful.

Change-Id: I939551bd2283608f2d017d9d2fca1334a533c005
2013-02-15 04:06:10 +00:00
Tim Starling
f96e5c5eec Merge "[JobQueue] Added a JobQueueRedis class." 2013-02-08 05:01:34 +00:00
Aaron Schulz
0beb6f9832 [ExternalStore] Added ExternalStoreMwstore class that uses a file backend.
Change-Id: I7785a621fe32f549b2e7c636f2b6e7b18be367f4
2013-02-07 09:52:03 -08:00
Aaron Schulz
e53902e550 Added UIDGenerator class for getting statistically unique IDs.
* This is useful for making IDs for object in partitioned stores.
* The "UID" functions are not called "UUIDs" since they don't follow RFC4122.
  This is for performance reasons since the ID fields tend to be indexed.
* This includes newUUIDv4(), which is compliant with the aforementioned RFC.

This reverts commit 86f895bfe3.

Change-Id: I989626dfb7976d17f5931a34fe040f41cf14dfe3
2013-02-07 17:38:12 +00:00
Tim Starling
53cd876eb4 Remove Preprocessor_HipHop
To reduce the maintenance burden for changes such as Id7ec4e69. The
project to optimise the preprocessor for hiphop is incomplete and is not
especially useful given the present state of hiphop support.

Change-Id: Iebcfe4d40f74520e29e7feb522251892fab2f652
2013-02-06 14:44:10 +11:00
Brian Wolff
13dc8ff88f (bug 29788) Swedish Collation (uppercase-sv). Swaps Ä and Æ
See I4542f57a. Meant as a temporary meassure until such a time
generic tailoring code is implemented for uca. This patch
is mostly Lejonel's code, with the class renamed.

Change-Id: Id39406c37a5277d9e7a9216544de2140411c2b01
2013-02-05 22:21:50 +00:00
Yuri Astrakhan
a97bb3acfa API module manager and help rewrite
This is a non-versioned part of the larger patch #41014
https://gerrit.wikimedia.org/r/#/c/41014
It will allow help subsystem optimization (merging paraminfo and help),
path towards per-module or per-system versioning, removal of the
manually maintained generator lists.

Changes:
* ApiModuleManager now handles all submodules (actions,props,lists) and instantiation
* ApiModuleManager maintains a cache of all instantiated modules
* Query stores prop/list/meta as submodules
* action=help suports generalized submodules (modules=query+value), querymodules obsolete

Change-Id: Ie2dee41e44a29cd5d5935eeaa5240b708d95a8f0
2013-02-05 01:52:55 -05:00