You will want to put into a jobQueue you can take a look at the Timed
Media Handler extension for how post upload processor intensive
transformations can be handled.
--michael
On 05/04/2012 04:58 AM, emw wrote:
Hi all,
For a MediaWiki extension I'm working on (see
http://lists.wikimedia.org/pipermail/wikitech-l/2012-April/060254.html), an
effectively plain-text file will need to be converted into a static image.
I've got a set of scripts that does that, but it takes my medium-grade
consumer laptop about 30 seconds to convert the plain-text file into a
ray-traced static image. Since ray-tracing the images being created here
substantially improves their visual quality, my impression is that it's
worth a moderately expensive transformation operation like this, but only
if the operation is done once.
Given that, I assume it'd be best to do this transformation immediately
after the plain-text file has completed uploading. Is that right? If not,
what's a better time/way to do that processing?
I've looked into MediaWiki's 'UploadComplete' event hook to accomplish
this. That handler gives a way to access information about the upload and
the local file. However, I haven't been able to find a way to get the
uploaded file's path on the local file system, which I would need to do the
transformation. Looking around related files I see references to $srcPath,
which seems like what I would need. Am I just missing some getter method
for file system path data in UploadBase.php or LocalFile.php? How can I
get the information about an uploaded file's location on the file system
while in an onUploadComplete-like object method in my extension?
Thanks,
Eric
_______________________________________________
Wikitech-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
_______________________________________________
Wikitech-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l