aboutsummaryrefslogtreecommitdiffstats
path: root/includes/filebackend/FileBackendStore.php
Commit message (Collapse)AuthorAgeFilesLines
* filebackend: exception handling cleanupsAaron Schulz2013-12-071-8/+9
| | | | | | * Split out FileBackendException class and reduced direct use of MWException Change-Id: I325c1798b6d90972c12a5dccc37989af34d857f3
* Update ternary notationSiebrand Mazeland2013-12-041-1/+1
| | | | Change-Id: I553dd1d42477326848e6e40b824058b6790e2eb5
* Remove unused local variableSiebrand Mazeland2013-11-251-1/+1
| | | | | | Just count if there are array members Change-Id: I4f9cc8ba554404796822317fdb285e2f560d01dd
* Update documentation of file backend classesSiebrand Mazeland2013-11-231-33/+53
| | | | Change-Id: I2113aecc53f1b361d9c276113bc0a9f7076cd21c
* Update formatting of file backend classesSiebrand Mazeland2013-11-221-4/+45
| | | | Change-Id: Ie69c324e2f1ea0b8a654adee06ebda494cebd10c
* Removed excess profile callsAaron Schulz2013-11-161-6/+0
| | | | Change-Id: Idd57e8d7fff56c62a66c7fcaf4627b9096f0c363
* filebackend: improved "adviseStat" performanceAaron Schulz2013-11-081-1/+1
| | | | | | | | | | | * Use the normal page size instead of limiting it way down to the cache size. Track the stat information in the pages and load into into the stat cache as entries are accessed. This should also be less prone to evictions causing HEAD requests (or memcached hits). * Also bumped CACHE_CHEAP_SIZE up to 500. * Fix a few doc bits Change-Id: I8d44a072e7bcc56c83d8d9c8c9ac9864530bccf8
* Fixed broken quickDescribe() methodAaron Schulz2013-10-241-1/+1
| | | | Change-Id: Ic68f483c4008ff6ae8c4accef2f9d1f180a5d377
* filebackend: try to combine SH and EX lock acquisitionAaron Schulz2013-10-181-11/+11
| | | | | | | | * 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
* Factored out a small filebackend getContentType() functionAaron Schulz2013-09-251-6/+31
| | | | Change-Id: I221483ab4a0ed36ea34c19db1740dfaecf223677
* Switched FileBackendStore to use ProfileSection when possible.Aaron Schulz2013-06-191-131/+27
| | | | | | * Also removed outer profiling layer. Change-Id: Ice3b921fe0c9981ac16f005d66a78bf4f4a5c601
* Cleaned up variable/type order in docs.Aaron Schulz2013-06-131-11/+11
| | | | | | * A few other minor doc cleanups and obvious type hints. Change-Id: I454fad0c1942068b4f3632ebd1b605bfbb9dfe7c
* Removed redundant documentation for some methods.Aaron Schulz2013-06-121-91/+0
| | | | Change-Id: Iad422716f6796cc4b69405182f4a74daa0c93663
* [FileBackend] Avoid concurrency for the 1 op case in ↵Aaron Schulz2013-05-151-1/+1
| | | | | | doQuickOperationsInternal(). Change-Id: I6526d3b77fc078d80a0fb537d504a7fabcbb4c41
* [FileBackend] Moved short-circuit check from 6b1194b9 up to FileBackend.Aaron Schulz2013-05-101-8/+0
| | | | Change-Id: I57566a1779f353c18d96c59c47112c753aea6b90
* [FileBackend] Optimize the case were no operations are provided.Aaron Schulz2013-05-101-0/+8
| | | | Change-Id: Iaf858ce2e8b21e031d27b984029f0424518201af
* [FileBackend] Added "adviseStat" option for the "listing followed by stat" case.Aaron Schulz2013-05-091-2/+4
| | | | | | | | * 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
* [FileBackend] Process cache negatives for SHA1 on file stat.Aaron Schulz2013-05-071-0/+2
| | | | Change-Id: Idc9f82309d52818acf57adc9c4eb04370a7b422a
* Fixed spacing in actions/cache/filebackend/filerepo/job folderumherirrender2013-04-201-6/+6
| | | | | | | Added spaces before if, foreach Added some braces for one line statements Change-Id: Idb93d34e314e5f314223b79208968d6bcd30c40e
* [FileBackend] Made stat cache factor in last-modified time.Aaron Schulz2013-04-191-5/+11
| | | | | | | | * This should lesson the chance of consistency problems if there is any memcached flapping. * Also cleaned up some documentation. Change-Id: I89401892c7e848fcff0b093eaa861dfe02387a5c
* [FileBackend] Disallow files ending in / and clarified some docs.Aaron Schulz2013-04-191-2/+8
| | | | Change-Id: I162ca34fe9f92d862345004bd184013531da9e8d
* [FileBackend] Simplified the shard list iterator to use AppendIterator and ↵Aaron Schulz2013-04-171-128/+38
| | | | | | FilterIterator. Change-Id: I22f79447b1edec4fa6d7fc06d67f3f831a484f16
* Added/Removed spaces around string concatenationumherirrender2013-04-131-2/+2
| | | | | | | | | And added/removed spaces around some other tokens, like +, -, *, /, <, >, =, ! Fixed windows newline style Change-Id: I0b9c8c408f3f6bfc0d685a074d7ec468fb848fc8
* Add missing wfProfileOut before throwing an exceptionumherirrender2013-04-081-0/+4
| | | | Change-Id: I1d830da0597f19efd0b2ae48642389975e736e23
* Use canonical class name.Platonides2013-04-021-1/+1
| | | | Change-Id: I7dc9980d334bc5ad6421135d713d890a8588281c
* [FileBackend] Cleanup behavior for coping/moving a file over itself.ASchulz2013-03-251-5/+11
| | | | | | | | | | | | | | | * 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
* [FileBackend] Replaced redundant "disposition" param with "headers".Aaron Schulz2013-03-121-8/+10
| | | | | | | * Deprecated the "disposition" parameter. * This also adds "headers" to to copy/move operations. Change-Id: I63faa1dbbadb42c401b6ed4ac58776dc336ba3ab
* Reformatted some array parameter docs.Aaron Schulz2013-03-111-12/+12
| | | | Change-Id: Ie9eefd3693e82f483a9ef0da3f972452ae7bf49e
* Fixed @param tags to conform with Doxygen format.Tyler Anthony Romeo2013-03-111-30/+30
| | | | | | | | | | | 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
* Kill off numerous unused variablesReedy2013-03-081-11/+11
| | | | Change-Id: I7039f1328f37ee669b694f73ee282602186bffd1
* fix some spacingumherirrender2013-03-071-2/+2
| | | | | | | | 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
* [FileBackend] Process cache negatives for file SHA1 function.Aaron Schulz2013-02-261-4/+1
| | | | Change-Id: I2a6b801cd97e8ee1a678a43d5f6d01d3e9603637
* Merge "Revert "[FileBackend] Added optional callback parameter to ↵Aaron Schulz2012-11-251-14/+0
|\ | | | | | | concatenate().""
| * Revert "[FileBackend] Added optional callback parameter to concatenate()."Aaron Schulz2012-11-241-14/+0
| | | | | | | | | | | | | | | | | | | | 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 6c9f13b5477f54fbe9cff893f665814ad8cdff87 Change-Id: Id8d739e1d5048e7f38c68eda4f9a008682707cba
* | [FileBackend] More stat caching improvements.Aaron Schulz2012-11-211-11/+36
| | | | | | | | | | | | | | | | | | * Extended negative caching to handle the "latest" parameter. * Added a new "dstExists" parameter to some write functions to avoid salting the cache when a file is created at an unused path. The ability to do this was already mentioned in the setFileCache() doc comments. Change-Id: Ib64e4c128e16f4d284033fff70b88686fa0593ab
* | Merge "[FileBackend] Added optional callback parameter to concatenate()."Demon2012-11-211-0/+14
|\|
| * [FileBackend] Added optional callback parameter to concatenate().Aaron Schulz2012-11-181-0/+14
| | | | | | | | | | | | | | * 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
* | [FileBackend] Added back ability to delete file HTTP headers.Aaron Schulz2012-11-211-2/+1
| | | | | | | | | | | | | | | | * This partially reverts b80bd6159bdf946c1d4fa1e143fea221937d848a. * Clarified 'headers' parameter documentation a bit. * Added the "describe" function wrappers that the other ops have. Change-Id: I7142fd4d973f5f3407d244a4cae793934083bc26
* | [FileBackend] Added support for changing headers on existing objects.Jan Gerber2012-11-201-20/+62
| | | | | | | | | | | | | | | | | | | | * 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
* | Merge "[FileBackend] Clear the stat cache in doQuickOperations() for sanity."Tim Starling2012-11-201-0/+3
|\ \
| * | [FileBackend] Clear the stat cache in doQuickOperations() for sanity.Aaron Schulz2012-11-171-0/+3
| |/ | | | | | | Change-Id: Id3fcc9b0bbb881947734edaa6799d71d9adb9881
* / [FileRepo] [FileBackend] Added support for custom file headers.Aaron Schulz2012-11-201-0/+26
|/ | | | | | | | | | * 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
* Unset DirectoryIterator in the FileBackendumherirrender2012-11-161-0/+1
| | | | | | | | | | | | | | This is necessory to close all handlers on the directory and than it is possible to rmdir the directory without a 'permission denied' on a windows machine. Corresponding unit test failure: 1) FileBackendTest::testRecursiveClean Dir mwstore://localtesting/unittest-cont1/e/a no longer exists (FSFileBackend). Failed asserting that true matches expected false. Change-Id: Ide58c6d0ec101bf0ddcd6b7414c51075fc28825b
* [FileBackend] Stat caching improvements.Aaron Schulz2012-11-161-7/+13
| | | | | | | | | | | | | | Callers often tend to end up calling getFileStat(), at least indirectly, or in various successive function on the same path. This created RTTs when the file didn't exist since negatives were not cached. This change does the following: * Cache definitive negatives (404s) in the process cache. Nothing is cached on failure (like network problems). * Ignore process cache entries after a brief time period so long running scripts do not have overly stale entries. Change-Id: I356bd9f48281e3c7e7a273778b2aca59c521a0c7
* [FileBackend] Added getFileHttpUrl() function.Aaron Schulz2012-11-081-0/+8
| | | | | | | | * 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
* [FileBackend] Check if paths are writable for delete ops too.Aaron Schulz2012-10-311-2/+3
| | | | | | * Also clarified the docs around isPathUsableInternal(). Change-Id: I3fc10fce43e040f45045d6da69f0211e9ab4155d
* [FileBackend] Support "ignoreMissingSource" for copy and move operations.Aaron Schulz2012-10-311-12/+14
| | | | | | | | * 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
* [FileBackend] Simplified code for handling "overwrite" parameter.Aaron Schulz2012-10-291-16/+8
| | | | | | | | | * 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
* [FileBackend] Issue a warnings for cache problems in streamFile().Aaron Schulz2012-10-191-0/+1
| | | | Change-Id: I62cf6f07dc8722d483b3b6969aae1915c4ffccc6
* [FileBackend] Clear persistent stat cache if it mislead streamFile().Aaron Schulz2012-10-181-0/+7
| | | | Change-Id: Ie02e9e0c56180d8cbd2507b795cd960f3ba84f33