Commit graph

1019 commits

Author SHA1 Message Date
Platonides
ef498e793e Replace $wgDBerrorLogInUTC with a $wgDBerrorLogTZ variable which
can be set to any other timezone.
Also avoids the ugly default-changing that was being used by c15605.

Change-Id: I7a5086f84310f50a1929e07bd2e6527a518424b2
2012-08-08 15:51:39 +01:00
Aaron Schulz
e7a615ad7c Merge "Allow session storage to be configured independently" 2012-08-08 00:35:59 +00:00
Tim Starling
6eb6313b6f Allow session storage to be configured independently
* Introduce $wgSessionCacheType to allow the session storage to be
  configured independently of $wgMemc.
* Renamed $wgSessionsInMemcached to $wgSessionsInObjectCache to reflect
  the new versatility.
* Modernized the relevant code, removing the explicit require_once(),
  used the autoloader instead. Moved it to ObjectCacheSessionHandler.
* Tested with memcached, external sharded MySQL and APC, it all seems to
  work just fine.

Change-Id: I473334bb56cafb4e21ac1c1304d69095676fc0c4
2012-08-08 10:25:56 +10:00
Waldir Pimenta
1e769a5f9a improve wfStripIllegalFilenameChars()'s readability
make the preg_replace regex more readable,
and expand documentation a little.

Change-Id: Id26d9d42be7d3f2780e82da27dd2477d62d8e106
2012-08-07 20:09:26 +01:00
Aaron Schulz
3d60b479de Merge "Add a Uri class." 2012-08-07 03:37:30 +00:00
Daniel Friesen
94f623363b Add a Uri class.
Add a Uri class matching our mw.Uri JS class for handling uris.
This class should be helpful in a bunch of places where we end up doing manual
concatenation of things like the path + '?' + query of a url parsed with wfParseUrl.

[tylerromeo@gmail.com: Removed cat() function, fixed wfWarn() usage for aliases
 and added visibility to all functions. Also added test for aliases.]
Signed-off-by: Tyler Romeo <tylerromeo@gmail.com>

Change-Id: Iefdedb7c80cf1d4aab58050edab3ab44ba868a58
2012-08-06 22:46:25 -04:00
jeroendedauw
2b65df98fe Add @deperecation stuff to message functions
Change-Id: I69168ed9d850baf02b3dd7c8bd0e820f3f00f43f
2012-08-06 19:32:52 +02:00
Jan Gerber
2a02b44b59 add optional limits argument to wgShellExec
add optional limits argument to overwrite
filesize, memory and time limits or a command
executed with wfShellExec.
Just having once size fits all $wgMaxShell* options
is not good enough for tasks that take long
or create large files (i.e. video transcoding)

Change-Id: I54148907bfd103fd28aff69baae03437efcfe1ee
2012-07-16 14:35:51 -07:00
Antoine Musso
ef9534313e prevents some doxygen warnings
This patch fix misc issues reported by doxygen. Nothing fancy.

Change-Id: I98edc8c877019f1dc4a82a37bca518df2eb904fc
2012-07-15 22:32:48 +02:00
Reedy
fb9cbb1b4c Fix casing of wgDBerrorLogInUtc
Change-Id: I644ea64b1a40160f3468ec35836ee9aa003c03de
2012-07-13 19:02:12 +01:00
Antoine Musso
bc6d5fb88a dbErrorLog can now be forced to UTC
$wgDBerrorLog is used to log database error. It is using
$wgLocalTimezone to format the date which might not always be wanted in
a multi Timezone cluster of wiki.

wgDBerrorLogInUTC , when true, will override the Wiki timezone to uses
UTC whenever a database error is logged.

Change-Id: I091d6029272b69db0aefdebfc37896d0a8e8770e
2012-07-13 16:56:36 +02:00
Antoine Musso
aab43dd495 escape tags and entity in doxygen comments
When inserting XML elements inline <such as this one>, doxygen chokes
about it not being known. Simply enclosing the tag in double quotes
prevents doxygen from emitting a warning.

Also enclosed a few invalid functions calls such as \. and double quoted
the HTML entities such as &foobar;

Change-Id: I4019637145e683c2bec3d17b2fd98b0c50a932f1
2012-07-10 17:08:32 +02:00
Antoine Musso
4d1324f47d setting to completely override server hostname
Labs has instances hostnames forged in sequences which make them not
that much useful for human readable output. Labs does publish a
meaningful instance name as an env variable though, so we could use it
to get better output.

This patch introduce $wgOverrideHostname (default false) which when
set will override the hostname returned by wfHostname().

Change-Id: Ibdba007cc4025fa0b0ebef39b5669c32852a95a7
2012-06-26 22:27:02 +02:00
Mark A. Hershberger
99fdc6e838 Bug 24985 use $wgTmpDirectory when available
We had two way to get a temporary directory:

 - $wgTempDirectory: more or less stable accross sessions
 - wfTempDir(): set through environnement variable and could potentially
   vary from a session to another one thanks to tempnam()

This patch makes wfTempDir() to always use the global $wgTempDirectory
first when it is available. Thus explicitly overriding tempnam() or any
environnement variable such as TMP or TEMP.

Hence, people who don't have access to a system wide directory
specificed by their environnement (such as /tmp) can specify an
alternative straight from the MediaWiki configuration.

The patch remove references to $wgTmpDirectory and replace them with
calls to wfTempDir().  Make wfTempDir() use $wgTmpDirectory first.

The default setting of $wgTmpDirectory was removed in favor of having it
initialized through Setup.php by calling wfTempDir.

Note: this may also address Bug 36475 - Generating thumbnails does not
work when there is no access to /tmp

Change-Id: Ifdc79e9c5d95f978025b237a5eeb95fd75092f46
2012-06-13 21:30:22 +02:00
awjrichards
c29fd59775 Big oops - merged to wrong branch.
Revert "Revert to arbitrarily old point before initial remote branch creation to help clean up"

This reverts commit ee0d3d330f
2012-06-05 22:58:54 +00:00
awjrichards
ee0d3d330f Revert to arbitrarily old point before initial remote branch creation to help clean up
Change-Id: I41a3d1e55d3ea9dffa42451237fe065f9334361d
2012-06-02 08:43:04 -07:00
Platonides
2e506c4809 PHP >= 5.4.0 started taking advantage of $limit optimization of wfDebugBacktrace(),
which we weren't treating right.

* $limit in wfDebugBacktrace() is the number of returned frames,
we thus need to take into account the wfDebugBacktrace() frame, which
is sliced from debug_backtrace().

* wfGetCaller() needs to add a level for itself.

* MWDebug::warning() was logging itself as the warning issuer,
which is useless (the call a few lines before was right, though)
MWDebugTest.php changed accordingly.

* Removed double call to wfGetCaller( $callerOffset + 1 )

* Documented the meaning of wfGetCaller() parameter

* Added unit test

Change-Id: Ief50f4c810bad8b03bb2bf9dc6d945d9acb29851
2012-05-31 17:32:33 +02:00
Aaron Schulz
2dbea5d278 Removed dead code since PHP minimum is > 5.2.1.
Change-Id: I565ff44e5e058ce72cd2eaeaec9ea1e441d01010
2012-05-29 22:23:07 +02:00
Alexandre Emsenhuber
b6c04726c6 Removed function_exists() check for header_remove() since it's now always available.
header_remove() was added in PHP 5.3.0 which is below that our minimum requirement; also fixed a comment for the minimum required PHP version.

Change-Id: Ib6992ed772f1a707f96020fdfe6eb6152102402a
2012-05-26 21:31:30 +02:00
Alexandre Emsenhuber
15e9fcca01 Added missing GPLv2 headers in some places.
Also made file/class documentation more consistent.

Change-Id: Iaebd4e253ff3b35b568e9b394231a5691445ac95
2012-05-14 19:59:58 +02:00
Timo Tijhof
6b8a256d5d (bug 36537) Rename wfArrayToCGI to wfArrayToCgi
- For consistency with wfCgiToArray()
  This way instead of the other way around to keep lowerCamelCase natural.

Change-Id: If4528f6572afeab42ef0602a427ac44da9830a3f
2012-05-05 19:02:58 +02:00
Reedy
c1ed53da6c Kill off pre php 5.3.2 back compat hacks
Change-Id: I5b806a5d8fd4ec6914e3786a4a9aefba4ad6faa6
2012-05-05 00:23:35 +01:00
Hashar
13224921a2 Merge "wfAssembleUrl lacked '@since 1.19' comment" 2012-04-19 19:30:49 +00:00
Reedy
f1ca21306c wfAssembleUrl lacked '@since 1.19' comment
Related to Bug 36084 - PHP Fatal error: Call to undefined function wfAssembleUrl()

Change-Id: Ief6077ab60ec8613d744e6e2e2e72043a6b3dd96
2012-04-19 11:53:48 +02:00
Platonides
1e70d71fe0 wfMkdirParents() should display mode in octal.
Patchset 2: Address issue pointed out by CR

Change-Id: Ia156903131612f3faa93a7010de2e034d528ec7d
2012-04-19 11:04:11 +02:00
Catrope
458f162b63 Merge "[LanguageConverter] Added some cache code based on the problems in r97512." 2012-04-09 22:25:24 +00:00
Reedy
97257d4e9a wfLocalFile returns a LocalFile (or null) not a File
Change-Id: Ib016f16c1b5528d9f6af4189ca8459cacb54cf10
2012-04-07 21:51:53 +01:00
Aaron Schulz
0c2a0e4d6b Merged ImageFunctions.php into GlobalFunctions.php
Change-Id: I02d468f9c54a6a0448a6d99505d0201a7949855a
2012-04-06 16:43:27 -07:00
Aaron Schulz
10f49bd065 [LanguageConverter] Added some cache code based on the problems in r97512.
* Added $wgLanguageConverterCacheType global to control LC cache type. We can use it to enable direct apc use for language converter (to match the live hack).
* Added $wgLangConvMemc object, available via Setup.php

Change 1:
* Updated unit tests
* Minor documentation cleanup in DefaultSettings.php

Change-Id: Icd5dd28407e9759ce294c784ec41d9ca15c89616
2012-04-06 13:26:17 -07:00
Aaron Schulz
770c9d8c2e Renamed "wfShellMaintenanceCmd" function and new, unused, het-deploy, hook
to "wfShellWikiCmd". The old function now remains as a wrapper. The term "maintenance" is too restrictive.

Change-Id: I5c23d6475fd1aca374ee57b89212eee3a0d8cea1
2012-04-04 16:48:55 -07:00
Santhosh Thottingal
c56cca551e (bug 32748) unicode URL for articles print version
Printer friendly version of article must encode URL in unicode.

- Patch originally written by Brion Vibber
  https://bugzilla.wikimedia.org/attachment.cgi?id=9593
- introduces wfExpandIRI() global function, uses wfExpandIRI_callback.
- phpunit test.

Change-Id: I348b9f1d2ce65cb14f20d4a5751ac9359c8b8316
2012-04-02 18:14:41 +02:00
Tim Starling
4b8e45d604 * Removed the $method parameters from MWCryptRand. Apparently Dantman didn't know about our awesome debug traceback functions like wfGetAllCallers(). The weird optional-middle-parameter calling convention thankfully disappears as a consequence.
* Reduced the amount of debug log noise slightly, removing a few redundant messages.
2012-03-21 10:27:34 +00:00
Daniel Friesen
e2ee009e5c Commit the cryptrand project worked on in git:
- MWCryptRand: A new api for generating cryptographic randomness for security tokens. Uses whatever cryptographic source is available and if not falls back to using random state and clock drift.
- wfRandomString - A simple non-cryptographic pesudo-random string generation function to replace wfGenerateToken which was written pretending to be secure when it's really not.
- Core updates to use MWCryptRand in various places:
-- user_token generation (to do this we stop generating user_token implicitly and only generate it when needed to avoid depleting the system's entropy pool by reading random data we'll never use)
-- email confirmation token generation
-- password salt generation
-- temporary password generation
-- Generation of the automatic watchlist token
-- login and create user tokens
-- session ids when php's entropy sources are not set
-- the installer when generating wgSecretKey and the upgrade key
2012-03-20 05:17:40 +00:00
Aaron Schulz
7c54a34730 Reverted r113688, r113691 per CR and filed #61440 upstream. 2012-03-19 18:28:47 +00:00
Jeroen De Dauw
4febcf9cc1 docs++ 2012-03-15 22:40:27 +00:00
Aaron Schulz
a6a58fd0dd Made wfShellMaintenanceCmd() not totally broken due to excess shell escaping. 2012-03-13 00:05:23 +00:00
Alexandre Emsenhuber
73f6907199 * Put the timer stuff after leading line breaks in debug log entries (mainly for the first call on a request) so that they are placed near the remaing text and not on its own line
* Normalise line breaks in the first entry on a web request so that it's consistent with the one for command line requests
2012-03-12 19:01:44 +00:00
Robin Pepermans
9184dc83d6 Update core usage of getLanguageName[s]. 2012-03-08 20:56:26 +00:00
Antoine Musso
6e7dfac65a move wfRecursiveRemoveDir to global functions
That useful method was hidden in SeleniumWebSettings. I need it to clean
up test files leakages.
2012-02-24 15:41:06 +00:00
Alexandre Emsenhuber
e6fbfecf46 Added wfDeprecated() call to wfSpecialList() now there no more calls to that function in core or extensions 2012-02-16 12:59:48 +00:00
Alexandre Emsenhuber
72cafa3c8d Move wfIncrStats() near other debugging functions 2012-02-15 16:17:02 +00:00
Alexandre Emsenhuber
dfa3eca14c Always send 1 for "-total" item in wfIncrStats() when destination is UDP; it should not depend on the $count parameter 2012-02-14 14:10:32 +00:00
Brian Wolff
11f4db8b2a follow-up r111342. Document the callerOffset paramter being used per CR. 2012-02-13 20:29:41 +00:00
Robin Pepermans
fb3ae443ef Remove all usage of wfUILang(), deprecated in 1.18. Also some other minor tweaks. Didn't remove wfUILang itself yet in case someone uses older versions of the extensions with trunk/1.20. 2012-02-13 20:26:02 +00:00
Brian Wolff
d5b26e049a Give a warning when people use $wgArticle. Add's a class that can be used to give warnings for other globals too.
See discussion on r111168.

Of course no one will see warning because trunk has $wgDeprecationReleaseLimit set to 1.17 by default
(<rant>have I mentioned how I don't like that variable. People enable warnings to be *warned* about
things. Making it so people won't get warned about things until a couple months after we've decided people
should stop using function/interface/etc defeats the purpose of having warnings</rant>)

p.s. Wasn't sure if this waranted something in the release notes, I don't think it does (It's just adding a warning)
but wasn't sure.
2012-02-13 00:19:06 +00:00
Antoine Musso
a600f8a781 revert core part of r111231
That one removed wfLoadExtensionMessages() . We do not want to break
back compatiliblity right now.
2012-02-12 19:40:13 +00:00
Siebrand Mazeland
53e0d99f4b * Remove last remaining traces of wfLoadExtensionMessages().
* Add missing action message and remove unused global in UploadLocal.
* Some whitespace updates in Maps.
2012-02-11 12:17:58 +00:00
Sam Reed
76246b9bf5 More return documentation 2012-02-09 21:33:27 +00:00
Sam Reed
7b25f8231f Fixing some of the "@return true" or "@return false", need to be "@return bool" and then the metadata can say true if foo, false if bar
Other documentation improvements
2012-02-09 19:30:01 +00:00
Sam Reed
e1d83d5721 Fixing some of the "@return true" or "@return false", need to be "@return bool" and then the metadata can say true if foo, false if bar
Other documentation improvements
2012-02-09 18:01:54 +00:00