I have a long-term path problem while developing modules.
For instance I have the following project path http://localhost:8888/mylocalproject, which (on the production server) would be http://www.project.com.
Now each time I use global $base_url or other absolute paths it only returns me the http://localhost:8888/ not http://localhost:8888/mylocalproject. For instance if I want to handcraft a logout link will give me http://localhost:8888/user/logout which is wrong, since mylocalproject is excluded.
I have all the time to hack solutions like this
global $base_url;
$needle = "localhost";
if (strpos($_SERVER['REQUEST_URI'], $needle)) {
path = $base_url."/mylocalproject";
}
else {
path = $base_url;
}
Is there a Drupal standard solution for that?