[MediaWiki-l] Best hook to rewrite images paths?

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

[MediaWiki-l] Best hook to rewrite images paths?

Leonard Wallentin-2
Hello,

I just moved all images on my wiki to Amazon, for performance. Now I wonder
what the best way is to change all thumb and image paths in the wiki.
Browsing through the file related hooks I find no obvious candidate. For
now I just do a replace in ParserAfterTidy, but that i quite ugly, and will
sooner or later have a false positive. Surely there must be a better way?

/Leo
_______________________________________________
MediaWiki-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: Best hook to rewrite images paths?

Mark A. Hershberger-2
On 10/14/2013 04:35 AM, Leonard Wallentin wrote:
> I just moved all images on my wiki to Amazon, for performance. Now I wonder
> what the best way is to change all thumb and image paths in the wiki.
> Browsing through the file related hooks I find no obvious candidate. For
> now I just do a replace in ParserAfterTidy, but that i quite ugly, and will
> sooner or later have a false positive. Surely there must be a better way?

Did you look at https://www.mediawiki.org/wiki/Extension:AWS or
https://www.mediawiki.org/wiki/Extension:LocalS3Repo ?

_______________________________________________
MediaWiki-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: Best hook to rewrite images paths?

Leonard Wallentin-2
Thank you for pointing me there!

Both those extensions seem to create their own File classes, and override
all MW file handling. I have simply mounted S3 on my server (as described
here: https://www.mediawiki.org/wiki/User:Chillum/Integration_with_S3), so
I am looking for something much more simple; Simply modifying the images
paths!

/Leo


2013/10/14 Mark A. Hershberger <[hidden email]>

> On 10/14/2013 04:35 AM, Leonard Wallentin wrote:
> > I just moved all images on my wiki to Amazon, for performance. Now I
> wonder
> > what the best way is to change all thumb and image paths in the wiki.
> > Browsing through the file related hooks I find no obvious candidate. For
> > now I just do a replace in ParserAfterTidy, but that i quite ugly, and
> will
> > sooner or later have a false positive. Surely there must be a better way?
>
> Did you look at https://www.mediawiki.org/wiki/Extension:AWS or
> https://www.mediawiki.org/wiki/Extension:LocalS3Repo ?
>
_______________________________________________
MediaWiki-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: Best hook to rewrite images paths?

Jan Steinman
In reply to this post by Mark A. Hershberger-2
> From: Leonard Wallentin <[hidden email]>
>
> I just moved all images on my wiki to Amazon, for performance. Now I wonder
> what the best way is to change all thumb and image paths in the wiki.

Isn't this just a virtual file system? Can't you just create a symbolic link between the two?

mv /var/httpd/wiki/images /volumes/amazon
ln -s /volumes/amazon/images /var/httpd/wiki

:::: A cynic is a man who knows the price of everything and the value of nothing. -- Oscar Wilde
:::: Jan Steinman, EcoReality Co-op ::::


_______________________________________________
MediaWiki-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: Best hook to rewrite images paths?

Benjamin Lees
In reply to this post by Leonard Wallentin-2
On Mon, Oct 14, 2013 at 2:47 PM, Leonard Wallentin
<[hidden email]>wrote:

> I am looking for something much more simple; Simply modifying the images
> paths!
>

If you that's all you want, just change
https://www.mediawiki.org/wiki/Manual:$wgUploadPath :-)
_______________________________________________
MediaWiki-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: Best hook to rewrite images paths?

Leonard Wallentin-2
@Benjamin: Thanks a lot, that was exactly what I was looking for! Another
reminder to always rtfm.... :)

@Jan: Sorry, I wasn't really clear. I have made /wiki/images a symlink to
my virtual filesystem, but I wanted the paths to be rewritten to make use
of Amazon Cloudfront as an image CDN.

/Leo


2013/10/15 Benjamin Lees <[hidden email]>

> On Mon, Oct 14, 2013 at 2:47 PM, Leonard Wallentin <
> [hidden email]> wrote:
>
>> I am looking for something much more simple; Simply modifying the images
>> paths!
>>
>
> If you that's all you want, just change
> https://www.mediawiki.org/wiki/Manual:$wgUploadPath :-)
>
_______________________________________________
MediaWiki-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: Best hook to rewrite images paths?

SASA TIJANA
In reply to this post by Mark A. Hershberger-2


Skickat från min iPhone
_______________________________________________
MediaWiki-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l