Commit graph

308 commits

Author SHA1 Message Date
jenkins-bot
ee1eb85b61 Merge "Add option to chose what language to fetch file description in." 2013-09-25 15:51:13 +00:00
Brian Wolff
bd7ebdec65 Add option to chose what language to fetch file description in.
I want to get the file description in a language other then
the user language in an extension (I5e6bc45f9751).

Change-Id: Ifcae821a51f4207e7816e710d3b3857c7ed438b6
2013-09-24 20:19:33 -03:00
Bryan Davis
176e012fe3 Guard against non-object returns from File::getHander()
MediaHandler::getHandler() can return false when a handler cannot be
determined for the given file's derived mime type. This change adds
guards to invocations that I could find that did not properly check for
this potential return result.

Bug: 53820
Change-Id: I8c0165311cc75f9920ac30ce2b38ccd207439198
2013-09-17 06:48:43 +00:00
Aaron Schulz
c312218534 Move slow deletion purges out of complex DB transactions
* This should help reduce deletion related deadlock errors

Change-Id: Ie7cafbf87ab0c71cc6c4c4fe1e53af364974a745
2013-08-21 13:22:05 -07:00
Bryan Davis
ede015209d Purge upstream caches when deleting file assets.
Inform upstream caches when a file asset is deleted by calling
SquidUpdate::purge(). This helps prevent unintentional information leakage in
the event that the asset is being deleted for reasons of license or content.

Bug: 51064
Change-Id: Ibf57e8f32d7dd04b8508a69706be5a40b49e5abd
2013-08-19 18:11:44 +00:00
Brian Wolff
5239b2db2d Don't purge thumbs for old versions of an image during ?action=purge
This tends to become extremely expensive as the number of
oldversions of a file increase. It is also not generally
needed since ?action=purge is usually targeting the
current version (additionally old versions of the file
have fixed urls, so they're less likely to get out
of sync). If an old version does need to be purged, one
can revdel and un-revdel it.

It should be noted that this extra purging was added
for bug 30192. However, since that bug was fixed,
most of the places requiring purging of old thumbnails
have now done it directly instead of by relying on
$file->purgeCache. The exception being revision
deletion, which still assumes $file->purgeCache clears
the thumbnails of old versions of the file.

There's no real bug for this, but I kind of hijacked
bug 49362

Change-Id: Ib399132cabe79fd2b4b23bad5708bfa50b282074
2013-07-09 23:13:07 +00:00
Brian Wolff
f8d0f0a780 Fix getPageDimensions failure handling
getPageDimensions returning false for failure wasn't being handled
properly, causing ugly output. The doc comment on that method was
wrong as well.

Most notably causing random whitespace output:
https://commons.wikimedia.org/wiki/?curid=22151015
(screenshot: http://i.imgur.com/c21EpVx.png).

Bug: 41281
Change-Id: I1a49474309e15808928f877dfc29ae366d028928
2013-06-27 00:02:30 +02:00
Brian Wolff
c25bf70238 Make rc_cur_id have proper value for upload log entries.
Primary motivation here is to make Special:Recentchangelinked work
correctly for uploads where the description page doesn't exist yet.
(Previously it was mostly only showing reupload log entries)

Mild downside to this approach is adding the recentchanges row is
now in a different commit...

Change-Id: I74c68b972c47c03066d3065e3748769a27a654fb
2013-06-17 21:35:47 -03:00
Brian Wolff
10d877dfe8 RefreshLinks on imagelinks on new uploads to kill tracking cat.
When someone uploads a new file, we should refresh all the pages
that use that image, so that [[Category:Pages with broken file links]]
gets removed.

Future fixme would to run this again on file deletes, but that's
less critical as they will eventually get added on next reparse
and people don't expect that to happen instantly like when fixing
the issue. Ditto for someone creating a new file redirect.

Bug: 46749
Change-Id: I7889598eee54a1c07c64f750b8499e922ba59704
2013-06-05 11:01:22 -03:00
Aaron Schulz
619a3f3b85 Fixed bug in LocalFile::isCacheable().
* The metadata field is actually defaulting to "" not null.

Change-Id: I745441c7061494db26de7f64dda30b80171c9443
2013-05-14 11:45:34 -07:00
Aaron Schulz
e42c4b82f5 Fixed LocalFile::isCacheable() to account for object type metadata.
Change-Id: I8104201c84ea008446df587650a098f6732b8d39
2013-05-14 11:06:35 -07:00
Brian Wolff
8c328d030f Add identifying info (img_timestamp and img_sha1) to upload log.
I came across people complaining that it was hard to associate
upload log events to actual images since img_timestamp could
be different from log_timestamp, and generally no unique id.

Well I was there I made uploads use the new logging system.

Change-Id: Icd8662ecb9eb0f6c0ff9841bdbd5736d6dd0d015
2013-05-10 21:10:49 +00:00
Aaron Schulz
042baf43bd Fix bug in OOM avoidance for RepoGroup cache.
Change-Id: Ic2e7fb6a9a7207315fd65454d883b84278efafc0
2013-04-23 17:22:30 -07:00
umherirrender
1bfc8feb25 Fixed spacing in actions/cache/filebackend/filerepo/job folder
Added spaces before if, foreach
Added some braces for one line statements

Change-Id: Idb93d34e314e5f314223b79208968d6bcd30c40e
2013-04-20 19:18:13 +02:00
umherirrender
15abcf71ca Added/Removed spaces around string concatenation
And added/removed spaces around some other tokens,
like +, -, *, /, <, >, =, !

Fixed windows newline style

Change-Id: I0b9c8c408f3f6bfc0d685a074d7ec468fb848fc8
2013-04-13 13:36:24 +02:00
umherirrender
978bb31c5e Add missing wfProfileOut before throwing an exception
Change-Id: I1d830da0597f19efd0b2ae48642389975e736e23
2013-04-08 18:37:24 +00:00
Alexandre Emsenhuber
df5265e14d Fix case of some Title methods
Change-Id: I37ce7fe392f4941c500fa0a88007664501d7e338
2013-03-27 14:36:05 +01:00
Tyler Anthony Romeo
4dcc7961df Fixed @param tags to conform with Doxygen format.
Doxygen expects parameter types to come before the
parameter name in @param tags. Used a quick regex
to switch everything around where possible. This
only fixes cases where a primitve variable (or a
primitive followed by other types) is the variable
type. Other cases will need to be fixed manually.

Change-Id: Ic59fd20856eb0489d70f3469a56ebce0efb3db13
2013-03-11 13:15:01 -04:00
Reedy
c3e4057e06 Kill off numerous unused variables
Change-Id: I7039f1328f37ee669b694f73ee282602186bffd1
2013-03-08 02:36:24 +00:00
umherirrender
d63121016d fix some spacing
Added/removed spaces around logical/arithmetic operator
Reduced multiple empty lines to one empty line
Removed wrong tabs before comments at end of line
Removed too many spaces in assigments

Change-Id: I2bba4e72f9b5f88c53324d7b70e6042f1aad8f6b
2013-03-07 17:53:21 +01:00
umherirrender
678f2da99d Pass user to File::recordUpload to avoid $wgUser
Moves the giving of a user one level up, because File::recordUpload2
already needs this (and fallback to $wgUser).
Can also use the user for the watching of the file, which was using
$wgUser before.

Change-Id: I697ae0df65b07ea59ab11b62804853cdc03cb172
2013-02-23 12:46:28 +00:00
Aaron Schulz
4c26684de5 [FileRepo] Changed LocalFile locking to avoid breaking transactions.
* Only BEGIN on lock() if no trx was in progress.
  Likewise, only COMMIT in unlock() if the lock() call started a trx.
* This can avoid problems with commiting page update transactions
  prematurely, which could leave broken page stub rows. (bug 40178)

Change-Id: I9a0adb25ee107df9a6bf70c6103ddfb7f034be25
2013-02-20 11:30:38 -08:00
Reedy
e028051140 Add a handful of missing @return
Change-Id: I21b218e6694600a2d2df4dd0a6b2b5cd2e10f1f9
2013-02-16 17:51:13 +01:00
IAlex
3f92a5672e Merge "remove space before semicolon" 2013-02-10 12:51:02 +00:00
umherirrender
f3cf109e62 remove space before semicolon
Change-Id: Ic0d890f5e27cec017c7f7910a67d53b2edf82079
2013-02-09 22:44:24 +01:00
umherirrender
180c74875b Add ArchivedFile::selectFields() and use it
Change-Id: Ia19d7bc1eb2bf77f1aca9d3891cebf57e45c030b
2013-02-09 15:59:13 +01:00
umherirrender
570dda0455 fix some spacing
Change-Id: I88e73d47a552918880514d88a876296a6cb80d88
2013-02-04 20:09:18 +00:00
Aaron Schulz
dcbdcf0781 [FileRepo] Lazy load large metadata from the DB.
* Previously, large values that could not fit into memcached would not be cached
  and the master DB would be hit for any file loading (djvu files hit this often).

Change-Id: I3ed8ad4a85d6e3084330b56c3b48ee76103bd2b8
2013-01-28 17:29:27 -08:00
Aaron Schulz
7cd5b25321 [FileRepo] Lowered negative caching duration.
Change-Id: I288ce2eef3cf547e254843c7f806925ee44391ca
2013-01-28 09:49:20 -08:00
umherirrender
7d2bf6aac1 Trim spaces on user supplied comments
This helps on bug 29575

Change-Id: Ic05e5898f8a7c93a95188c9342d22c70d7413b09
2013-01-20 14:08:38 +00:00
Jan Gerber
3aeed2d2dc Purge videos from squid on action=purge
While we don't want to re-encode videos on purge, they should still
be removed from squid; compute the list of all urls before extensions
can filter it to remove files that should not be deleted from the
file backend.

Change-Id: Id837843b5a203e49a8594439ce3620da9b3c7b6a
2012-12-06 11:58:14 -08:00
umherirrender
7cc01d56b2 Add some __METHOD__ to begin/commit/rollback calls
Change-Id: I20dad8d6bb7a523e8a6f50bc0af5cdba57d7160f
2012-12-01 15:04:10 +01:00
Platonides
84e1e6b5ae Removal of unused globals.
Change-Id: I870665d18f955a245222cfceca4665897277e7e4
2012-11-26 22:15:11 +01:00
Jan Gerber
8199d6121a Bug 42445: Fix file revert with local repo
reverting a file a virtual url is passed to upload without props,
get props from backend, virutal urls are not local files.

Change-Id: I1d56a6237e1d2af9941f29e4ba3f0262817b0e8d
2012-11-26 10:29:04 -08:00
Aaron Schulz
81ebc15b05 [FileRepo] [FileBackend] Added support for custom file headers.
* For backends that support it, custom HTTP headers can be set on files.
* Added a getStreamHeaders() function to MediaHandler to let subclasses
  recommend header name/value pairs to be used for responses to GET/HEAD
  requests. For example, an OGG handler could set "X-Content-Duration".
* Made LocalFile use this function to set HTTP headers of new uploads.

Change-Id: I1b017e1342513f0097fe6d142aae18e819403293
2012-11-20 14:07:02 -08:00
Aaron Schulz
9d58cb641c [FileRepo] Fixed purging for "short style" thumbnail names.
Change-Id: If63b4c609b7bc43cda658cb87abe59562b335c69
2012-10-29 11:09:43 -07:00
umherirrender
82375631c2 Fix tabs inside/between statements/text
This tabs are strange and a space there is better

Change-Id: I0885dff575ee2fcd0668d08fef3226e132c5b319
2012-10-26 18:18:59 +02:00
umherirrender
fb2c1c645b Add separate fa_sha1 field to filearchive table
This allows sha1 searches with the api in miser mode for deleted files

Added script to populate the rows
Adding new field to selects and handle it in all places, where needed

Using a 10 byte index for the new field per
http://lists.wikimedia.org/pipermail/wikitech-l/2012-September/063429.html

Change-Id: Ie54a513fe361202e63df44be44a0fdd91926c974
2012-10-14 20:58:25 +02:00
daniel
c546fae8ed merge latest master into Wikidata branch
Change-Id: Id4e0f40c03679c13d8934a6add99b5cd86d0437d
2012-10-08 13:58:54 +02:00
Max Semenik
f000f14555 Add 2 new options to importImages.php
--timestamp overrides upload timestamp
--summary sets upload summary

Change-Id: I930c8b1ce55af0543a41f412ecf702715c82c6df
2012-09-27 00:16:17 +04:00
daniel
12166f46b4 merged master (2012-09-11)
Change-Id: I8e953eaa22f9d331b0af5e780fbeff6d702b23e3
2012-09-11 11:43:02 +02:00
daniel
8322771ec3 Fix transaction nesting caused by LocalFile.
The transaction bracket in LocalFile::recordUpload2 used to span a call
to WikiPage::doEdit, which in turn opens a transaction. Nesting transactions
this way does not work: the first transaction is committed prematurely when
the second one starts. This may cause serious database corruption and
generally exciting behavior.

This change commits LocalFile's own transaction before any interaction
with WikiPage. There may be a race condition here, but that case seems to
be already handled in the code. Also, in the previous "broken" state, all
transactional protection got lost anyway - so this should at least be no
worse than what we had.

This may be changed back if and when we have support for nested
transactions.

Change-Id: I20d90fedb2d19c64ccf0f3942ddda756fe511c12
2012-09-07 14:33:35 -07:00
Aaron
e0718c496a Avoid redundant logging UPDATE query.
Change-Id: I277f311ea92ff3470039d9416e720573debba44a
2012-09-07 10:17:12 -07:00
daniel
b6fe213226 merge latest master.
some tests fail due to logical changes, will fix that in a follow-up

Change-Id: I8a5e4087ecf674fbcf6327c5d168cd401be12400
2012-09-05 17:50:13 +02:00
Platonides
ee39f5f7c5 (Bug 38606) Set log_page on uploads to the page_id of its description page
This change updates the log_page in a second step after performing
the edit, which is not terribly elegant, but is very robust.

Change-Id: I9015230df772d049b2879fb34914c68183f1da05
2012-08-29 23:23:27 +02:00
daniel
2c488a0eba Replace usage of doEdit() with doEditContent()
Change-Id: I2c423744bd91044c37bbec53b35729bd1c09901b
2012-08-28 16:53:19 +02:00
daniel
29719f846b merging latest master
Change-Id: I36b7f2f63ab8c08f8412d521dc68ea45c8b67711
2012-08-20 16:55:28 +02:00
Aaron
00c0319ed3 Profiling fix for LocalFile.
Change-Id: I02d770aee15e42b1046b06d405715cc046c9e7ca
2012-08-17 13:44:54 -07:00
Aaron Schulz
eb183bac87 Revision and WikiPage cleanup with IDBAccessObject interface.
* Replaced WikiPage::DATA_FROM_* constants with IDBAccessObject ones.
* Renamed IDBAccessObject constants a bit for visual consistency.
* Removed AVOID_MASTER parameter and replaced calling instances with READ_NORMAL.
  Instead of getting page_latest from the master and the revision from a
  slave, just get it all from the master in one RTT. Most callers used
  AVOID_MASTER (and now READ_NORMAL), so this case is barely hit anymore.

Change-Id: Ifbefdcd4490094b38e49bbb46c95fdb71b5c9e1a
2012-08-08 16:34:08 +00:00
daniel
d87135d706 merged master
Change-Id: Iad12ee382d6aeb1fab6fefb611d290b74865ea4b
2012-07-23 22:07:18 +02:00
Antoine Musso
bcf0010c51 prettify filerepo documentation
Change-Id: Ia84494c8c0c09a3d509975d63ab698e0a35c4631
2012-07-10 17:08:51 +02:00
Tim Starling
fcd74e5dd3 Merge "Reduced some master queries by adding flags to Revision functions." 2012-06-28 05:11:04 +00:00
Aaron
8288b34eae Reduced some master queries by adding flags to Revision functions.
* The main Revision functions now allow various QoS and locking flags.
* Added tiny DBAO interface add made Revision implement it.
  Since a lot of objects will need (or have) the same functionality.
* Use "self" keyword in Revision class consistently.
* Made Revisison::newFromConds() private.

Change-Id: I3139956999218a2bb44b5c845b8079e33b2328bb
2012-06-27 20:59:20 -07:00
daniel
e6d8681e73 render file description via ContentHandler 2012-06-08 09:42:04 +02:00
awjrichards
c29fd59775 Big oops - merged to wrong branch.
Revert "Revert to arbitrarily old point before initial remote branch creation to help clean up"

This reverts commit ee0d3d330f
2012-06-05 22:58:54 +00:00
awjrichards
ee0d3d330f Revert to arbitrarily old point before initial remote branch creation to help clean up
Change-Id: I41a3d1e55d3ea9dffa42451237fe065f9334361d
2012-06-02 08:43:04 -07:00
Catrope
7e6cd60977 Merge "[FileRepo] Fixed file move data-loss race condition." 2012-06-05 22:28:17 +00:00
Demon
1dc986a90f Merge "[FileRepo] Made getDescription() respect *_deleted fields." 2012-06-04 20:41:52 +00:00
Aaron Schulz
04804e67d5 [FileRepo] Fixed file move data-loss race condition.
* Update the DB before copying the files over.
  This fixes a serious regession from 395c5907ff.

Change-Id: Ibeec2cda839adecf28f4b944fa1cdb6e4eff7e3b
2012-06-03 01:49:35 -07:00
Aaron Schulz
4fa67221df Merge "$wgUseSquid unused since parent commit (fa1a8d5)" 2012-05-28 22:36:38 +00:00
Platonides
e73515b10c $wgUseSquid unused since parent commit (fa1a8d5)
Change-Id: I47e103e6c4bb44f74f9d940505775ac2f2e66b29
2012-05-28 19:32:18 +02:00
Aaron
9f6afeab0d [FileRepo] Made getDescription() respect *_deleted fields.
Change-Id: I1dd54611501d6747fb4ad6cbe6b58b0010b1d6d4
2012-05-25 16:00:49 -07:00
Aaron Schulz
b22063a6f9 When file sha1 populator fixes wrong values, make it fix the other metadata.
Change-Id: Ie03af8b97dc76d2ab4990108b9189693fcf81697
2012-05-23 12:04:29 -07:00
Aaron
826f82eacc [FileRepo] Avoiding useless purging for new uploads (not re-uploads).
Change-Id: If554c14c786cd5f743c4d8302660a8b1e5295393
2012-05-22 11:36:43 -07:00
Aaron
dfa7120f1b [FileRepo] Added more upload profiling.
Change-Id: Ib79306fde3470ccaa1f6822b894f1b61f16d772b
2012-05-18 17:56:53 -07:00
Aaron
d0facbf7b1 [FileRepo] Disabled ancient migration code, kills performance.
Change-Id: I6ed49f447dda3235e22edbbf837dad66c66d0764
2012-05-18 15:35:23 -07:00
Reedy
6885d1fd90 Parameter documentation stuffs
Change-Id: I2d9e800bf21d420fb26c130d0f271f6739c730a4
2012-05-11 00:09:58 +01:00
Aaron
b9ac85cbf3 [SiteStatsUpdate] Changing raw DB update calls to use SiteStatsUpdate.
* Made SiteStatsUpdate fields protected
* Added factory function for unretarded object construction
* Changed FileRepo code to use deferred stats updates like everything else

Change-Id: I93039104b14f0362509e37b6852604ffb0898dc7
2012-05-09 14:17:56 -07:00
Aaron
fa1a8d5119 [FileRepo] Purging/transaction fixes.
* Purge old version thumbnails on move
* Pushed purge operations outside of the DB transaction for move/delete

Change-Id: I260940149599eea814226d3c5b7092f4d6544a72
2012-05-08 17:29:39 -07:00
Brion VIBBER
364be04f3f Merge "[FileRepo] Locking and transaction fixes." 2012-05-08 20:21:44 +00:00
Alexandre Emsenhuber
d5381d0ea0 Added missing GPLv2 headers in some places.
Also made file/class documentation more consistent.

Change-Id: Iad15427368d13a6cc11c8512b7265e8c7b8878a5
2012-05-07 09:11:33 +02:00
Aaron Schulz
43aa35016b [FileRepo] Locking and transaction fixes.
* Make sure locks for file moves cover the whole operation.
* Pushed purging out of the move/delete/restore transactions.

Change-Id: I398c5627808fa79739f0dee632c4edf7416507c1
2012-05-06 23:28:07 -07:00
Aaron
ba1f104701 Split out quickCleanDir() function just for thumbnails for consistency.
Change-Id: I02f3eefc703016ac5681128de05ff09e716646d1
2012-04-25 10:47:59 -07:00
Aaron
6f7ee691ed Bug 34934: allow moving files with rows with bad oi_archive_name values.
Note that delete/restore already work in such cases.

Change-Id: I6b98b219b548203c4677f5be6f703585ac2cd027
2012-04-20 12:49:49 -07:00
Aaron
ffb1b38ad8 [FileRepo] Split out store/purge functions for thumbnails and made them skip file journals.
* Added quickImport()/quickPurge() functions to store and delete files as fast as possible.
* Also added a cleanDir() function to avoid having File directly use FileBackend functions.

Change-Id: I9a19862f1a720c5a464bd37f79b58a505c5961f9
2012-04-16 16:52:15 -07:00
Aaron Schulz
2d692b5844 Merge "Fix repo type of a LocalFile to be LocalRepo, which has a cleanupDeletedBatch which returns a value" 2012-04-07 23:34:41 +00:00
Reedy
9dfa34c827 Fix repo type of a LocalFile to be LocalRepo, which has a cleanupDeletedBatch which returns a value
Change-Id: Iaa4ba2da9aefbf0ca0eae4caa0eb75bf516a9369
2012-04-07 20:10:02 +01:00
Reedy
eec2278196 Fix duplicate array key of fa_deleted in LocalFile
Change-Id: I027f902d47616d896df8efba29d25457e4ac3e73
2012-04-07 17:11:19 +01:00
Aaron Schulz
5d585a423f [FileRepo] Added some cache code based on the problems in r97512.
* Made RepoGroup avoid caching files with large metadata and also reduced max cache size to 500 to avoid OOMs.
* Factored out a pingCache() function in RepoGroup.

Change-Id: I52f6413b9eb8b11fbffbde0f0e7acf97c7a2ff89
2012-04-06 12:39:58 -07:00
Aaron Schulz
c8e1463cc0 [FileRepo] Various code cleanups.
* Made File::isHashed() wrap FileRepo::getHashLevels(). Removed now-used FileRepo::isHashed().
* Removed FileRepo::simpleClean(). Not useful anymore since the paths in Status errors don't have $IP or upload dirs anymore.
* Removed code in FileRepo::fileExistsBatch() and FileRepo::cleanupBatch() to handle FS file paths, which should never be passed in anymore. Likewise, removed FILES_ONLY parameter.
* Removed FileRepo::append()/appendFinish() stub functions.
* Added FileRepo::assertWritableRepo() function to better handle repos that are read-only by design rather than the hack of overwriting each function (several were missed).
* Added FileBackend::isPathTraversalFree() function and used it in FileRepo::validateFilename() to avoid duplication.
* Tweaked FileRepo::freeTemp() to avoid file locking and made FileRepo::cleanupBatch() return a Status.
* Moved FileRepo::cleanupDeletedBatch() near FileRepo::deleteBatch().
* Added type hinting to a few places.
* Tweaked some misleading doc comments and added function visibility markers.

Change 1:
* Simplified NullRepo to also use assertWritableRepo(). It is currently only used by a single unit test.

Change-Id: I1cd0f4971011772e38e5156f94ffc50325372f28
2012-04-05 12:48:47 -07:00
Aaron Schulz
2330bd514a [FileRepo]
* Added getReadOnlyReason() function to FileRepo to check read-only status. Added such checks to the File object functions that mutate files in storage. This should make read-only mode more tolerable (which is needed at least briefly when switching backends).
* Added lock()/unlock() calls to File restore() function.
* Use proper isOK() accessor for Status objects.

Change-Id: I7368912b01f7fd1ec34125d12c0844388cbb3b2d
2012-03-23 12:23:01 -07:00
Roan Kattouw
0fca9a7991 Revert r107309, r113601, r113704, r113742, r113792, r113838, r113859, r113893, r113894, r113952, r114047, r114252, r114256, r114257. This reverts the remaining 'new' revisions in core.
All of these revisions are tagged with 'gerritmigration' and will be resubmitted into Gerrit after the Gerrit switchover. See also http://lists.wikimedia.org/pipermail/wikitech-l/2012-March/059124.html
2012-03-21 00:16:50 +00:00
Aaron Schulz
7770391b30 [FileRepo] Added long-since missing FOR UPDATE to LocalFile::lock(). This might help with the weird mismatched metadata for files with two uploads at the same time that I keep seeing in the DB. 2012-03-20 00:57:18 +00:00
Aaron Schulz
9b02dc95fa [FileRepo]
* Added getReadOnlyReason() function to FileRepo to check read-only status. Added such checks to the File object functions that mutate files in storage. This should make read-only mode more tolerable (which is needed at least briefly when switching backends).
* Added lock()/unlock() calls to File restore() function.
* Use proper isOK() accessor for Status objects.
2012-03-14 21:30:26 +00:00
Sam Reed
b18ea7dee2 Normalise casing of getArticleID used in core 2012-03-11 18:54:55 +00:00
Aaron Schulz
286abc08bd Disable file locking for thumbnail purging just as it already is with creation/updates (for performance). 2012-03-09 01:18:32 +00:00
Tim Starling
86ec766e19 Fix for r113312: explain the bug without the use of commented-out code 2012-03-07 23:00:42 +00:00
Aaron Schulz
cb93e4c51d [FileRepo]
* Made upload() explicitly check $status->successCount rather than isOk() as FileRepo::publish() gives fatal statuses where it used to only give warnings. This way, failed uploads still displace the current image DB row to oldimage rather than do nothing and have the same image row point to a new file (which can cause mismatched metadata).
* Disabled exception about invalid oi_archive_name. This makes things more broken in that when people get this an error on upload (which happens when the FS has no current file but the DB does), the new file is added as the current version in the FS but the DB is unchanged. Thus, the metadata can be mismatched.
2012-03-07 22:46:47 +00:00
Sam Reed
c47f83a4d4 More __METHOD__ in our madness 2012-02-24 18:45:24 +00:00
Antoine Musso
73247df204 Remove backslash from @return types
Ping r111103
2012-02-13 16:35:59 +00:00
Sam Reed
c052fc3b7b Documentation followups from lastnight 2012-02-10 15:37:33 +00:00
Sam Reed
76246b9bf5 More return documentation 2012-02-09 21:33:27 +00:00
Sam Reed
7b25f8231f Fixing some of the "@return true" or "@return false", need to be "@return bool" and then the metadata can say true if foo, false if bar
Other documentation improvements
2012-02-09 19:30:01 +00:00
Sam Reed
e1d83d5721 Fixing some of the "@return true" or "@return false", need to be "@return bool" and then the metadata can say true if foo, false if bar
Other documentation improvements
2012-02-09 18:01:54 +00:00
Antoine Musso
394c8b5234 enhance filerepo doc structure 2012-02-08 15:51:16 +00:00
Alexandre Emsenhuber
f0faee8ae9 Pass the user doing the upload to WikiPage::doEdit() 2011-12-27 15:15:38 +00:00
Aaron Schulz
aa3befb2e0 In LocalFile:
* 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.
2011-12-26 23:35:40 +00:00
Aaron Schulz
b9efeb2cbc FU r106752: fixed call to bogus function in LocalFile::getSha1() 2011-12-24 00:19:01 +00:00
Aaron Schulz
14863b9aa5 Cleaned up some references to FSRepo in code and comments. This should have no noticeable functional changes. 2011-12-20 19:25:23 +00:00
Brian Wolff
34791773f8 follow-up r98710/r104410. I personally think that forRefresh is confusing, since a purge is always in essence a "refresh"ing operation. change it to forThumbRefresh. 2011-12-20 06:48:05 +00:00
Aaron Schulz
5275f9b097 Merged FileBackend branch. Manually avoiding merging the many prop-only changes SVN likes to sprinkle in (easy to spot from the change list). Did not add SwiftFileBackend.php as it still is in development. 2011-12-20 03:52:06 +00:00
Antoine Musso
c0dd74a16f purgeThumbList debug message is now a oneliner 2011-12-08 12:51:53 +00:00
Roan Kattouw
cfab36dd59 Revert r105140 temporarily. The exception is thrown while running the parser tests (at least from Jenkins, haven't tried locally), which completely breaks the test suite and renders Jenkins useless. Feel free to reapply once the cause of the oi_archive_name bug is fixed and committing this won't cause exceptions to be thrown in Jenkins's face. 2011-12-05 07:03:21 +00:00
Aaron Schulz
6cc931502f Added file old version name sanity check to recordUpload2() 2011-12-04 23:34:24 +00:00
Aaron Schulz
330758c5bc Fix r104410: Added default value for $options to purgeThumbnails(), not sure how this was lost in the patch 2011-11-28 09:03:39 +00:00
Aaron Schulz
88f9a3016c FU r104410: don't even bother calling filterThumbnailPurgeList() if 'forRefresh' isn't set to be safe 2011-11-28 08:57:46 +00:00
Aaron Schulz
b9fe0b2fbf Restored r98710 but with a 'forRefresh' option (not used yet) 2011-11-28 08:53:03 +00:00
Aaron Schulz
ef75030835 Moved File classes to filerepo/file (as well as ArchivedFile) 2011-11-16 22:55:48 +00:00
Renamed from includes/filerepo/LocalFile.php (Browse further)