| Anonymous | Login | 2013-05-20 09:45 CEST | ![]() |
| Main | My View | View Issues | Change Log | Roadmap | Repositories |
| View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||||||
| ID | Project | Category | View Status | Date Submitted | Last Update | ||||||||
| 04896 | User patches | Installation | public | 2011-01-22 23:49 | 2012-06-21 14:16 | ||||||||
| Reporter | starmonkey | ||||||||||||
| Assigned To | |||||||||||||
| Priority | normal | Severity | tweak | ||||||||||
| Status | confirmed | Resolution | open | ||||||||||
| Product Version | 1.90 | ||||||||||||
| Target Version | Fixed in Version | ||||||||||||
| Summary | 04896: Dynamic $rooturl to eliminate an install/config step | ||||||||||||
| Description | Hi 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 Reproduce | 1) 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 Information | Originally I posted this as a forum thread here: http://www.limesurvey.org/en/forum/future-features/55557-dynamic-rooturl-to-eliminate-an-installconfig-step [^] | ||||||||||||
| Tags | No tags attached. | ||||||||||||
| LimeSurvey build number | 9672 | ||||||||||||
| Attached Files | |||||||||||||
Notes |
|
|
Mazi (developer) 2011-01-23 19:43 |
Thibault, what do you think about this? Before implementing this we might also want to ping Carsten if this has any effects on Limeservice. |
|
lemeur (administrator) 2011-03-08 13:31 |
Carsten I prefer to let you decide on this one. |
|
c_schmitz (administrator) 2011-03-08 15:33 |
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. |
|
c_schmitz (administrator) 2011-03-28 02:27 |
Starmonkey, do you see a way to resolve the '/admin' issue I talked about? |
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 => |
| Copyright © 2000 - 2013 MantisBT Team |