https://bugzilla.wikimedia.org/show_bug.cgi?id=24347
Summary: Generalization of the File::getArchiveUrl method
Product: MediaWiki
Version: 1.15.4
Platform: All
OS/Version: All
Status: NEW
Severity: enhancement
Priority: Normal
Component: Images and files
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected], [email protected],
[email protected]
In writing an extension to implement a filerepo which uses the Amazon S3
system, I found that there were a few changes needed to the File class. This is
because the File class assumes that it knows how to calculate the URL based on
the hash directory and so forth. In the case of the S3 system, the URL may need
a "signature", which is a suffix to the normal URL of the desired file. This
affected the links presented on the ImagePage screen for the archive files.
To make a long story short, I added a couple of lines to the beginning of the
File::getArchiveUrl() method:
if(is_callable(array($this->repo,'getArchiveUrl'))) {
$path = $this->repo->getArchiveUrl($this, $suffix);
return $path;
}
With this change, the repo, if the corresponding method exists, is used to
calculate the URL for the archive files, allowing for signatures, etc.
With just this change, my S3 extension works. But I noticed that there are
other methods in the File class which have the same problem, but I am unsure
what effect they might have. Also, it is possible that the ImagePage screen
creates the file object incorrectly (the "object factory" should be used, and
it isn't, so the inheritance doesn't apply).
Anyway, I would like to publish my S3 extension, but I would need to know if
this change can be made to the File::getArchiveUrl() method, or if some other
change would be better.
--
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l