Commit graph

58 commits

Author SHA1 Message Date
Aaron Schulz
ae54dbbb3d *The function is User::getID() not getId() 2008-05-22 14:57:07 +00:00
Aaron Schulz
9717cebd88 *Redo newRevisionFromEditComplete hook. Pass an Article instead of a title
*Use prepareTextForEdit() to avoid double parsing
*Parser cache will be saved again later, so need to do it twice in a row
2008-05-22 01:03:45 +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
Aaron Schulz
fe3ab4ade2 Add functions to get an image via sha-1 2008-05-20 02:58:40 +00:00
Aaron Schulz
7c2c02953c * Add higher level newRevisionFromEditComplete hook
* Use this hook for autoreviewing. Merge to one function again.
* Remove template ID query for $usestabletemplates, not needed
* Improve includes change diff if $usestabletemplates is on
2008-05-17 17:53:46 +00:00
Brion Vibber
beedd5c5f3 Revert r34906, r34907, r34928 -- mixing high-level data into low-level storage functions for the sole purpose of passing it off to hooks, which seems very icky to me. It feels like a hook in the wrong place is being used. 2008-05-17 15:53:58 +00:00
Aaron Schulz
3418add517 Let getThumbnails() work for non-hashed dirs (bug 13788) 2008-05-16 20:21:20 +00:00
Aaron Schulz
493d8451b8 Decrappify edit check for revision hook 2008-05-16 03:17:05 +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
Victor Vasiliev
50a581996a * Fix image redirect caching so it doesn't break image redirects on shared repositories 2008-05-10 19:22:14 +00:00
Bryan Tong Minh
05abc57838 Also move the old files to the new hash path. 2008-05-07 15:09:25 +00:00
Bryan Tong Minh
ca4ebe3f7b * Don't move thumbnails as they are purged anyway
* Force regeneration of the hash path
* Only switch titles if the move actually succeeded
2008-05-07 15:03:18 +00:00
Aaron Schulz
2f3a769ea8 Leave deleted images alone 2008-05-03 15:16:22 +00:00
Victor Vasiliev
e3371526ab * Fix oi_deleted issues with image moving
* Fix filearchive update status check
2008-05-03 14:45:06 +00:00
Victor Vasiliev
8d85629c58 * (bug 709) Cannot rename/move images and other media files.
Currently in experimental mode, use $wgAllowImageMoving to enable it.
Known issues:
* Doesn't work with rev_deleted
* May also have some security and caching issues.
2008-05-03 13:09:34 +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
ffe44db3e3 * Invalidate cache of pages that includes images via redirects on upload 2008-04-12 18:06:57 +00:00
Alexandre Emsenhuber
dd3136f423 Ugly hack to fix two strict standarts errors:
* Declaration of Image::newFromTitle() should be compatible with that of LocalFile::newFromTitle() : Moved Image class to Image.php, will only be loaded when an old extension need it.
* Declaration of OldLocalFile::newFromTitle() should be compatible with that of LocalFile::newFromTitle() : Added an unsed param to LocalFile::newFromTitle() with a null default value, also added the null default value to OldLocalFile::newFromTitle() but that function will throw an Exception if that value isn't modified (even if these functions should not be called by extensions).

Pass $suffix parameter to File::getArchiveRel() in File::getArchivePath()
2008-04-05 12:26:10 +00:00
Alexandre Emsenhuber
32479f609b Fix call to deprecated functions 2008-03-20 22:00:59 +00:00
Aaron Schulz
86d2975346 File should still count as existing if hidden 2008-03-17 19:57:31 +00:00
Aaron Schulz
85d87cfeac Remove unused variables 2008-03-15 08:48:21 +00:00
Aaron Schulz
1f60b024de More rev_deleted merging
*Add suppress option to file delete form. Sprinkle in argument where needed.
*Restrict content at sp:undelete
*FileRepo can deal with images in the 'deleted' FS group (corresponds to a setting of oi_deleted)
2008-03-15 00:27:57 +00:00
Greg Sabino Mullane
1482463541 Delete from oldimage, then image, to account for possible foreign keys. Bug 12520. ISAKA Yoji. 2008-02-10 16:59:44 +00:00
Brion Vibber
ed1b071355 Not escaping strings makes me queasy, even if we're *pretty* sure that database timestamps will always format to a safe value!
Wrap an addQuotes around those timestamp calls...
2008-02-04 22:37:33 +00:00
Roan Kattouw
0d5b7c3a1d (bug 12875) Adding query-continue to prop=imageinfo. Patch by Bryan Tongh Minh. 2008-02-03 19:03:01 +00:00
Victor Vasiliev
e815faefe8 Fix timestamps for recently uploaded files 2008-01-30 18:44:15 +00:00
Brion Vibber
c5c6737818 Applying live hacks from Wikimedia code base:
* Clarify profiling results for local and remote repo lookups
* Use master database for critical lookups
* Don't upgrade db rows when in read-only mode
2008-01-29 01:14:50 +00:00
Victor Vasiliev
55cfccceb7 * Fix image caching 2008-01-20 12:48:39 +00:00
Roan Kattouw
b444ed71d3 FileRepo: LocalFile::getUser() should load data 2008-01-20 12:17:43 +00:00
Victor Vasiliev
583e6ff8a1 Gotta die today...
* Fix image uploading with image redirects enabled
* Escape titles
2008-01-20 12:13:34 +00:00
Victor Vasiliev
d7a2058e15 Introduced File::getHistory(), which should be used instead of ugly nextHistoryLine() which is now deprecated 2008-01-20 06:48:57 +00:00
Tim Starling
b387c52fda dataLoaded also needs to be set for negative cache hits. 2007-11-19 10:22:29 +00:00
Tim Starling
792e9e6a10 Use setProps() to set properties in LocalFile::loadFromCache(), instead of DIY property-setting. I must have forgotten to do this when I introduced setProps(), the result was a bug (hereby fixed) causing zero cache-hit ratio for the image cache. 2007-11-19 10:04:18 +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
Greg Sabino Mullane
0ab8c7e910 Make CONCAT calls database portable, change IF() to standard CASE-WHEN calls.
Postgres: replace CHAR(64) with TEXT for fa_storage_key of filearchive
Postgres: Add hasConstraint to allow replacing of oldimage fk constraint
Postgres: make oldimage cascade delete on image deletion
2007-09-23 22:23:01 +00:00
Brion Vibber
a3eef256af Fix for restore of image data where oldimage rows hadn't contained the various new metadata fields.
When missing on restore, metadata is re-fetched from the file and inserted into the new record in place of the empty fields.
2007-08-25 20:18:56 +00:00
Aaron Schulz
213a7d1ded *oi_metadata can't be null. Some fa_metadata values are NULL since there was not always an oi_metadata to use for insertion. 2007-08-25 19:22:51 +00:00
Tim Starling
6997632877 Update img_sha1 only when it's really needed, instead of in maybeUpgradeRow(). 2007-08-25 13:54:12 +00:00
Tim Starling
f2b5bd435d Fixed typo in LocalFileDeleteBatch::execute() which was causing complete breakage when squid was enabled. 2007-08-22 16:32:10 +00:00
Nick Jenkins
786e93fb37 Static code analysis housekeeping time... things that could be double-checked are marked with "[Note: some-comment]" :
if-if-else without curly braces [api/ApiQuerySiteinfo.php] --> adding
Unused global declaration:  $wgGroupPermissions --> removing 
Unused global declaration:  $wgEmailConfirmToEdit (line 301) --> removing 
Variable $id appears only once (line 1021)  --> removing 
Variable $m was used before it was defined (line 805) --> defining.
Variable $retval was used before it was defined (line 2346) --> renaming to $result
Variable $rcid appears only once (line 244 of RecentChange.php)  --> using this instead of $change [Note: was left over from r24607 refactoring, revert if wrong please]
Unused global declaration:  $wgCommandLineMode (line 11) --> removing
Variable $k appears only once (line 132 of ImagePage.php) --> removing.
Variable $info appears only once (line 311 of ImagePage.php)  --> removing.
Unused global declaration:  $wgTitle (line 569 of ImagePage.php) -> removing.
Variable $handlerParams was used before it was defined (line 616 of Linker.php) --> resolved by Raymond in r24966
Variable $match was used before it was defined (line 1031 of Linker.php) --> defining.
Unused global declaration:  $wgEnotifWatchlist (line 253 of UserMailer.php) --> removing 
Unused global declaration:  $wgShowUpdatedMarker (line 253 of UserMailer.php) --> removing 
Variable $img appears only once (line 446 of SpecialUpload.php) --> added definition, defined as null, flagged with @todo  [Note: should $img be defined in this context, or is it intended to be null? And should the return value after the hook be checked in some way?]
Unused global declaration:  $wgEnableAPI (line 739 of SpecialUpload.php) --> removing.
Unused global declaration:  $wgNamespaceProtection (line 1030 of OutputPage.php) --> removing.
Unused global declaration:  $wgContLang (line 18 of SpecialWatchlist.php) --> removing.
Unused global declaration:  $wgRawHtml (line 269 of SpecialMovepage.php) --> removing.
The value of variable $page was never used (line 331 of SpecialUndelete.php) --> removing line, as $page gets redefined a few lines down.
Variable $synIndex appears only once (line 521 of MagicWord.php) --> commenting out.
Variable $case appears only once (line 539 of MagicWord.php) --> removing from foreach index key usage.
Variable $wgUser appears only once (line 1039 of Title.php) --> adding line to declare as a global, would be null otherwise.
Variable $m was used before it was defined (line 285 of Title.php) --> defining.
Variable $id appears only once (line 1150 of Title.php) --> removing from foreach index key usage.
Variable $subpage appears only once (line 1297 of Title.php) --> commenting out.
Variable $restrictions appears only once (line 1399 of Title.php) --> commenting out.
Variable $mime appears only once (line 210 of filerepo/OldLocalFile.php) --> removing.
Variable $deprefixedName appears only once (line 213 of filerepo/LocalFile.php) --> removing.
Variable $m appears only once (line 541 of filerepo/LocalFile.php) --> removing.
Variable $where appears only once (line 1245 of filerepo/LocalFile.php) --> removing.
Variable $info appears only once (line 1427 of filerepo/LocalFile.php) --> removing.
Variable $rel appears only once (line 138 of filerepo/RepoGroup.php) --> commenting out.
Variable $zone appears only once (line 138 of filerepo/RepoGroup.php) --> commenting out.
Variable $nbytes appears only once (line 208 of media/Generic.php) --> added a return line that uses $nbytes. [Note: I'm assuming that this was the intent]
Variable $offset appears only once (line 201 of SpecialListusers.php) --> removing.
Variable $limit appears only once (line 201 of SpecialListusers.php) --> removing.
Variable $groupTarget appears only once (line 203 of SpecialListusers.php) --> removing.
Unused global declaration:  $wgLang (line 74 of SpecialWantedpages.php) --> removing.
Variable $block appears only once (line 244 of SpecialProtectedpages.php) --> removing.
Variable $offset appears only once (line 281 of SpecialProtectedpages.php) --> removing.
Variable $limit appears only once (line 281 of SpecialProtectedpages.php) --> removing.
Unused global declaration:  $wgLang (line 30 of FileDeleteForm.php) --> removing.
Unused global declaration:  $wgServer (line 30 of FileDeleteForm.php) --> removing.
2007-08-21 03:57:54 +00:00
Aaron Schulz
39495794ca *Update page on null revisions made for uploads 2007-08-19 16:34:45 +00:00
Rob Church
a4f87744d1 (bug 10937) Distinguish overwritten files in upload log; use the upload/overwrite action for these 2007-08-15 19:52:28 +00:00
Tim Starling
164bb322f2 Basic integrated audio/video support, with Ogg implementation.
* JavaScript video player based loosely on Greg Maxwell's player
* Image page text snippet customisation
* Abstraction of transform parameters in the parser. Introduced Linker::makeImageLink2().
* Made canRender(), mustRender() depend on file, not just on handler. Moved width=0, height=0 checking to ImageHandler::canRender(), since audio streams have width=height=0 but should be rendered.

Also:
* Automatic upgrade for oldimage rows on image page view, allows media handler selection based on oi_*_mime
* oi_*_mime unconditionally referenced, REQUIRES SCHEMA UPGRADE
* Don't destroy file info for missing files on upgrade
* Simple, centralised extension message file handling
* Made MessageCache::loadAllMessages non-static, optimised for repeated-call case due to abuse in User.php
* Support for lightweight parser output hooks, with callback whitelist for security
* Moved Linker::formatSize() to Language, to join the new formatTimePeriod() and formatBitrate()
* Introduced MagicWordArray, regex capture trick requires that magic word IDs DO NOT CONTAIN HYPHENS.
2007-08-15 10:50:09 +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
Yuri Astrakhan
a863e2bee3 filerepo: fixed mem leak for history lines and exposed repository name 2007-07-07 03:04:20 +00:00
Tim Starling
d0ccdd9203 Restore MW 1.4 behaviour for Special:Upload -- redirect to description page on new upload, show success on reupload. 2007-06-29 08:56:30 +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
Aryeh Gregor
ce84509f0b E_STRICT fixes for filerepo stuff. Also, use 'abstract' keyword for File class, and mark some public methods public (and one private method protected, which I think is what was meant but no harm if private was actually meant). Couldn't fix the non-matching declarations of Image::newFromTitle() and LocalFile::newFromTitle(). 2007-06-24 06:32:07 +00:00
Brion Vibber
9c7d392c56 Fix regression introduced in r23023; use the right function name when calling to load file properties :) 2007-06-19 15:11:20 +00:00