Commit graph

214 commits

Author SHA1 Message Date
Aaron Schulz
0d54e6e0bf Added unicode encoding support flags to FileBackend
* Fixed bug where even using Swift/Azure on Windows
  would disallow non-ASCII file names.

bug: 1780
Change-Id: I19ed72da0b099d35cae74fb08eeb22c113da1065
2014-05-13 14:11:36 -07:00
jenkins-bot
6bbc1064f2 Merge "Removed unused getZoneHandlerUrl() method" 2014-05-05 18:25:07 +00:00
jenkins-bot
c0cdf0e911 Merge "Return $wgSitename as displayname for local repo in filerepoinfo API" 2014-05-05 06:38:40 +00:00
Gergő Tisza
277ecacff2 Return $wgSitename as displayname for local repo in filerepoinfo API
displayname is used in user interface texts to tell the user what
is the source of a file so returning null does not make sense
here.

Bug: 64800
Change-Id: Iafbc1a8e63b512d1515215fa1295e5b7434f1861
2014-05-03 18:37:06 +00:00
Aaron Schulz
f98ecde834 Removed unused getZoneHandlerUrl() method
* This was not terribly well conceived and is not used by anything.

Change-Id: Icb03477e2b33621949fab7c39fd06e28ac0777fc
2014-05-02 15:22:46 -07:00
jenkins-bot
e40b19ed4e Merge "Bail out on FileBackend operations if the initial stat calls failed" 2014-04-21 17:13:33 +00:00
umherirrender
957adbef22 Fixed some @params documentation (includes/[file...|upload])
Swapped some "$var type" to "type $var" or added missing types
before the $var. Changed some other types to match the more common
spelling. Makes beginning of some text in captial.
Also added some missing @param.

Change-Id: I8804ebe0922d3a414863b162a2110e0b9e49b80f
2014-04-19 17:19:17 +02:00
Aaron Schulz
2cfce9fd8d Bail out on FileBackend operations if the initial stat calls failed
* The preloadFileStat() call acts as a good canary for whether all
  affected servers are up. If anything failed in it, then it's not
  worth bothering to send the actual write requests.
* Also made FileBackend::preloadFileStat abstract while at it since
  the two subclasses implemented it and so should any others.
* Fixed a silly comment typo.

Change-Id: I5bd427f654aa4a9d6bfe4ed7566276e8ac520b30
2014-04-18 12:41:23 -07:00
Brian Wolff
4b58dcbab1 Add support for specifying headers in FileRepo::quickImport
Previously only content-disposition headers were allowed.

This is needed so that TimedMediaHandler can put
X-Content-Duration headers on ogg transcodes.

Bug: 62928
Change-Id: Ic053be63b3edf348da95a88fc494fcf334430265
2014-03-24 00:09:45 -03:00
Siebrand Mazeland
f077c4b1d6 Update formatting
Change-Id: I18aff576262479c9bb1c56eb8e1d1aaae200e4b1
2014-02-06 09:27:05 +01:00
jenkins-bot
609fe35a3a Merge "Propagate the favicon information to getInfo() for local repos" 2014-01-29 00:19:27 +00:00
Brad Jorsch
99cb12b973 Extend FileRepo::findFile private option to accept a User object
Callers may want to test visibility for a user other than $wgUser when
specifying the 'private' option. It seems a natural extension to allow
'private' to be a User object, with boolean true retaining its old
meaning of $wgUser.

Change-Id: Idbed0f3055c0135b5c11068de1bf1ef668e13456
2014-01-17 11:43:22 -05:00
Gergő Tisza
8073d4f226 Propagate the favicon information to getInfo() for local repos
This is needed by MultimediaViewer to show a relevant icon next
to the local and foreign db repo link in the description area

The setting ends up in configuration for foreign DB, because the
favicon value is stored in the configuration of a wiki, not in its
database.

Change-Id: I3d0599c1afa13e1d8540ff3c8bc34129a55792c5
2014-01-17 11:31:16 +01:00
Aaron Schulz
e216fe5501 Changed TIME_ONLY to NAME_AND_TIME_ONLY in FileRepo
* This now returns a (final DB key, timestamp) map for each file.
  This makes proper redirect handling easier for callers.
* Also fixed the case where ucfirst normalization is different in the
  repo versus the local wiki.
* Also added $flags to RepoGroup::findFiles() as expected.

Change-Id: I978a1cc0a0589179c46e477cfd06c8bff4c08fa9
2013-12-11 11:54:31 -08:00
Aaron Schulz
1cd3ff7ae8 Tweaked FileRepo::findFiles() behavoir to match LocalRepo
* This seems more intuitive and deals with an API bug

bug: 45930
Change-Id: I5e265bb9c6063306669cc4014eeb17cfda86436b
2013-12-11 10:46:23 -07:00
Aaron Schulz
946cb44dc5 Added a TIME_ONLY option to FileRepo::findFiles to use less RAM
* Also renamed $possFile to just $file in method

Change-Id: Idb497901b9a7bd96c828267769a66efa282c5918
2013-12-09 16:30:14 +00:00
jenkins-bot
c687c4a9ac Merge "Optimized LocalRepo::findFiles()" 2013-12-05 18:34:59 +00:00
Siebrand Mazeland
b283817e32 Group public and private properties
Change-Id: I2e399ee311ba44ae9652e75ee210663c3b28614b
2013-12-04 22:29:33 +00:00
Siebrand Mazeland
417d4fbbfa Update documentation for file repo related classes
Change-Id: I626d972f92934afc9349e11d3a5550c4044dcb53
2013-12-04 23:06:53 +01:00
Aaron Schulz
687c5b5577 Optimized LocalRepo::findFiles()
Change-Id: Icea9c416c973a6b83c53e5bc201aed4528e9dd34
2013-12-03 23:43:44 -08:00
Siebrand Mazeland
13095a6a83 Break long lines and suppress false posive
Change-Id: I14c61d8060cd3a3a2a15193f6721e7f87b783538
2013-12-03 14:31:04 +01:00
Siebrand Mazeland
bc967dd32e Update documentation
Change-Id: I94af1fbbfeb838f4d300c87f0e42a816ff6c5fee
2013-11-25 14:45:32 +01:00
Siebrand Mazeland
9eafc3f0a5 Set visibility of 2 properties to public
Set visibility of $fetchDescription and $descriptionCacheExpiry to public.
These two class properties are directly referenced outside an inheritance
scope.

Bug: 57535
Change-Id: I4e91418f1e2374ebe83ea4310d13ad254fc3dac1
2013-11-25 14:22:25 +01:00
Siebrand Mazeland
de6b4e7cfc Set visibility on class properties of FileRepo
Change-Id: I31c458a3b36e15c8c0666550c9151223dd3a23a0
2013-11-24 10:28:46 +01:00
Siebrand Mazeland
f742b27dd3 Break long lines in file repo files
Change-Id: I6d95c1b3e14a947a92127efa681007baaeab89ba
2013-11-23 21:17:08 +00:00
Siebrand Mazeland
bb39b5a6e4 Update formatting of file repo classes
Change-Id: I780070e07352d84d7cda7628994b28b04e8a1ebf
2013-11-23 21:00:11 +01:00
Platonides
d5fc1d58e3 Replace usage of deprecated getRootUrl() method
Follow-up change 85344 (d94d29a9)

Change-Id: Ia77d445621b426e159f9c120cb55c7e69b193497
2013-11-23 19:34:44 +01:00
umherirrender
5dbfd5bf80 Fixed spacing
- Removed trailing spaces in comments
- Removed multiple empty lines
- Removed space after object operator

Change-Id: I9fd3256ab490c7cd2034de3fd94e6be6e6d6d8f2
2013-11-21 18:52:25 +00:00
Brad Jorsch
ea941f7843 Add additional information to FileRepo::getInfo
The API's meta=filerepoinfo could use some additional information, most
pressingly a way to determine the MW API endpoint of the associated
repo. Since FileRepo already has scriptDirUrl (to which "/api.php" could
be appended), let's just add that.

And for good measure, we may as well include various other bits of
information that people might find useful.

Change-Id: I6d5aa6cf44ef1d9bdfd9b2f36f184e5fdc0900dd
2013-11-20 14:38:49 -05:00
Mark Holmquist
d94d29a920 Add meta=filerepoinfo for getting file repo info
We currently only return the image repository name for imageinfo, which
is not particularly useful, especially since image repositories aren't
accessible via the API. This patch adds meta=filerepoinfo, which will
return a list of repositories and relevant information (like the API URL
for ForeignAPIRepo ones)

Also returns the local repo now, and defaults to "all" in a more useful
fashion.

Change-Id: I1aaed0895d2a0bc224c82e93975ecf6afd8cb6b8
2013-09-27 13:53:34 -07:00
umherirrender
0a810a5a87 Avoid date()/gmdate() for date formatting
Added a MWTimestamp::format method to format a timestamp object in the
given pattern. This avoids date(), which needs the local time
zone corretly set on the server, which is assumed at the moment in
Setup.php

Added MWTimestamp::getInstance for gmdate() and
MWTimestamp::getLocalInstance for date() to create a MWTimestamp object
and use it as inline statement.
Also MWTimestamp::setTimezone and MWTimestamp::getTimzone was added for
timezone handling.

Change-Id: I812aa013be2f4380e0cf10dc465202756fe8347b
2013-07-08 04:14:12 +00:00
Tim Starling
1fe9340bb3 Remove hphpc support and deprecate related functions
hphpc has been superseded by hhvm, so support for hphpc is no longer
needed.

* Continue to use Preprocessor_Hash under HipHop since it is still
  faster under hhvm
* Keep $wgCompiledFiles for now, so that wikihiero doesn't give an error
  before Ic9d1e795 is merged
* Migrate the run-server script and associated configuration file to
  hhvm. Enable EnableStaticContentFromDisk since it doesn't seem
  ridiculously inefficient at first glance. Run from $IP rather than
  $IP/.. since hhvm is apparently not picky about sourcing files from
  outside of the current directory.

Change-Id: Ic3e769f1fbad4f7ad26dd819406796fee48c6b45
2013-05-09 08:28:05 +10:00
umherirrender
6f79eef473 Fixed spacing around parenthesis in includes
Change-Id: Ie8adc00f4ee8ecec4554e584c18d5d2073415397
2013-04-28 15:50:07 +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
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
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
btongminh
c5c8b31450 (bug 40326) Check if files exist with a different extension during
uploading

Added FileRepo::findFilesByPrefix( $prefix ), which does a img_name LIKE
'$prefix%' search and use this in UploadBase::getExistsWarning().

Change-Id: I21eddc5d08ca3c23b342ebc1c6947e36c4201a45
2013-03-06 03:52:49 +00:00
Jan Gerber
fa80d44451 Bug 43343 add zone "transcoded" for audio/video
to allow different storage strategies for thumbnails
	and audio/video derivatives, add a new zone "transcoded".

Change-Id: I204c843dae4966b02f4807f15e6b0bac672f34dc
2013-02-05 05:53:57 +00:00
umherirrender
570dda0455 fix some spacing
Change-Id: I88e73d47a552918880514d88a876296a6cb80d88
2013-02-04 20:09:18 +00:00
Alex Monk
c2c982c4e8 (bug 36537) Rename calls to wfArrayToCGI to wfArrayToCgi
Done with this command:
grep wfArrayToCGI * -R -l -Z | xargs -0 -l sed -i -e 's/wfArrayToCGI/wfArrayToCgi/g' && git checkout -- HISTORY

Change-Id: If7f4d4bfc199289c11c43cf519c2415a1aad1c51
2013-01-28 18:04:20 +00:00
Aaron Schulz
ba5e774de9 [Upload] Added async upload concatenation support.
* Clients can send the last chunk with 'async' to get an immediate
  response and then check the status of the upload by polling the API
  using the 'checkstatus' parameter.
* Pass the User object along to stash functions within UploadFromChunks.

Change-Id: Ie2ad4c7e94862a728e8a687c3195306e16a5059e
2012-12-05 09:39:31 -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
Demon
d0997617b2 Merge "[FileBackend] Added optional callback parameter to concatenate()." 2012-11-21 13:01:49 +00:00
Aaron Schulz
7c6f0d541e Merge "Various simple optimizations for the chunked upload process." 2012-11-21 00:19:24 +00:00
Aaron Schulz
8c819ac2e8 [FileRepo] Quashed melodious 4-tuples into silence.
Change-Id: I55c6ddd5d2e8999578ca45f523e99ab6cd4e9d52
2012-11-20 14:37:58 -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