Commit graph

685 commits

Author SHA1 Message Date
Chad Horohoe
0434529434 Remove wfGetHTTP(), has been deprecated for ages and has no callers. Also stop loading XmlFunctions by default. 2010-03-06 22:42:20 +00:00
Platonides
d313859b02 (Bug 22709) IIS 7 mishandles redirects generated by OutputPage::output() when
the URL contains a colon.
Avoid tinifying colons for IIS 7.

It's a pity how it pollutes a clean function like wfUrlencode.
2010-03-03 22:01:09 +00:00
Platonides
634b81f8d0 Follow-up r63213. Move it to wfEscapeShellArg, which is the proper place. 2010-03-03 18:22:26 +00:00
Alexandre Emsenhuber
e97c055e74 Fix for r63000: remove the "!" in the check 2010-02-26 09:04:14 +00:00
Alexandre Emsenhuber
b8b254da7f Fixes to r62995:
* Avoid fatal error if $wgProfiler is either not a object (ProfilerStub.php) or an instance of Profiler
* Set $wgProfiler to null in ProfilerStub.php so that $wgProfiler doesn't need to be checked with "isset" first, updated check in GlobalFunctions.php accordingly
2010-02-26 08:53:06 +00:00
Niklas Laxström
e1065a1d57 Little docs to help developers keep track of versions... 2010-02-24 16:06:55 +00:00
Chad Horohoe
c5267bf20e Drop ancient PHP4 wrapper for cloning, completely unused 2010-02-13 02:29:59 +00:00
Chad Horohoe
4f772a5b33 Followup r61655, add sys_get_temp_dir() support to wfTempDir(), use this in HttpTest rather than duplicating code 2010-01-29 23:52:06 +00:00
Niklas Laxström
b1e2b87b95 New configuration variables $wgDebugTimestamps and $wgDebugPrintHttpHeaders for controlling debug output.
I find these useful, maybe someone else will too.
2010-01-27 17:21:18 +00:00
Chad Horohoe
b8fd924711 Fixme on r57980: Memcached would be bad here, rename variable with wg prefix. Fixes to UsabilityInitiative will follow 2010-01-25 13:57:51 +00:00
Sam Reed
d71b682cc6 Refactor array_intersect_key from ApiResult.php to GlobalFunctions.php 2010-01-23 22:31:37 +00:00
Chad Horohoe
07c5db7f40 Clarify parameters to wfFindFile and wfLocalFile, and return caveat to the "This always returns files" comment 2010-01-22 19:48:10 +00:00
Platonides
da21210211 (bug 22034) use wfClientAcceptsGzip() in wfGzipHandler instead of reimplementing it.
$wgUseGzip check on wfClientAcceptsGzip() is removed since HTMLFileCache (the only wfClientAcceptsGzip() user) already checked that before calling it. This way, $wgUseGzip stays applying only for file cache, and $wgDisableOutputCompression for  output handler.
2010-01-14 16:35:35 +00:00
Tim Starling
a8956ea2fd Reverted r59548 (reopens bug 21086).
wfWikiID() is used as a way to identify and connect to a given database in LoadBalancer and various extensions, that's why it must contain the database name and table prefix. Perhaps its use as a public identifier should be optional, but in that case the public identifier needs to be customised, not the return value of wfWikiID().
2010-01-12 05:20:31 +00:00
Siebrand Mazeland
7c27e42fb8 Revert 60864: "Use wfClientAcceptsGzip() in wfGzipHandler." Causes PHP Notice: Undefined index: HTTP_ACCEPT_ENCODING in GlobalFunctions.php on line 1175 2010-01-09 19:14:43 +00:00
Siebrand Mazeland
29e47fa366 (bug 22034) Use wfClientAcceptsGzip() in wfGzipHandler. Patch by Platonides.
wfGzipHandler should use wfClientAcceptsGzip() instead of reimplementing it. Patch does this and removes the $wgUseGzip check on wfClientAcceptsGzip() since HTMLFileCache (the only wfClientAcceptsGzip() user) already checked that before calling it. This way $wgUseGzip stays applying only for file cache, and $wgDisableOutputCompression for output handler.
2010-01-09 18:10:11 +00:00
Sam Reed
5caeb07339 Minor followup to r60744, fix for comment 2 2010-01-06 21:27:25 +00:00
Sam Reed
b6e0df246f Attempt at normalistion of comparison styles - empty string on left and right hand side normalised to it being on the rhs
Before this change, there were (? being regex 0 or 1)

"" ===? 1
'' ===? 24
"" !==? 8
'' !==? 32

== "" 14
== '' 344
!= "" 9
!== "" 4
!= '' 151
!== '' 85


Rhs was the much more common, and the preferred style by many developers.. (Was a similar discussion in #mediawiki recently.. After that lolbugreport i think)

Where there is a string (non empty) on the lhs, and variable/method call on the rhs still need normalising
2010-01-06 19:59:42 +00:00
Roan Kattouw
af3fd687db Add $maxlag parameter to LoadBalancer::getMaxLag() so it'll actually select the right DB when opening new connections. Looks like an ugly temp fix to me but I have no idea how to do it properly offhand. 2010-01-05 23:39:16 +00:00
Chad Horohoe
a4e5e935b6 Mass convert NULL -> null. Left strings and comments alone, obviously. 2009-12-11 21:07:27 +00:00
Tim Starling
bd8fffe24d Reverted r58646 as per my comments on bug 20554. 2009-12-01 01:55:04 +00:00
Chad Horohoe
03d5e6f93c Add $wgWikiId to override default wfWikiId() output. Solves bug 21086 (security issue: generateSitemap.php does use wfWikiID in sitemap filenames) 2009-11-29 16:13:40 +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
Tim Starling
ca0382f099 Fixed corruption of long UDP debug log messages by using socket_sendto() instead of fsockopen() with fwrite(). Using fwrite() causes the message to be split up into 8KB async send() calls, and whether they end up in the same UDP packet just depends on timing. 2009-11-18 06:21:27 +00:00
Bryan Tong Minh
a7b10d2410 Introduce $wiki parameter to wfWaitForSlaves in order to be able to wait for the proper slave. Implemented this in GlobalUsage. Fix GlobalUsage.sql for sqlite. 2009-11-09 11:38:52 +00:00
Roan Kattouw
1b89cd274a API: (bug 20554) Expose average slave lag (avglag) as well as maxlag. Patch by Sam Reed. 2009-11-06 14:38:55 +00:00
Roan Kattouw
b128fd1b05 * Export the return value of wfUrlProtocols() to JS for use in the EditToolbar extension
* Also cache this value (in a static var for now, maybe put it in memcached?): when parsing pages with many external links, we'd end up calling implode() once and preg_quote() 11 times for every link
2009-10-21 17:35:57 +00:00
Michael Dale
42c2037b14 * follow-up to r57728 switched to use global wfShellExec function 2009-10-14 21:51:36 +00:00
Michael Dale
c601562cff * (bug 21140) Fixed Upload Form for using an Antivirus Program on Windows 2009-10-14 21:39:52 +00:00
Chad Horohoe
c5096e53cd Followup r56731, check for PHP 5.3 or greater (where it was fixed). Not a Windows issue 2009-09-30 00:38:32 +00:00
Chad Horohoe
b475a25f8d (bug 20353) wfShellExec() malfunctioning on NT builds 6002 and above. Patch by Jimmy Xu. 2009-09-21 19:50:16 +00:00
Alexandre Emsenhuber
6f9f6643d7 * indent debug output produced when both $wgShowDebug and $wgDebugFunctionEntry are enabled for better readability. In this case, unindented comment will be displayed "inline" with a yellow background
* added an id to the debug data list
* allow to use $wgShowDebug with $wgDebugComments set to false
* update HTMLFileCache to use full method name in debug output
2009-09-17 18:55:29 +00:00
Andrew Garrett
e8ea1aa080 LiquidThreads JS/AJAX updates
* Bump interval from 30s to 60s.
* Add an "update" link (text changed, sorry translators :(), which reloads the thread from the server.
* Fix bug in continuation caused by last-minute changes.
* Fix bug where only one reply per thread was being loaded.
* Fix bug where AJAX-loaded threads were loading one level too few.
* Fix bug in interpretation of API parameters.
2009-09-16 00:53:37 +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
Tim Starling
7b7f9f0d4d Comments and whitespace fixes only. 2009-09-10 06:43:01 +00:00
Michael Dale
7efc871cba * (bug 20336) changed json_decode json_encode to static class in global functions
** we should update extensions as well
* added config for fileCheckModify date check to scriptLoader unique script id generation
2009-09-09 22:26:16 +00:00
Jack D. Pond
ad54e0bcf8 Bug 20489 Configure illegal file characters https://bugzilla.wikimedia.org/show_bug.cgi?id=20489
$wgIllegalFileChars configurable to add chars for filename automatically converted to "-".
2009-09-04 03:44:14 +00:00
Bryan Tong Minh
363375c69e Fix wfShellBackgroundExec for windows. Works in maintenance/eval.php mode, have not tested when running php as webserver module. 2009-08-28 19:32:07 +00:00
Bryan Tong Minh
05a916153f * Cleanup ApiUpload
* UploadBase::verifyUpload now always returns a status array
* Disabled async upload by url because wfShellBackgroundExec is broken
2009-08-26 19:38:38 +00:00
Brion Vibber
1505db42a2 Replace our mb_substr() fallback implementation with one which is not quite so horrible...
While not too awful on smallish strings, the way it worked was *murder* on large input:
the *entire string* would be broken up into an array of individual characters, sliced up,
then merged back together.

In my testing I couldn't even get the function to complete in a reasonable time for, say,
127k worth of text... not only did the regex split take forever, but it would eat an insane
amount of memory, likely triggering memory_limit hits in a sane world.

The new implementation counts characters from the beginning or end of a string to determine
the byte-based offsets to use for substr() start and count parameters, and only uses
a couple temporary dupes of the string in memory. For typical short offset/count cases
(take or trim one or a few characters) this performs about 3-5x worse than native mb_substr()
for in my testing.

Large offsets are optimized by first skipping the same number of bytes as characters, since all
characters take at least one byte. On primarily Latin text this made some of my test cases
actually *faster* than native mb_substr()! ;) For non-Latin texts this takes out a fair chunk
of our work, but can still leave us with very slow execution -- eg ~30ms to get through a few
dozens of kilobytes worth of offset on Japanese text. But at least it completes now!

This could probably be optimized further, perhaps skipping progressively smaller chunks in
binary-chop fashion. :)


For fun, my profiling results (profiling & test scripts are in a little git repo which I would
push to gitorious to poke at, but gitorious hates me right now and won't finish my repo setup):

strlen       mb_strlen short ascii - 0.0019ms - 19
strlen      xmb_strlen short ascii - 0.0672ms - 19

strlen       mb_strlen short unicode - 0.0019ms - 19
strlen      xmb_strlen short unicode - 0.0657ms - 19

strlen       mb_strlen long ascii - 0.0826ms - 20000
strlen      xmb_strlen long ascii - 0.1236ms - 20000

strlen       mb_strlen long unicode - 0.0774ms - 20000
strlen      xmb_strlen long unicode - 0.1901ms - 20000

strlen       mb_strlen san francisco - 0.4775ms - 126700
strlen      xmb_strlen san francisco - 0.4474ms - 126700


substr       mb_substr short ascii first - 0.0022ms - 1-byte string ("s") <- native
substr      xmb_substr short ascii first - 0.0168ms - 1-byte string ("s") <- old fallback
substr     xmb_substr3 short ascii first - 0.0069ms - 1-byte string ("s") <- new fallback

substr       mb_substr short ascii last - 0.0023ms - 1-byte string ("s")
substr      xmb_substr short ascii last - 0.0171ms - 1-byte string ("s")
substr     xmb_substr3 short ascii last - 0.0113ms - 1-byte string ("s")

substr       mb_substr short ascii trim last 9 - 0.0023ms - 10-byte string ("short asci")
substr      xmb_substr short ascii trim last 9 - 0.0183ms - 10-byte string ("short asci")
substr     xmb_substr3 short ascii trim last 9 - 0.0119ms - 10-byte string ("short asci")

substr       mb_substr short ascii middle 3 - 0.0022ms - 3-byte string ("sci")
substr      xmb_substr short ascii middle 3 - 0.0171ms - 3-byte string ("sci")
substr     xmb_substr3 short ascii middle 3 - 0.0149ms - 3-byte string ("sci")

substr       mb_substr short unicode first - 0.0022ms - 1-byte string ("s")
substr      xmb_substr short unicode first - 0.0184ms - 1-byte string ("s")
substr     xmb_substr3 short unicode first - 0.0071ms - 1-byte string ("s")

substr       mb_substr short unicode last - 0.0026ms - 2-byte string ("ß")
substr      xmb_substr short unicode last - 0.0187ms - 2-byte string ("ß")
substr     xmb_substr3 short unicode last - 0.0130ms - 2-byte string ("ß")

substr       mb_substr short unicode trim last 9 - 0.0024ms - 14-byte string ("short áéíó")
substr      xmb_substr short unicode trim last 9 - 0.0200ms - 14-byte string ("short áéíó")
substr     xmb_substr3 short unicode trim last 9 - 0.0137ms - 14-byte string ("short áéíó")

substr       mb_substr short unicode middle 3 - 0.0022ms - 6-byte string ("éíó")
substr      xmb_substr short unicode middle 3 - 0.0188ms - 6-byte string ("éíó")
substr     xmb_substr3 short unicode middle 3 - 0.0189ms - 6-byte string ("éíó")

substr       mb_substr san fran first - 0.0022ms - 1-byte string ("{")
substr     xmb_substr3 san fran first - 0.0069ms - 1-byte string ("{")

substr       mb_substr san fran last - 0.8914ms - 1-byte string ("\n")
substr     xmb_substr3 san fran last - 0.0109ms - 1-byte string ("\n")

substr       mb_substr san fran non-first - 0.5995ms - 127318-byte string (c00cabc812ac347bd2e81a3e3f04e23d)
substr     xmb_substr3 san fran non-first - 0.0213ms - 127318-byte string (c00cabc812ac347bd2e81a3e3f04e23d)

substr       mb_substr san fran middle 1k - 0.2218ms - 1025-byte string (c42eb5c511670f72ff4593a39219682c)
substr     xmb_substr3 san fran middle 1k - 0.3883ms - 1025-byte string (c42eb5c511670f72ff4593a39219682c)

substr       mb_substr boston-ja first - 0.0021ms - 1-byte string ("{")
substr     xmb_substr3 boston-ja first - 0.0068ms - 1-byte string ("{")

substr       mb_substr boston-ja last - 0.5497ms - 1-byte string ("\n")
substr     xmb_substr3 boston-ja last - 0.0110ms - 1-byte string ("\n")

substr       mb_substr boston-ja non-first - 0.4128ms - 127637-byte string (933e70d1d10f4d64cdfbd69b58592cd4)
substr     xmb_substr3 boston-ja non-first - 0.0216ms - 127637-byte string (933e70d1d10f4d64cdfbd69b58592cd4)

substr       mb_substr boston-ja middle 1k - 0.2237ms - 2006-byte string (1eaa8554ff4507109b1cba7a597d82bf)
substr     xmb_substr3 boston-ja middle 1k - 30.6811ms - 2006-byte string (1eaa8554ff4507109b1cba7a597d82bf)
2009-08-26 05:51:21 +00:00
Chad Horohoe
ba7d16a410 Merge r53381 from wmf-deployment. Throw more informational error on creation failure. 2009-08-22 16:50:03 +00:00
Alexandre Emsenhuber
4d2ccdcfdd Document wfWarn() function 2009-08-20 21:35:22 +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
OverlordQ
ab8c557b78 Followup to r54416
Dont log messages when you 'increase' the limit from a number to itself.
2009-08-05 02:34:41 +00:00
OverlordQ
30e44a06fc Follow up to r54414 and r54356. Hopefully catches all of the edge cases of erroneous input. On a side note, if PHP is configured with too low a limit it can die before it even reaches the code in Setup.php 2009-08-05 01:33:18 +00:00
Andrew Garrett
8daea0e131 Fix syntax error 2009-08-04 15:08:56 +00:00
Chad Horohoe
2b0d981500 Better patch for parsing PHP's memory limits from OverlordQ. 2009-08-04 11:18:05 +00:00
Chad Horohoe
1d5874a8c7 (bug 16084) Default memory limit should be increased 2009-08-04 02:47:39 +00:00
Niklas Laxström
45130adc36 Memcached does not like spaces in keys 2009-08-03 11:36:47 +00:00
Chad Horohoe
3eafc7fe53 Http::get() doesn't return an object, it already returns the results or null anyway. BTW: is anyone actually still using this? *stab* 2009-08-01 18:44:28 +00:00