Anonymous Login
2016-09-27 00:21 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
04896User patchesInstallationpublic2012-06-21 14:16
Reporterstarmonkey 
Assigned To 
PrioritynormalSeveritytweak 
StatusconfirmedResolutionopen 
Product Version1.90 
Target VersionFixed in Version 
Summary04896: Dynamic $rooturl to eliminate an install/config step
DescriptionHi guys, 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!
Steps To Reproduce1) Edit config.php and update the line that sets $rooturl
2) Enjoy a slice of chocolate cake as you deploy to live without fear
Additional InformationOriginally I posted this as a forum thread here:

http://www.limesurvey.org/en/forum/future-features/55557-dynamic-rooturl-to-eliminate-an-installconfig-step
TagsNo tags attached.
Complete LimeSurvey version number (& build)9672
Attached Files

-Relationships
+Relationships

-Notes

~13959

Mazi (developer)

Thibault, what do you think about this?

Before implementing this we might also want to ping Carsten if this has any effects on Limeservice.

~14328

lemeur (developer)

Carsten I prefer to let you decide on this one.

~14339

c_schmitz (administrator)

I looked up on PHP_SELF and I think there is no risk involved because it is tamed by the dirname() call.
HOwever the 'if 'admin' ' part is hardcoded and ignores the fact that the LimeSurvey /admin directory can be renamed.

~14580

c_schmitz (administrator)

Starmonkey, do you see a way to resolve the '/admin' issue I talked about?
+Notes

-Issue History
Date Modified Username Field Change
2011-01-22 23:49 starmonkey New Issue
2011-01-23 19:42 Mazi Assigned To => lemeur
2011-01-23 19:42 Mazi Status new => assigned
2011-01-23 19:43 Mazi Note Added: 13959
2011-03-08 13:30 lemeur Assigned To lemeur => c_schmitz
2011-03-08 13:31 lemeur Note Added: 14328
2011-03-08 15:33 c_schmitz Note Added: 14339
2011-03-28 02:27 c_schmitz Note Added: 14580
2012-06-21 13:32 c_schmitz Status assigned => confirmed
2012-06-21 14:16 c_schmitz Assigned To c_schmitz =>
+Issue History