BetterBrief / silverstripe-pdf

Deliver a SilverStripe response as a PDF document.
BSD 3-Clause "New" or "Revised" License
11 stars 3 forks source link

Use core to determine base URL #1

Open dhensby opened 10 years ago

dhensby commented 10 years ago

Why are we introducing another way to manage the base URL for the PDF when we can just use core to do so?

Be it alternate_base_url or $_URL_TO_FILE_MAPPING?

https://github.com/BetterBrief/silverstripe-pdf/commit/17de2b4be32080e151dddba006d3ed533aecb9cb#diff-608f3da92c5983277ec89535c449a0eeR19

willmorgan commented 10 years ago

Ooh, you make a good point about $_URL_TO_FILE_MAPPING. How do I go about using it? Let me know and I'll push it in ASAP.

dhensby commented 10 years ago

The CLI pulls it in automatically and uses it to fill the $_SERVER superglobal

willmorgan commented 10 years ago

This isn't CLI based!

dhensby commented 10 years ago

You could look at static publisher's approach?

willmorgan commented 10 years ago

I've searched through that repository for $_FILE_TO_URL_MAPPING but there's nothing there.

Moreover, the static publisher doesn't need to pull in assets - that's done on the client side - whereas in this instance, the binary needs to request those images itself and embed them directly in to the PDF, before the client views it. Does that make sense?

For now, http://localhost looks like a sensible default to me. If it needs to be changed it'll be because of multi instance live deployment. That's why I'm not using the base URL and calling it something else.

dhensby commented 10 years ago

I meant how the publisher use custom domain names.

Ok, lets put it on the back-burner for now