Commit graph

22 commits

Author SHA1 Message Date
Aaron Schulz
754b8babca filebackend: throw exceptions during file iteration.
* This lets calling code be far more robust rather than just
  silently ignoring entries due to some temporary problem.

Change-Id: I3ce2ae34f6cff5e40a80b8da5688503a387ce2a6
2013-06-15 23:01:47 -07:00
Aaron Schulz
7242d938f3 Cleaned up variable/type order in docs.
* A few other minor doc cleanups and obvious type hints.

Change-Id: I454fad0c1942068b4f3632ebd1b605bfbb9dfe7c
2013-06-13 11:18:52 -07:00
Aaron Schulz
a379dbf9db Removed redundant documentation for some methods.
Change-Id: Iad422716f6796cc4b69405182f4a74daa0c93663
2013-06-12 19:58:15 +00:00
Jakub Vrana
2696437506 Fix visibility of error handlers
I've hit this error when $wgDBuser didn't have access to $wgDBname.
I've also checked all other error handlers in core.

An alternative approach would be to use an anonymous function but it doesn't support $this until PHP 5.4 so it would be messier.

Change-Id: I89db2e8c88b84d9b53c4b828ac0208b05a3d3783
2013-05-04 10:10:06 -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
ASchulz
c328cf6401 [FileBackend] Cleanup behavior for coping/moving a file over itself.
* Previously, for doQuickOperations(), the default move function
  would just delete the file if it was moved over itself. In fact,
  the php-cloudfiles bindings have this same bug in its move function.
* For both copy and move, when the source and destination are the
  same path, make sure that the headers get updated as specified.
  This only applies for the 'overwrite' case (not 'overwriteSame').
* Fixed bad status for doQuickOperations() when copying a file over
  itself using FSFileBackend.
* Clarified the documentation for 'overwriteSame' option.
* Renamed destSameAsSource to overwriteSameCase in FileOp for clarity.

Change-Id: I3f609d9413795c654de27958b1e807b1fc785f31
2013-03-25 17:06:30 -07: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
MarkAHershberger
e4ff0c7567 Bug 44157 - The return value of realpath should be tested
Change-Id: Id178ee2fa5e294e858ee2af188e02c67f3205da9
2013-01-31 04:53:22 +00:00
Aaron Schulz
81d0f396b5 [FileBackend] Suppress most file warnings but log them to an FSFileBackend log.
* Also removed a few returns that are not really useful.

Change-Id: I329ff4ffd52675f6a36e48a95d103d850a61fe7a
2012-12-31 11:17:28 -08:00
Reedy
bfbabaab02 Suppress warnings around copy call
Attempt to shut some noise in production logs

Change-Id: I4bac4027d82e4194b6ec46658d52f49038db573c
Warning:  copy(/mnt/thumbs2/wikipedia/commons/thumb/8/8c/Map_of_USA_AK_full.png/120px-Map_of_USA_AK_full.png) [<a href='function.copy'>function.copy</a>]: failed to open stream: No such file or directory in /usr/local/apache/common-local/php-1.21wmf6/includes/filebackend/FSFileBackend.php on line 254
2012-12-22 18:25:34 +00:00
Reedy
faf7d6b7d9 Suppress warnings around unlink call
Attempt to shut a lot of noise in production logs

e.g.
1 Warning:  unlink(/mnt/thumbs2/wikipedia/commons/thumb/f/f2/Members_only_jacket.jpg/800px-Members_only_jacket.jpg) [<a href='function.unlink'>function.unlink</a>]: No such file or directory in /usr/lo
cal/apache/common-local/php-1.21wmf6/includes/filebackend/FSFileBackend.php on line 422

Change-Id: I9e1407c4b11301f468f8e291105955ade9a731d0
2012-12-17 20:27:05 +00:00
Aaron Schulz
3e2bb97cc7 Moved "create" function definitions before "store" for consistency.
Change-Id: Ic44470d7a178cb8dcd8f6a9343f961c26fb92988
2012-11-15 09:22:43 +00:00
Aaron Schulz
84f94fdfd2 [FileBackend] Avoid some stat calls in various operations.
* copy() and rename() will overwrite any destination, including on Windows.
  Tested with Windows 7, and even rename() does this. The /Y flag is also
  set for Windows cmd commands now.
* Set the "binary mode" /B flag for Windows cmd commands.

Change-Id: Id11f31b020f786d5b66b0c57298ecc2b9d6170fb
2012-11-08 06:35:05 +00:00
Aaron Schulz
24a6e8eab6 [FileBackend] Support "ignoreMissingSource" for copy and move operations.
* This lets callers use "copy if exist" semantics more easily and avoids extra stat
  queries to the backend (since the cache is cleared before doOperations()).
* Tweaked FileOp::fileSha1() to reduce backend stat requests as 404s are not cached.

Change-Id: Icb5ca14b3316f273d53593f48979d14e113990e1
2012-10-31 04:24:05 +00:00
Aaron Schulz
9fd48446a1 [FileBackend] Simplified code for handling "overwrite" parameter.
* Since doQuickOperations() implicitely sets "overwrite", and doOperations() handles it
  via FileOp, there is no reason to also have each backend double checking this parameter
  to handle it. The parameter is no implicit for all the *Internal() functions. This does
  not affect callers. It does reduce the amount of HEAD requests since 404s are not cached.

Change-Id: I7d827e16bc55fe5c7b9aa51ec0c6b2f7c0bb629e
2012-10-29 17:13:02 -07:00
Aaron Schulz
8a423dc44e [FileBackend] Added more tests and fixed some local copy/reference bugs.
Change-Id: I21f635174310a1ce406483b546ae98dec218e5ba
2012-10-17 13:15:41 -07:00
Aaron
ae65453e84 [FileBackend] Added getLocalCopyMulti() and getLocalReferenceMulti().
* Optimized these in Swift to use pipelined GETs.
* This can also be used to improve concatenate().

Change-Id: Ibeb5df7532f9f5c16736b20c28b7c0d9ddfb412f
2012-09-21 21:10:54 -07:00
Aaron Schulz
e74ba4b4fd [FileBackend] Made getLocalCopy() handle long file names better.
Change-Id: I54d7c610dba8cb3e7bc0ef4d4bfbb2327e63db07
2012-08-29 22:06:16 -07:00
Aaron
dcec58e09b [FileBackend] Allow enforcing POSIX file owner names.
Change-Id: I9c703bc497f5d6983ef812d105357877c154e17b
2012-08-20 13:03:50 -07:00
Aaron Schulz
a47892abef [FileBackend] Moved filerepo/backend/ up to filebackend
Change-Id: I62ba23bd22e0f177fb48acaf6bcc38cbffacd3e7
2012-08-08 18:20:57 -07:00
Renamed from includes/filerepo/backend/FSFileBackend.php (Browse further)