Commit graph

36 commits

Author SHA1 Message Date
Chad Horohoe
cb682a2ca1 * Redo thumb caching and make it a part of the default /thumb/ structure with hashes as needed.
* Move the generic getHashPath accessor up a level to the FileRepo.
2008-11-08 22:20:23 +00:00
Aaron Schulz
ef3baf4e62 Add more error handling 2008-09-07 00:38:57 +00:00
Chad Horohoe
6eef7a366a Revert r40385. Half-assed attempt at making something configurable that doesn't need to be leads to borken code. /thumb/ is no longer configurable...just like it was before. 2008-09-05 18:29:42 +00:00
Chad Horohoe
4c03073817 Implement 'thumbDir' configuration parameter for local and foreign repos. Replaces apiThumbCacheDir as it's redundant. Also allows for customization of the default '/thumb/' path on local repos. 2008-09-03 15:47:42 +00:00
Chad Horohoe
df2eed2b61 Not setting various parameters no longer causes the ForeignAPIRepo to fail horribly. Thanks to Siebrand for pointing it out. 2008-07-31 22:06:54 +00:00
Chad Horohoe
41d44725c7 Allow local caching of thumbs from remote APIs. Still highly hackish and should only be used if you're on crack. 2008-07-24 17:14:43 +00:00
Chad Horohoe
b7ecf45444 Simplify configuration and make a better caching key. 2008-07-03 21:33:09 +00:00
Chad Horohoe
21a56a0782 Don't use $wgTranscludeCacheExpiry, as it's not designed for this. Make new configuration setting for $wgForeignFileRepos instead called 'localCacheExpiry'. 2008-07-03 18:37:31 +00:00
Chad Horohoe
c97318110c Refactor caching to utilize $wgMemc rather than the transcache table. Thanks to ialex and VasilievVV. :) 2008-07-03 18:24:08 +00:00
Chad Horohoe
5ddebb1b85 Cache foreign image descriptions in the transcache, saves an Http::get() on cache hit. 2008-07-03 07:49:35 +00:00
Bryan Tong Minh
57af2aecb5 * Use a proper factory for newFromRow
* Don't remove found files from the $titles parameter in findFiles
2008-05-30 13:16:08 +00:00
Aaron Schulz
e024e58dff * Remove cruft $time parameter from findFiles()
* Fucking document this fucking function
2008-05-22 15:44:46 +00:00
Alexandre Emsenhuber
087a9f70c5 WARNING: HUGE COMMIT
Doxygen documentation update:
* Changed alls @addtogroup to @ingroup. @addtogroup adds the comment to the group description, but doesn't add the file, class, function, ... to the group like @ingroup does. See for example http://svn.wikimedia.org/doc/group__SpecialPage.html where it's impossible to see related files, classes, ... that should belong to that group.
* Added @file to file description, it seems that it should be explicitely decalred for file descriptions, otherwise doxygen will think that the comment document the first class, variabled, function, ... that is in that file.
* Removed some empty comments
* Removed some ?>

Added following groups:
* ExternalStorage
* JobQueue
* MaintenanceLanguage

One more thing: there are still a lot of warnings when generating the doc.
2008-05-20 17:13:28 +00:00
Bryan Tong Minh
06c09e9835 Add RepoGroup::findFiles to efficiently find many files if the repo supports it. Added support for this in ApiQueryImageInfo. 2008-05-20 17:05:57 +00:00
Aaron Schulz
fe3ab4ade2 Add functions to get an image via sha-1 2008-05-20 02:58:40 +00:00
Bryan Tong Minh
5510874e98 * Introduce LocalFile::selectFields similarly to Revision::SelectFields
* Introduce FileRepo::findBySha1
* Show duplicates on ImagePage
2008-05-14 15:11:48 +00:00
Bryan Tong Minh
3611f529a8 * Move image page redirect checking to ImagePage. Should now also work on foreign repos.
* Changed File::getRedirected to return a DBkey instead of a formatted text
2008-05-08 20:55:13 +00:00
Bryan Tong Minh
581554c080 * Add new flag FIND_IGNORE_REDIRECT to wfFindFile and functions it depends on
* Follow redirects on image pages if the redirect is actually an image redirect
* Add comments to the check for redirect code in MediaWiki::initializeArticle so that I actually understand what it does
2008-05-08 20:15:09 +00:00
Tim Starling
3e8af533f1 Don't check for existence twice for non-existent files when no time is specified. 2008-05-07 03:39:35 +00:00
Siebrand Mazeland
79d5225c0e * remove end of line whitespace
* remove empty lines at end of file
* remove "?>" where still present
2008-04-14 07:45:50 +00:00
Victor Vasiliev
cfe2a5039b * Cache image redirects (and enable them) 2008-04-12 18:04:46 +00:00
Tim Starling
b8aebef25b * File redirects are slow: 2 queries per image per repository on parse. We previously found one query per image on parse to be prohibitively slow, that's why we introduced the image cache. Thus, reintroduced $wgFileRedirects.
* Fixed bug due to checkRedirect() not accepting a string title like findFile()
* Use protected instead of private. Private should not be used ever.
2008-04-06 10:18:47 +00:00
Aaron Schulz
a880e2ec58 Update doc 2008-04-05 15:38:08 +00:00
Brion Vibber
deb2045611 * (bug 12294) Namespace class renamed to MWNamespace for PHP 5.3 compatibility
* PHP 5.3 compatibility fix for wfRunHooks() called with no parameters

An autoloaded 'Namespace' class alias is retained for compatibility with
extensions which haven't updated to the new class name... however they too
will break on PHP 5.3. Yay!
2008-03-21 23:13:34 +00:00
Aaron Schulz
d089ca524f Slowly merge in a few rev_deleted checks 2008-03-09 03:10:28 +00:00
Aaron Schulz
89c41b1b63 A file should be at $time 2008-02-04 08:18:55 +00:00
Victor Vasiliev
f0d62da8a1 Image redirects:
* Forbid users who can't create redirects when they are not allowed to upload files
* Move target namespace check from checkRedirect() to findFile()
2008-01-20 07:05:59 +00:00
Victor Vasiliev
f1850a9238 * Support redirects in image namespace
Now doesn't require schema change
2008-01-16 18:27:43 +00:00
Brion Vibber
7c1170dcbf Revert for now r28986, 28987, 28992 - image redirects.
Would prefer to properly review how this works and how it interacts with current and future image behavior, rather than being surprised by it in the middle of ten other things being reviewed.
2007-12-31 20:26:53 +00:00
Victor Vasiliev
27c967825a * Proper redirect deletion
* Don't use ImagePage on redirects
2007-12-29 14:43:17 +00:00
Victor Vasiliev
625dcb58e3 * Support images-redirects
Note: this revision requires schema change
2007-12-29 09:32:22 +00:00
Brion Vibber
9be2c3676a Revert r26281 for the moment. Big patch, changes several existing practices. Will want some public testing and more review before taking it to trunk. 2007-10-01 19:50:25 +00:00
Aaron Schulz
4febfc77c2 *Clean up deletion of revisions and remove some gaps
*Allow blocking of users to hide names
*Implement revision deletion for images/deleted files/deleted revs
*Log deletion set off for now
*Add 'hidden' file dir
*Dissallow merging via undelete (which was inefficient and hard to reverse)
*Use restore points and diffs to special:undelete
*Add a special page to merge pages
*Get changeslist to use tables to avoid ugly formatting
*Add logs into RC for rebuildrecentchanges.php
*Add private logs
*List private logs at specialpages
*Tweak/add some deletion and merge messages
2007-10-01 19:38:28 +00:00
Tim Starling
ca76169bbe * Introduced FileRepoStatus -- result class for file repo operations.
* Ported file delete/restore to the filerepo framework. Some user-visible changes in error reporting. 
* $wgSaveDeletedFiles has been removed, the feature is now enabled unconditionally. Added a "deleted" directory for the default location, protected by a .htaccess file and the practical obscurity of content hashes.
* Fixed bug 2735: "Preview" shown in title bar for action=submit on special pages
* Removed "restore" links from the deletion log embedded in Special:Undelete
* Added img_sha1/oi_sha1 fields, preserved through upload, delete and restore
* Referenced the new oi_metadata etc. fields to preserve metadata across upload and delete/restore.
2007-07-22 14:45:12 +00:00
Aryeh Gregor
a15c419b3d Remove ?>'s from files. They're pointless, and just asking for people to mess with the files and add trailing whitespace. (Yes, I looked over every one and reverted those that were bogus. Slash-enter a million times in less worked well enough, although it was a bit mind-numbing.) 2007-06-29 01:19:14 +00:00
Tim Starling
85fa7504e6 * Split off ultimate base class FileRepo from FSRepo
* Use rawurlencode() for paths instead of urlencode()
* Moved functionality of LocalFile::loadFromFile() to a public static function. This allows Special:Upload to entirely avoid loading metadata from the (potentially remote) store. Changed purgeMetadataCache() to use loadFromDB() instead of loadFromFile().
* Redefined private virtual URLs, giving them a repo name component instead of a host.
* Moved is_writable($wgUploadDirectory) in SpecialUpload.php to the repo
* Added some filename validation to the FSRepo's store/publish
* Changed store and publish to use relative destinations instead of absolute, as was documented
* Deprecated File::recordUpload()! Now use upload() to do both publish and record. Moved the UI bits to SpecialUpload.
* Create a null revision on reupload
* Changed most of the member variable names in UploadForm. $this->mUpload followed by some ambiguous word or abbreviation was not a good naming convention. Also did some reformatting and assorted code cleanup.
2007-06-16 02:55:25 +00:00