liip / LiipImagineBundle

Symfony Bundle to assist in image manipulation using the imagine library
http://liip.ch
MIT License
1.67k stars 378 forks source link

Absolute Urls #423

Closed trsteel88 closed 10 years ago

trsteel88 commented 10 years ago

Why does generateUrl() in the CacheManager return Absolute urls?

I have a command that loops through images to update an RSS feed. I need this rss feed to have relative images rather than absolute.

makasim commented 10 years ago

I cannot recall the exact resason but that's was done on purpose, to simplify architecture and maybe decouple things. only web path can return relative path the rest (aws, amazon, etc) returns absolute

I dont see any problems with absolute urls, Though if you want relative you can use POST_RESOLVE event and do path relative there.

trsteel88 commented 10 years ago

I can think of at least 2 use cases where you would need a relative path.

Perhaps there needs to be an option to specify this so it can be used where necessary?

makasim commented 10 years ago

When calling the getBrowserPath() from a Command it prepends the path with "http://localhost".

that's expected, you have to configure request context parameters from symfony. In any case you would have to do so to make route generation work in cli, when you send email with links for example.

trsteel88 commented 10 years ago

That is true. But in the symfony router you can specify relative. What about my second use case?