Commit graph

56 commits

Author SHA1 Message Date
Reedy
08e84030d3 Replace php_sapi_name() with PHP_SAPI
Change-Id: I222789cacaa2653c4dac62708ce228674c90af4c
2013-10-25 13:57:26 +01:00
Aaron Schulz
ef2f2610ab filebackend: try to combine SH and EX lock acquisition
* getPathsToLockForOpsInternal() now returns an array in the format LockManager can use
* Also fixed getScopedLocksForOps() for multiwrite backend (it should accept proxy backend paths)
* Updated getScopedFileLocks() docs

Change-Id: Id0dc50c159c5fbc8fca10a9e46c5be23afcb3e9a
2013-10-18 22:57:38 +00:00
Aaron Schulz
5749bd7352 filebackend: normalize paths used in locking
Change-Id: I0d823e4d20c89a22ad89a6af8739075f7a10c235
2013-07-06 15:06:38 -07:00
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
b14212992d [FileBackend] Moved short-circuit check from 6b1194b9 up to FileBackend.
Change-Id: I57566a1779f353c18d96c59c47112c753aea6b90
2013-05-10 13:55:39 -07:00
Aaron Schulz
d1940caa1f [FileBackend] Added "adviseStat" option for the "listing followed by stat" case.
* Used this parameter to speed up copyFileBackend.php.
* Also added mtime checks to copyFileBackend.php and a few cleanups.
* Also fixed some incorrect getDirListPageInternal/getFileListPageInternal docs.

Change-Id: I424ef238f7adf4cf1f33b74e3a4e187dcb328a99
2013-05-09 16:19:40 +00: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
Aaron Schulz
2d7fe59935 [FileBackend] Clarified the noAccess/noListing docs a bit.
Change-Id: I3f008e3d1931423fc3c73af587d657040fdffe83
2013-04-01 16:39:36 -07:00
Aaron Schulz
3131dbc93b Clarified FileBackend::doOperations() docs a bit more.
Change-Id: Ie0b131c1a09bc75be39bbb7e9c87b8d3221a0fc5
2013-03-25 19:00:37 -07: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
Aaron Schulz
73b5fc4e0a A few minor doc group tweaks.
Change-Id: I18a8d733b3dbaa925a676c881225a63e90ff2f05
2013-03-18 15:14:55 -07:00
Aaron Schulz
139292dadd [FileBackend] Replaced redundant "disposition" param with "headers".
* Deprecated the "disposition" parameter.
* This also adds "headers" to to copy/move operations.

Change-Id: I63faa1dbbadb42c401b6ed4ac58776dc336ba3ab
2013-03-12 14:16:36 -07:00
Aaron Schulz
797e52dd05 Reformatted some array parameter docs.
Change-Id: Ie9eefd3693e82f483a9ef0da3f972452ae7bf49e
2013-03-11 11:00:35 -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
Aaron Schulz
66e73f8583 [FileBackend] Added a "ttl" option to getFileHttpUrl().
Change-Id: Ifc7b9c012276ed1f1e436ffafbd5615689680054
2013-03-06 20:55:43 -08:00
Aaron Schulz
13610ff519 Fixed documentation typo.
Change-Id: I02c3944efc63508c7aa798b3079167b85c760454
2013-02-20 13:30:58 -08:00
Aaron Schulz
aa7fbbb0cd [FileBackend] Documentation tweaks.
Change-Id: I63b03207a18c7523675a4929031dc560a2d8b5f8
2013-02-04 23:20:18 -08:00
Aaron Schulz
dce693efdc [FileBackend] Set ignore_user_abort() in file operations.
* This reduces the change of partial operations. WMF sites already
  set ignore_user_abort() in configuration, but this makes sure that
  it always happens during file changes.

Change-Id: I702c27fc3c19aca0cdd39b793a3250ead40bfe71
2013-02-01 12:30:47 -08:00
Aaron Schulz
a4f27a198f [LockManager] Generallized wiki field to a domain field.
* In some cases (like certain qualified file backends), a domain
  may be desired that is not simple a wiki ID.
* Also added a LockManangerGroup::config() function to export
  the configuration of a lock manager.

Change-Id: I5a75c55be3cc9017ed8a717d6d30e466fd00340f
2013-02-01 10:40:45 -08:00
Aaron Schulz
2cec654eea [FileBackend] Added more documentation.
Change-Id: I6a0f0dc253fbe82a58345d4179248071062286ff
2013-01-31 22:06:57 -08:00
Aaron Schulz
c1067b5c3a [FileBackend] Improved some header related docs.
Change-Id: I823af49b39afedda51f8192cd6a1a7467a8b78a7
2012-12-20 11:50:35 -08:00
Aaron Schulz
69b24f9a63 [FileBackend] Removed obsolete "allowStale" parameter.
* This was obsoleted by doQuickOperations().

Change-Id: I9e1d9c1e1c910e4ce6de4317299424305b31469c
2012-11-27 13:55:58 -08:00
Aaron Schulz
ac56107ba3 Merge "Revert "[FileBackend] Added optional callback parameter to concatenate()."" 2012-11-25 01:05:56 +00:00
Aaron Schulz
65612b4290 Revert "[FileBackend] Added optional callback parameter to concatenate()."
This gives updates for the faster part (local FS file changes) and not
the slow GETs that really need this. This should be re-done to use a
byte based read progress callback (that handles the parallel GETs).

This reverts commit 6c9f13b547

Change-Id: Id8d739e1d5048e7f38c68eda4f9a008682707cba
2012-11-24 17:01:12 -08:00
ASchulz
ef1bb48307 [FileBackend] Improved getFileProps() docs a bit.
Change-Id: I37dfc6c90829aa63511570c4576666e41764b6df
2012-11-21 15:30:54 -08:00
Demon
d0997617b2 Merge "[FileBackend] Added optional callback parameter to concatenate()." 2012-11-21 13:01:49 +00:00
Aaron Schulz
2e0e6a0013 [FileBackend] Added back ability to delete file HTTP headers.
* This partially reverts b80bd6159b.
* Clarified 'headers' parameter documentation a bit.
* Added the "describe" function wrappers that the other ops have.

Change-Id: I7142fd4d973f5f3407d244a4cae793934083bc26
2012-11-21 05:30:27 +00:00
Jan Gerber
b80bd6159b [FileBackend] Added support for changing headers on existing objects.
* Added a 'describe' file operation type to doOperations()/doQuickOperations().
  This can be used by scripts to fill in headers like X-Content-Duration for
  files that already exists.
* Removed wrong comments about removing headers (they don't get removed with null).
* Added some quick unit tests.

Change-Id: I43c5907b59421beaa9487eefac0cdbf8bc6c6d85
2012-11-20 16:07:28 -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
6c9f13b547 [FileBackend] Added optional callback parameter to concatenate().
* This lets callers update the cache/db with the operation progress so that
  APIs can be made to use this and expose this information to client polling.

Change-Id: I9a86c1c5ffccf029be5a150e5998c3ce4740ec62
2012-11-18 14:02:45 -08:00
Aaron Schulz
9f95bddda7 [FileBackend] Added getFileHttpUrl() function.
* This can speed up certain video file operations for scripts that support
  specifying source files via URLs and support HTTP Range headers.
* Updated unit tests.

Change-Id: I60cb95c2e3dd9f7df1f740e9182be7c79af69d6e
2012-11-08 23:01:19 +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
030c0277a9 [FileBackend] Added tiny getContainerStoragePath() convenience function.
Change-Id: Icc16c75f0cbfcf247628d0649386e52f1f25d335
2012-10-10 15:11:26 -07:00
Siebrand Mazeland
d4b046a893 Update docs for return and exception info
* Removed some inline tabs in the process.
* IDE fixed some incorrect leading spaces, too.

Change-Id: Ic9303eff6db4424ac3f1fa2816839692b43e6190
2012-10-09 09:41:58 +00:00
Brion VIBBER
4c01cfb10c Merge "[FileBackend] Optimized concatenate() to use getLocalReferenceMulti()." 2012-10-03 20:03:35 +00:00
Brion VIBBER
a570a73510 Merge "[FileBackend] Added getFileContentsMulti() and improved it for Swift." 2012-10-03 20:01:46 +00:00
Brion VIBBER
ba652c59fa Merge "[FileBackend] Added getLocalCopyMulti() and getLocalReferenceMulti()." 2012-10-03 19:54:34 +00:00
Aaron Schulz
43b95bbe8b Added doc note about getWikiId().
Change-Id: I9c078baf84e0fead743e5315f698bd287ecf9f13
2012-09-26 09:45:21 -07:00
Aaron
dfb0d94c99 [FileBackend] Added FileBackend::getWikiID() function.
Change-Id: Idd9be6c72d494fad37ac62e274c1e115ff97cdec
2012-09-24 15:38:37 -07:00
Aaron Schulz
dcb81eef85 [FileBackend] Optimized concatenate() to use getLocalReferenceMulti().
Change-Id: I884eb3fc27adb48ec6761143190cc622f1de2dca
2012-09-22 11:46:48 -07:00
Aaron Schulz
8641c9af9d [FileBackend] Added getFileContentsMulti() and improved it for Swift.
Change-Id: I6a2173eccda8fe7d4e2e779421e6edf05c8201b4
2012-09-22 11:01:58 -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
d97f671fdf [FileBackend] Factored out setConcurrencyFlags() function.
* This moves some options code from FileBackend to FileBackendStore,
  where it belongs. This also allows for reuse by other operations.

Change-Id: Ic9a7d36a6e4bc6b815a7d68926105401f65c53fb
2012-09-18 16:04:30 -07:00
Aaron Schulz
552507ffdc Tweaked various FileBackend docs.
Change-Id: Ie64fa644802b393ecbbb4db4b026bc45511de2ac
2012-09-15 23:43:18 -07:00
Aaron Schulz
8696c8336f Moved down rarely used option flag and added @since.
Change-Id: I801bd0ab4099245499a0eb4b060f143879164278
2012-09-13 21:31:59 -07:00
Aaron
da05f24bf2 [FileBackend] Work-around low header value limits in Swift.
* Also added sanity check to makeContentDisposition() and made the file name optional

Change-Id: Ie4bfef743d11227631606498f026e693dd8d21f3
2012-09-06 10:27:43 -07:00
Aaron Schulz
a441f03e32 Added @since to new function.
Change-Id: If15c11df7f460bea6c748584442970065fdaaaae
2012-09-02 00:33:19 -07:00
Aaron
a99aa9b007 Cleaned up some whitespace from 45b9073b61
Change-Id: I42e376d80d6cc483b96e815d63b19aee78fe1127
2012-08-31 16:24:19 -07:00