aboutsummaryrefslogtreecommitdiffstats
path: root/includes/filerepo/FSRepo.php
Commit message (Collapse)AuthorAgeFilesLines
* In FileBackend/FileOp:Aaron Schulz2012-01-071-4/+5
| | | | | | | | | | | | | * Replaced 'media' portion of container names with the repo name. This makes it easy for multiple repos to use the same backend without 'wikiId' hacks. Full container names are now like <wiki>-<repo>-<zone> (or <repo>-<zone> if 'wikiId' is set to an empty string). * Restricted isValidContainerName() more in light of Azure portability and shorted shard suffix. * Bumped $maxCacheSize to 75 storage paths. * Code comment cleanups and additions. Unit tests: * Updated related tests and marked testBug29408() as broken (I can't find the problem). * Reduced leakage in UploadFromUrlTestSuite a bit. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/108300
* In LocalFile:Aaron Schulz2011-12-261-5/+0
| | | | | | | | | | | | | | | | | * Removed bogus rmdir() call. * Added lock() calls to upgradeRow()/getSha1(). * Use FileRepo getFileSha1() in getSha1() rather than via FSFile. * Made purgeThumbList()/migrateThumbFile() use FileRepo::cleanupBatch(). * A few other minor cleanups. * w/s cleanup in recordUpload2(). In FSRepo: * Removed deleted zone config code from constructor; useless since r107028. In FileBackend: * Make sure 'latest' param gets passed through via $params for some functions. * Cleaned up doMoveInternal() to use *_Internal() functions. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/107347
* FU r106752: use "media-" instead of "images-" in container names. Long live ↵Aaron Schulz2011-12-201-5/+5
| | | | | | | books, video, 3D meshes, and animated holograms from the future! Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/106894
* FU r106752: added b/c code to FSRepo to make things easy for extensions ↵Aaron Schulz2011-12-201-3/+41
| | | | | | | (like ConfirmAccount) Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/106834
* Merged FileBackend branch. Manually avoiding merging the many prop-only ↵Aaron Schulz2011-12-201-765/+3
| | | | | | | changes SVN likes to sprinkle in (easy to spot from the change list). Did not add SwiftFileBackend.php as it still is in development. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/106752
* add missing deprecation notices and added deprecation version to existing onesJeroen De Dauw2011-12-131-1/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/105985
* Use database to track uploaded chunks and concatenate at the end.Jan Gerber2011-11-301-1/+53
| | | | | | | | | | with i18n documentation dont break phpunit follow up r93720 Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/104687
* Revert r104659 and its followup r104665: break the unit tests with a fatal ↵Roan Kattouw2011-11-301-53/+1
| | | | | | | error. This cripples our CI system, we can't detect new failures this way. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/104680
* Use database to track uploaded chunks and concatenate at the end.Jan Gerber2011-11-301-1/+53
| | | | | | | | follow up r93720 Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/104659
* Kill various unused variablesSam Reed2011-10-291-1/+0
| | | | | | | | | Comment some out also Add some bits of documentation Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/101240
* StoreBatchTest counts even MORE correct than before.Russ Nelson2011-10-161-0/+2
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/100003
* Document return typesAaron Schulz2011-10-091-1/+16
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/99334
* Adding __METHOD__ to parameters passed to wfMkdirParents()Sam Reed2011-07-251-20/+20
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/93132
* Bunch of error suppression operator fixes (bug Chad Horohoe2011-07-061-4/+8
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/91609
* There is no getThumbRel;Russ Nelson2011-05-291-12/+12
| | | | | | | | | $wgLocalFileRepo needs to self-identify as local; the documentation and variable names for FileRepo->append() are correct, but they got positionally swapped at implementation time; and I am checking in a matching fix to Extension:ResumableUpload in a sec. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/89079
* And even more documentationSam Reed2011-05-281-0/+16
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/89062
* Space cadet\!Russ Nelson2011-05-231-1/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/88675
* Fill-in missing implementations of abstract function appendFinish()Russ Nelson2011-05-231-0/+3
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/88631
* missing closedir() and ... protected the readdir against opendir() failingRuss Nelson2011-03-301-2/+5
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/84996
* Fix and make file moving better resilient against errors by first copying ↵Bryan Tong Minh2011-03-041-8/+20
| | | | | | | | | | | | the files, then doing the db updates and finally cleaning up the source. * FsRepo::cleanupBatch now accepts either pairs, virtual urls and real paths * Add missing begin() and commit() to LocalFileMoveBatch * Actually set an error after incrementing failCount because otherwise the status is still good * Changed some isOk() to isGood() and set ->ok explicitly to false after rollback Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/83245
* Remove unused variablesSam Reed2011-02-181-1/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/82371
* (bug 19751) Filesystem is now checked during image undeletionBryan Tong Minh2011-02-041-1/+47
| | | | | | | | | | | | * FSRepo::storeBatch() now does an sha1 check unless SKIP_VALIDATION flag is set * Introduced Status::$success in addition to Status::$successcount ** FSRepo::storeBatch() now logs success/failure in this variable * LocalFileRestoreBatch now aborts on failure in FSRepo::storeBatch() and cleans up the already copied files ** Introduced FSRepo::cleanupBatch() for this purpose * SpecialUndelete now aborts if LocalFile::restore() gives a fatal Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/81536
* * added file description headersAlexandre Emsenhuber2010-09-041-0/+6
| | | | | | | * changed a @ingroup Media to FileRepo Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/72385
* Fixed some doxygen warningsAlexandre Emsenhuber2010-03-261-12/+12
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/64227
* follow up r62231, r61779, r62175Mark A. Hershberger2010-02-221-9/+19
| | | | | | | | | | | | | | | * Fix up messages * For new FileRepo::append(), use flags to determine whether to delete or not * Add more error checking for appending * Fix a couple of places in Revision.php and LogPage.php where DB errors were produced when comment was null * Remove bogus checking for !$comment, etc on the DONE phase of chunked uploading * Don't pretend to return a value when raising an exception * Add more tests for chunked uploads * Verify that Status::getErrorsArray() (at least where it is used in ApiUpload::execute()) returns an array that we can pass to dieUsageMessage() * Ensure that checkWarnings(), etc work only on the complete file Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/62806
* * new FauxResponse class to help with unit testingMark A. Hershberger2010-02-101-1/+28
| | | | | | | | | | | * Add append() method to FileRepo classes to enable chunked uploading * Change chunksessionkey to chunksession * Remove echo json stuff * Fix a multitude of bugs in my own code * still to test: mwEmbed use of chunked upload Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/62231
* Removed JS2 work (has been moved to the js2-work branch). Has been lightly ↵Tim Starling2009-11-261-27/+0
| | | | | | | | | | | | | | 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() Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/59446
* Move construction of $url and $thumbUrl up to FileRepo so ForeignApiRepo can ↵Chad Horohoe2009-10-091-4/+4
| | | | | | | use them. Also make no-op FileRepo::getZoneUrl() which always returns false. Also implement this in ForeignApiRepo and return public and thumb zones. Fixes bug 16832 Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/57555
* Comments and whitespace fixes only.Tim Starling2009-09-101-16/+18
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/56129
* * Added FSRepo configuration properties thumbUrl and thumbDir, to allow the ↵Tim Starling2009-07-161-0/+14
| | | | | | | | | | thumbnails to be stored in a separate location to the source images. Did this by making thumbnails a separate zone instead of a subdirectory of the public zone. Tested normal transform, thumb.php. * Removed getThumbRel(), doesn't make sense in conjunction with above options. Not used by core or hosted extensions. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/53369
* here it is ... the upload-api, script-server, js2 (javascript phase2) branch ↵Michael Dale2009-07-141-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | merge 1st attempt. Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview = Upload Improvements = ==Upload API == * Based on the early work of Bryan Tong and others it adds the upload option to the api. * We rewrite Special:Upload page to include use the new refactoring * Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions == Copy by URL== $wgAllowCopyUploads = false; * http class rewrite includes a new http background download see: includes/HttpFunctions.php * spins off a php process that calls: maintenance/http_session_download.php * pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time) == Firefogg == * Firefogg enables resumable upload by chunks * progress indicators and conditional invokation (js2 system) * and of-course client side transcoding. = Script Server = $wgEnableScriptLoader = false; * off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc. for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader * Includes some early skin js include fixes (skin/script system still lots of love) * Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html ) * The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php * One can use this auto class loading dependency system with extensions and add-ons but I need to better document that. = js2 system / mwEmbed= $wgEnableJS2system = false * includes initial rewrite towards more jquery based javascript code * especially for the Special:Upload page. * Also the edit page include support for the "add-media-wizard" * includes dependency loader for javascript that optionally takes advantage of the script-loader * remote embedding of javascript interfaces (like embedding video, or commons media searching) * $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output. = mwEmbed = * Will commit a separate patch to oggHandler that conditionally outputs <video tag> to use the new javascript video player. ** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins. * add-media-wizard adds easy inserts of media to pages (with import) == jQuery== * we include a base install of jQuery, jQuery ui and some plugins. * all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded. == other stuff == there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/53282
* Cleanup to r50310 & 50313: Don't use @ on chmod() and dl(), use ↵Chad Horohoe2009-05-191-3/+13
| | | | | | | wfSuppressWarnings()/wfRestoreWarnings() Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/50777
* Supress chmod() errors, they're annoying and very common. In all liklihood, ↵Chad Horohoe2009-05-071-4/+5
| | | | | | | the wiki can display the image with whatever permissions it was created to begin with. Also introduce the 'fileMode' parameter for $wgLocalFileRepo/$wgForeignFileRepos. Fixes bug 18326 Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/50313
* Fix a typo in the function nameVictor Vasiliev2009-03-291-2/+2
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/49021
* Improve image moving error handling:Victor Vasiliev2009-03-291-0/+27
| | | | | | | | | * Do image moving before page moving. That will allow to avoid situations when image page is moved, while image itself isn't. * Add safeguard code that checks all files before moving them * More debug logging Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/49001
* * Add a .htaccess to deleted images directory for additional protectionBrion Vibber2008-11-171-5/+16
| | | | | | | | | against exposure of deleted files with known SHA-1 hashes on default installations. Applying Tim's fixes Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/43625
* * Redo thumb caching and make it a part of the default /thumb/ structure ↵Chad Horohoe2008-11-081-9/+1
| | | | | | | | | with hashes as needed. * Move the generic getHashPath accessor up a level to the FileRepo. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/43316
* Revert r39608 "More descriptive sanitized paths for file repo errors"Brion Vibber2008-08-191-3/+3
| | | | | | | | This doesn't look like it'll work -- it appears to be using string interpolations in single-quoted strings? Can you test some error conditions w/ this and show some before and after examples? Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/39652
* More descriptive sanitized paths for file repo errorsFran Rogers2008-08-181-3/+3
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/39608
* * We no longer just give up on a missing upload base directory; it's nowBrion Vibber2008-06-101-0/+6
| | | | | | | | | created automatically if we have sufficient permissions! (Note that upload_directory_missing and upload_directory_read_only still have crappy output as they show a non-obvious internal path in the output.) Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/36162
* WARNING: HUGE COMMITAlexandre Emsenhuber2008-05-201-1/+1
| | | | | | | | | | | | | | | | | | 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. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/35098
* * remove end of line whitespaceSiebrand Mazeland2008-04-141-19/+17
| | | | | | | | * remove empty lines at end of file * remove "?>" where still present Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/33276
* put a @ on a chmod, since all other file ops in there are so marked.Brion Vibber2008-01-301-1/+1
| | | | | | | redundant chmods can bring warnings if we don't own the file (even though it's already world-writable) Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/30274
* Revert r29361 -- breaks upload, calls nonexistent functionsBrion Vibber2008-01-081-8/+3
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/29457
* Added RepoGroup::setSingleton(). Required to support the DumpHTML extension. Tim Starling2008-01-071-3/+8
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/29361
* Revert r26281 for the moment. Big patch, changes several existing practices. ↵Brion Vibber2007-10-011-9/+2
| | | | | | | Will want some public testing and more review before taking it to trunk. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/26283
* *Clean up deletion of revisions and remove some gapsAaron Schulz2007-10-011-2/+9
| | | | | | | | | | | | | | | | | | *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 Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/26281
* A message (fileexists) with the same name of another one was introduced in ↵Rotem Liss2007-07-291-2/+2
| | | | | | | r24313; renaming it to fileexistserror. Other messages files that updated since this revision may also have to rename the message. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/24424
* Seed subdirs in the deleted zone with a blank index.html file, to prevent ↵Tim Starling2007-07-231-5/+16
| | | | | | | crawling. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/24337
* * Introduced FileRepoStatus -- result class for file repo operations. Tim Starling2007-07-221-87/+293
| | | | | | | | | | | | * 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. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/24313