Commit graph

202 commits

Author SHA1 Message Date
Tim Starling
2f12a58d93 * Introduced StringUtils.php, populated it with some generic string functions, both new and collected from various other files.
* Removed some backtracking regexes with an O(N^2) worst case, replaced with StringUtils::delimiterReplace(). There is a beneficial functional difference: /*/ is no longer considered to be a complete CSS comment.
* Changed the parser strip state from an array to an object. This should hopefully avoid the PHP bugs with array references. StripState uses the new ReplacementArray to do the replacements, thereby supporting FSS. 
* Removed DatabaseFunctions.php from the default startup sequence. Moved wfGetDB() to GlobalFunctions.php.
* Introduced the SiteStats class, with a collection of cached site stats accessor functions.
* Removed all global functions from Parser.php, they don't belong there.
* Made LanguageConverter use the new ReplacementArray class instead of managing its own FSS objects.
2006-11-21 09:53:45 +00:00
Brion Vibber
68ce1cb3bf * Fix purging for updated SVG files
Purging was using getViewUrl(), which is a generated thumbnail for SVG and other render-only formats.
Switched to using getUrl(), which returns the file itself. The thumb will be separately covered as is.
2006-10-29 18:04:11 +00:00
Brion Vibber
ad447f6bf4 * (bug 7599) Fix thumbnail purging, PHP notices on HTCP image page purge
Somebody changed the parameters and return value of Image->thumbUrl()
and didn't update all uses. Silly of them!

Also add a paranoia check on urls in the list in SquidUpdate

And don't redefine the socket options constants when called a second time
2006-10-16 19:12:56 +00:00
Ilmari Karonen
0471eded8a use ImageMagick -thumbnail option instead of -resize 2006-10-05 14:55:41 +00:00
Tim Starling
e174a4ddfb Abolished $wgDBname as a unique wiki identifier, it doesn't work with the new-fangled feature we call "table prefixes". Instead use wfWikiID() for an identifier containing the DB name and the prefix if there is one, and wfMemcKey() for cache key construction.
Caches for wikis with table prefixes will be lost on upgrade, caches for wikis without table prefixes will be preserved. Custom cache keys in extensions can be migrated at leisure. Extensions which write to core cache keys should be migrated ASAP, as I have done with Special:Makesysop.
2006-10-04 09:06:18 +00:00
Tim Starling
3005679b0e * Removed lots of explicit require_once statements. The autoloader should theoretically be faster, because it always uses an absolute path, eliminating the need for a search, and it is never called unnecessarily. Absolute paths are also more robust in the face of odd configurations or usage patterns. Moved a few constants around to support this, they always have to be available before the method call.
* Deleted DatabaseMysql.php, no longer necessary, database classes are autoloaded. 
* Moved wfGetMimeMagic() to MimeMagic::singleton()
* Fixed a couple of __CLASS__.'::'.__FUNCTION__ things.
2006-10-03 13:00:52 +00:00
Brion Vibber
c8acd3393b * Cleaner error behavior on thumb.php with invalid page selection 2006-10-02 21:12:28 +00:00
Jens Frank
41440bf516 update metadata for old images, ignore page= if no djvu renderer has been supplied 2006-08-27 18:36:54 +00:00
Jens Frank
27624af90a DJVU rendering: Handle old DB metadata entries 2006-08-13 21:09:20 +00:00
Jens Frank
5c6c53b39a remove superfluous debugging code 2006-08-13 20:03:11 +00:00
Jens Frank
7f7e79022b (bug 6420) Render thumbnails for djvu images, show multipage preview on image page 2006-08-13 17:34:48 +00:00
Tim Starling
6530b5eb12 Allow negative caching for sites with no commons 2006-08-06 13:32:56 +00:00
Brion Vibber
5721fe68c0 Restore factory function to avoid gratuitously breaking extensions for no reason whatsoever what the heck 2006-07-12 06:39:55 +00:00
Antoine Musso
fa813bd470 Fix #6622: image::newFromTitle deprecated but still used 2006-07-10 19:49:22 +00:00
Antoine Musso
5c225aa659 static function 2006-07-10 19:34:07 +00:00
Tim Starling
13cbb3dd29 Fixed SVG bug introduced in 15342 2006-07-05 12:51:38 +00:00
Tim Starling
643396ce0a profiling 2006-07-05 07:20:11 +00:00
Tim Starling
5bd1f1f834 removed debugging code 2006-07-05 05:15:17 +00:00
Tim Starling
179733a3f0 Created $wgGenerateThumbnailOnParse, set to false to allow NFS stat calls to be suppressed. 2006-07-05 05:04:06 +00:00
Tim Starling
7f484c8cf0 Fixed flow control in Image::getThumbnail() 2006-07-04 18:04:28 +00:00
Tim Starling
9165ef2c4b Changed the image directory global functions, they no longer create the directory before they return it. This was inefficient, especially due to the need for multiple NFS stat calls for every image shown on a page during parse. The caller is now required to create the directory if necessary, and it can do so with the recently souped-up wfMkdirParents(). 2006-07-04 14:20:52 +00:00
Tim Starling
8e95fd56da Fixed fatal error on old image deletion when squid was enabled 2006-07-03 13:27:19 +00:00
Tim Starling
2ff288720c Various performance and initialisation issues:
* Made autoloader work for unserialize()
* Made XmlFunctions.php and HttpFunctions.php autoloadable modules, via Http:: and Xml::
* Made Image class autoloadable, global functions moved to ImageFunctions.php where they can be loaded on every invocation.
* Removed some unnecessary require_once() calls
* Deferred $wgValidSkinNames initialisation
* Fixed a couple of silly construct/initialise splits. My idea from C++ experience, bad practice in PHP.
* Deferred skin initialisation in ParserOptions
* Removed $wgMwRedir during an attempt to make MagicWord autoloadable. Didn't complete that, but removing the global is still the right direction.
2006-07-02 15:57:59 +00:00
Brion Vibber
5808535e16 * Fix display of file-type icons in galleries when $wgIgnoreImageErrors is off 2006-06-25 06:23:53 +00:00
Brion Vibber
228f96a905 * (bug 6131) Add type detection for DjVu files, allowing them to be uploaded
with validity checking and size detection. No inline thumbnailing yet,
  but could be added in the future.
2006-06-24 07:11:17 +00:00
Tim Starling
0e2714b61d Added a new method to update the cache of all pages linking to a given page without using excessive time or memory. This turns out to be a common operation in MediaWiki, I needed to fix callers in a lot of files. Backwards compatibility is maintained (of course). Also did some cleanup in Article.php, another 3 years of that and it'll be looking pretty. New job type added to the job queue, some refactoring done in JobQueue.php to support it. 2006-06-18 12:42:16 +00:00
Tim Starling
b2c6e8261b Commit the transaction after an upload is recorded and logged, to avoid losing images due to a rollback later on. 2006-06-17 04:32:41 +00:00
Tim Starling
043c6d2c83 Fixed inconsistent error return in Image::getThumbnail() -- was returning null if height wasn't specified, an icon thumb if it was. Made it return null all the time, and fixed ImageGallery.php to understand that return value. Also made ImageGallery give informative errors if $wgIgnoreImageErrors is off. 2006-06-17 04:11:21 +00:00
Brion Vibber
0cdc6e8d57 Fix purge of image on delete 2006-06-16 03:16:46 +00:00
Brion Vibber
8a42f0b1a8 (bug 2099) Deleted files can now be archived and undeleted, if you set up an appropriate non-web-accessible directory.
Set $wgSaveDeletedFiles on and an appropriate directory path in $wgFileStore['deleted']['directory']
2006-06-16 01:16:45 +00:00
Tim Starling
02547dac72 Removed most exit() calls from the MediaWiki core, by replacing them with either a throw or by classic error checking. OutputPage::fatalError() and similar functions are deprecated, use either OutputPage::showFatalError() to return control or throw new FatalError() to relinquish it. Backwards compatibility of all interfaces has been maintained, thus extensions should continue to work and can be ported at a later date. 2006-06-07 06:40:24 +00:00
Domas Mituzas
7fd347b45a Autoload Exif and move global defines to Exif:: namespace 2006-06-06 12:08:11 +00:00
Brion Vibber
0a26267688 Revert to r14512; domas introduced massive breakage with incomplete experimental changes. They will be recommitted when they work. :) 2006-06-01 08:19:02 +00:00
Domas Mituzas
bda0b8e104 Use AutoLoader to load classes:
* remove require_once() throughout whole code, yet left in few places
* move global functions in HttpUtils, ProxyTools, Credits to class methods
* php5 only: __autoload() now used, combined with class->file map and require()
* move initialization of $wgValidSkinNames to Skin::getSkinNames()
* few more changes that will surely break stuff.
2006-06-01 07:22:49 +00:00
Jens Frank
0cd46b8254 (bug 1017) fix thumbnails of animated gifs 2006-05-28 13:06:48 +00:00
Brion Vibber
fcc206e288 * Add $wgIgnoreImageErrors to suppress error messages for thumbnail rendering problems. If errors are transitory, this should reduce annoying messages making it into cached display. 2006-05-26 21:33:38 +00:00
Brion Vibber
cf91714d58 * wfShellexec() now accepts an optional parameter to receive the exit code
* Failed, but not zero-length, thumbnail renderings are now removed. Should help clean up when rsvg fails in weird ways.
2006-05-26 02:41:20 +00:00
Brion Vibber
84e414cdcd Gah, forget this. borked 2006-05-26 01:42:51 +00:00
Brion Vibber
2cc1bdff41 woops 2006-05-26 01:40:26 +00:00
Brion Vibber
17d0c1bc5d Also log if we overrode the failure notice due to non-zero-size output file 2006-05-26 01:38:21 +00:00
Brion Vibber
cb504bfe41 * wfHostname() function for consistent server hostname use in debug messages
* Send thumbnailing error messages to 'thumbnail' log group
2006-05-26 01:03:34 +00:00
Brion Vibber
95e391545a * (bug 6074) Correct squid purging of offsite upload URLs
You can now feed both local relative URLs and fully-qualified URLs to the
squid purge functions; local URLs will have $wgInternalServer prepended
if needed. This avoids the broken URLs produced by other functions prepending
it when it wasn't always needed.
2006-05-24 21:57:25 +00:00
Rob Church
b01da48ba2 Suppress images in galleries which appear on the bad image list (when rendering for a wiki page; galleries in special pages and categories are unaffected) 2006-05-16 19:15:58 +00:00
Antoine Musso
7ebdb6de89 Revert to r14165 . Did too many changes, didnt even run parserTests (i am bad) 2006-05-11 22:40:38 +00:00
Antoine Musso
bc14eb8045 Replacing var keyword with private / public as we now require PHP5. 2006-05-11 19:10:41 +00:00
Rob Church
9401ed5bb2 (bug 5782) Allow entries in the bad image list to use canonical namespace names 2006-05-02 00:41:30 +00:00
Antoine Musso
473cd5cbcc unused variables as per #3692 2006-05-01 10:53:59 +00:00
Rob Church
7518139ca5 (bug 5716) Warn when a user tries to upload a file which was previously deleted 2006-04-29 22:01:21 +00:00
Antoine Musso
69689725c1 Switching from phpdoc to doxygen (use less than 32MB of memory).
Run maintenance/mwdocgen.php to generate doc in ./docs/html/ .
2006-04-19 15:46:24 +00:00
Tim Starling
e37ac151a9 Use a separate query group for commons. 2006-04-11 19:53:38 +00:00