Check out the LimeSurvey source code on GitHub!

Dynamic $rooturl to eliminate an install/config step

More
6 years 4 weeks ago - 6 years 4 weeks ago #55557 by starmonkey
Hi all, not sure where this belongs, but I just thought I'd share a hack with you guys, mainly to make sure I'm not doing something bad.

I prefer my php webapps to work out as much of their environment as possible, to save on configuration steps.

As such, I edited config.php with the following:
// The root web url for your limesurvey installation (without a trailing slash).
//$rooturl = "http://{$_SERVER['HTTP_HOST']}/path/to/limesurvey"; 
// SM 20Jan11: Dynamic rooturl, for /admin pages, set one level up
$rooturl = "http://".$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF']);
if('admin' == basename($rooturl)) { $rooturl = dirname($rooturl); }

Anyway, feedback welcome. I did this because my dev/staging and live environments have different paths/urls, and I got tired of maintaining different settings per environment!

// SM
Last Edit: 6 years 4 weeks ago by starmonkey.

Please Log in to join the conversation.

More
6 years 4 weeks ago #55561 by Mazi
I think the best way to discuss coding details is to open a new ticket at oiur Bugtracker so we can assign this issue to a certain developer.
Please have a look at docs.limesurvey.org/How+to+contribute+new+features


Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)survey-consulting.com'"

Please Log in to join the conversation.

More
6 years 4 weeks ago #55594 by starmonkey
Cheers, Mazi.

I created the following in mantis:

bugs.limesurvey.org/view.php?id=4896

Please Log in to join the conversation.

More
6 years 4 weeks ago #55618 by Mazi
Thanks for your contribution, we will discuss it at the Bugtracker.


Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)survey-consulting.com'"

Please Log in to join the conversation.

Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form