Commit graph

584 commits

Author SHA1 Message Date
Brion Vibber
e3588da458 Revert r44978 -- breaks back-compat 2008-12-23 22:04:25 +00:00
Aaron Schulz
68d56c8731 At least disable old xml function loading per r44839. An easy ~9-10ms. 2008-12-23 21:42:42 +00:00
Brion Vibber
4e4431d76b Revert r44918 "Remove unused functions"
We keep these things for backwards compatibility, as they may be in use by extensions even if not in core code.
2008-12-23 21:30:19 +00:00
Aaron Schulz
828205ec51 Remove unused functions 2008-12-22 22:56:46 +00:00
Aaron Schulz
8f25eb1f85 (bug 16689) wfDebugLog writes an error in Apache error.log 2008-12-20 02:19:33 +00:00
Aaron Schulz
040e07acf7 Remove LogPage require 2008-12-19 07:37:07 +00:00
Ilmari Karonen
8b30615423 Add a new FileCache class to wrap RepoGroup::findFile() and findFiles(), and make wfFindFile() use it by default. This should improve performance for pages that refer to the same image several times, but the real benefit is that it allows batch file existence checks, à la LinkBatch, by collecting a set of titles (or DB keys) and calling FileCache::findFiles() on them to prefill the cache.
XXX: The code seems to more or less work, but it obviously needs more testing, regarding both stability and memory usage.  In particular, I have not tested file uploads yet -- there may be consistency issues there.
2008-12-14 05:47:48 +00:00
Brion Vibber
4e01dba6cc Revert r44254 "Cleanup to wfGetNull(): * Add override in case /dev/null isn't accessible (bug 11009)"
Doesn't seem like a proper fix here... At best, this'll be dumping random crap to some random file unless the user has a local copy of the /dev/null device file, which seems.... wrong. :)
For anything generating command lines, it probably won't make any difference (assuming exec() is enabled at all!) since open_basedir won't be searching through the command line (I think).
Assuming the core use case actually happens (open_basedir is set, but proc_open() is available to run tidy), a more correct fix is probably to go ahead and read in stderr and toss the results, or maybe better pass it through to PHP's stderr FD instead of opening /dev/null ourselves. Tidy has a -q option which should suppress random "hi i'm tidy version XYZ" if it's currently present.
2008-12-10 22:58:24 +00:00
Chad Horohoe
f36d56a2fe Cleanup to wfGetNull():
* Add override in case /dev/null isn't accessible (bug 11009)
* Use wfGetNull() in ProxyTools rather than hardcoding it
2008-12-05 17:25:22 +00:00
Andrew Garrett
c06afd56b3 Revert "Follow up on r43982. Reduce dirname(__FILE__) calls in core and extensions."
Uses $dir in extension files, and assumes that it remains unchanged in require_once( 'maintenance/commandLine.inc' ).
In fact, it is likely that '$dir' will be set when setting up command-line, as some extensions will use the same var.

Recommended fix: Use $CentralAuth_dir, $EmailPage_dir, etc.
2008-11-30 03:15:22 +00:00
Siebrand Mazeland
daaa7f37a1 Follow up on r43982. Reduce dirname(__FILE__) calls in core and extensions. 2008-11-26 23:17:15 +00:00
Ilmari Karonen
4051abe715 Turn wfMkdirParents() into just a thin wrapper around mkdir( $dir, $mode, true ); this won't work in PHP4, but we don't support that, do we?
NOTE: the old code used to ignore the umask by explicitly forcing the permissions with chmod().  If this is desired behavior, it can be achieved by temporarily setting the umask to 0, as in:

$oldmask = umask( 0 );
$rv = mkdir( $dir, $mode, true );
umask( $oldmask );
return $rv;

However, I can't see why we'd want to do this.  In the worst case, users with excessively tight umasks can find themselves with unusable directories, but the proper solution to that is to fix the umask rather than to 
ignore it.  In the best case, we've just plugged a security hole the user didn't realize they had (because they assumed their umask would Just Work).
2008-11-21 12:52:36 +00:00
Brion Vibber
7b972ea1a0 Use strict parameter on in_array() checks in wfMsgExt(). In PHP 5.1.6 this was whinging when a Language object was passed as 'language' parameter, trying to convert it to an int (!?).
Since we're only checking for exact strings, an exact match is just fine and it stops the whinging. (Saw no such problem on 5.2.6.)

Example whinge:
Notice: Object of class Language could not be converted to int in /Library/WebServer/Documents/trunk/includes/GlobalFunctions.php on line 742
2008-11-14 00:46:53 +00:00
Aaron Schulz
59c45b5cbe Revert r43329, r43330 due to said performance issues 2008-11-13 08:15:23 +00:00
Brion Vibber
76f9b0b973 Run parsemag stuff through the proper language when wfMsgExt() asks for a specific one.
Previously we only passed on if we were interface or content, but if we're rendering for some third alternative it didn't get used.
Note that parse and parseinline are probably still wrong.... some better model may be required here.
Also it may be wrong in the case of fallbacks ... if you get an English message, is it right to use the Czech magic word parsing?
Hmm.
Might back it out if there's a better way. :)
2008-11-13 01:02:17 +00:00
Victor Vasiliev
f5021e2274 * Add class "disambiguationpage" to body tag
* Split off MediaWiki:Disambiguationspage parsing to
  wfGetDisambiguationTemplates()
2008-11-09 18:21:42 +00:00
Tim Starling
2b4c3cd654 * Rewrote wfArrayMerge() in terms of array plus
* Two callers of wfArrayMerge() were bugs, both assuming strange and complex behaviour in wfArrayMerge() which has never been present or documented.
* Introduced wfMergeErrorArrays() to remove duplicates from merged error arrays, e.g. from getUserPermissionsErrors().
* Rewrote the remaining callers of wfArrayMerge() to use array plus. It makes the code clearer, assuming the reader knows more about basic PHP operators than GlobalFunctions.php. Considering the two bugs discussed above, this seems like a fair assumption. If you don't know PHP, you shouldn't be writing MediaWiki code.
2008-11-01 23:20:25 +00:00
Brion Vibber
4fd26b6b8a Update doc comment for wfArrayMerge() to note the behavior difference between array_merge() with string keys and the + operator on arrays. Now with less cursing. :) 2008-11-01 22:30:56 +00:00
Tim Starling
38707d9565 * Added $wgDebugLogPrefix, to allow users (or in this case, multiprocess command-line scripts) to set a debug log line prefix
* Improved blob_tracking.sql docs
* Allow testCompression.php to run until happy instead of a specified revision count
* Added docs for some debugging globals in DefaultSettings.php

In experimental script recompressTracked.php:
* Fixed crippling bugs, seems to work now. Needs more testing.
* Improved usage documentation
* Use DiffHistoryBlob by default if available
* Set a process-specific log prefix, added more debugging output
* Optimised commit() slightly by merging the locking read queries using IN()
* Fixed finishIncompleteMoves() so doPage() acts on only that page. Also run finishIncompleteMoves() for orphan lists.
2008-11-01 12:06:23 +00:00
Bryan Tong Minh
8e046be4a5 ISO 8601 timestamps can have decimal seconds 2008-10-31 15:53:15 +00:00
Greg Sabino Mullane
547cb9858c Postgres timestamps can have decimals. 2008-10-25 20:35:14 +00:00
Niklas Laxström
36ea5821d1 * Unused global 2008-10-21 15:05:10 +00:00
Tim Starling
9e3b81e321 Use a variable for max shell time, don't use php.ini, like we do for memory and file size. 2008-10-16 11:32:44 +00:00
Tim Starling
0ca52a920d Revert merge of DismissableSiteNotice into the core (r41679 and subsequent edits). We should have higher standards than this for core code. This is largely my own crap code and there's a reason I didn't commit it to the core in the first place.
* The sitenotice_id hack is virtually unusable and needs to be replaced with a dedicated message update interface. 
* There's a need for automatic message expiry. 
* The Wikimedia-specific "spite the anons" feature, preventing anonymous users from dismissing site notices because they allegedly don't contribute to the wiki enough to deserve it, needs to be made optional.
2008-10-11 04:31:15 +00:00
Antoine Musso
45081512a1 Document wfVarDump() 2008-10-09 21:11:10 +00:00
Alex Z
098f276067 Fix some profiling errors in wfGetSiteNotice() if no sitenotice is defined 2008-10-09 21:08:42 +00:00
Aaron Schulz
59ba5e575b Revert r41788 and make flaggedrevs do the findFile call itself 2008-10-07 21:42:23 +00:00
Alexandre Emsenhuber
a8925f9747 Revert r41792, broke uploads. Note that RepoGroup::findFile() returns false if no file was found, which might be the case when uploading new files ;) (see bug 15883) 2008-10-07 20:14:55 +00:00
Aaron Schulz
56fac0c47d Tweak r41788 - Use findFile() to check current version if $time given 2008-10-07 02:22:37 +00:00
Aaron Schulz
ff4db4a3eb Add handy $time parameter to wfLocalFile() 2008-10-07 00:30:18 +00:00
Alexandre Emsenhuber
5c8a1938da Fix XHTML error (url not escaped) 2008-10-06 18:56:14 +00:00
Tim Starling
90ed80443e (bug 12586) Use wfHostname() everywhere, remove $wguname and $wgNodeName. Use getenv('COMPUTERNAME') on Windows. 2008-10-06 07:30:38 +00:00
Tim Starling
0d322a394e * Allow $wgDiff3=false
* Don't call quickUserCan('edit') unless section edit is enabled
* In DatabasePostgres and DatabaseSqlite: throw an exception on connection error
* In DatabasePostgres: don't send an invalid connection string whenever one of the fields is empty. Use quoting.
* In Database: make the captured PHP error prettier
* Display a descriptive error message when the user navigates to index.php with PHP 4, not a parse error. Check to see if the *.php5 extension works, using file_get_contents().
* The default port number for PostgreSQL is 5432, not blank.
* Better default for $wgDBname
2008-10-06 00:45:18 +00:00
Ryan Schmidt
a235f130a6 * fixing DismissSiteNotice so that it works properly with javascript-disabled browsers
* make DismissSiteNotice honor cookie configuration variables
* adding missing name to CREDITS
2008-10-05 21:28:11 +00:00
Ryan Schmidt
2861a4862c * fixing bugs with DismissableSitenotice merge:
** [dismiss] link does not show up if sitenotice is blank
** [dismiss] link is in line with notice instead of under
2008-10-05 19:53:49 +00:00
Jack Phoenix
e1b9d8b91a Merging DismissableSiteNotice extension into core. 2008-10-04 23:46:06 +00:00
Alexandre Emsenhuber
5167cf4cad Fix for r41430: wfMsgExt() now accepts a Language object in the language key of $options 2008-09-30 17:15:11 +00:00
Tim Starling
dc935786a3 Hostnames are allowed to have dots in them 2008-09-30 08:45:52 +00:00
Tim Starling
c69d5d46e8 Proposed fix for bug 14944, specifically the reports that some servers do not have en_US.UTF-8. Make the locale configurable via $wgShellLocale. Detect available locales and set $wgShellLocale to an appropriate value on install. Also fixes safe_mode putenv() warnings. RELEASE-NOTES entry will go to 1.13. 2008-09-29 10:19:11 +00:00
Aryeh Gregor
695161a6f1 Fix totally broken last commit, misread the existing code 2008-09-26 21:35:03 +00:00
Aryeh Gregor
3fe917dc68 Remove unnecessary conditional 2008-09-26 21:31:17 +00:00
Aryeh Gregor
82d21903e6 Fix for 41288, don't raise errors for language parameter
The documentation didn't make it clear that the wfMsgExt() array can take a single associative parameter.  I've clarified this, and fixed error-checking for that.  Also adjusted indentation in the comment for clarity (one space isn't enough).
2008-09-26 21:31:10 +00:00
Aryeh Gregor
70f83843e0 Raise E_USER_WARNING if bad option passed to wfMsgExt() 2008-09-26 17:25:17 +00:00
Tim Starling
80a610618c Fix unnecessary GlobalFunctions.php bloat from r41148 2008-09-24 08:36:44 +00:00
Tim Starling
aab518cf78 * Add a simple log demultiplexer, written in python, for low-volume MediaWiki logs
* in wfErrorLog(): clean up log text so that it works properly with the multiplexer
2008-09-24 08:17:35 +00:00
Tim Starling
b77387ca89 Implemented UDP logging. 2008-09-24 07:11:41 +00:00
Aaron Schulz
9894dfb363 Refactor RC2UDP code some 2008-09-22 12:22:18 +00:00
Tim Starling
9b8782aaa8 Don't run hour-long, unlimited row-count DB queries with set_time_limit(0) in response to unauthenticated web requests on the master. Run them on the slave instead. Maybe we can crash the whole cluster instead of just a master or two.
Don't use DB_LAST, ever again.
2008-09-20 15:00:53 +00:00
Brion Vibber
37dded29d1 Revert r40953 '(bug 7509) Don't hardcode separation strings, make them configurable'
This seems to make code much uglier and harder to maintain -- there are a bajillion new calls to "wfMsgExt( 'pipe-separator' , 'escapenoentities' )" which is not trivial or easy to remember. This makes code uglier, harder to read, harder to maintain, and more prone to error.
2008-09-18 17:11:51 +00:00
Siebrand Mazeland
0057d58e09 (bug 7509) Don't hardcode separation strings, make them configurable
* Introduced message 'pipe-separator' to replace many occurrence of " | ". No changes made in skin "Nostalgia".
2008-09-17 09:41:51 +00:00