22855 Posts in 9971 Topics by 2805 members
|Go to End|
10 August 2013 at 2:15pm
Hi guys, I was having a little problem implementing Static Publisher my local Windows machine. The error was a notice that BASE_URL was not being defined and so the static-main.php script jumped to main.php.
My solution was to replace line 45 of static-main.php with this:
$urlSegmentToRemove = str_replace('\\', '/', str_replace('\\\\', '\\', substr($path, strlen(BASE_PATH))));
I don't know if it's the cleaner way to do it but I got it to work that way and doesn't seem to mess anything on a Linux env.
If you have any comments to improve this, they're welcome. Otherwise I hope this can help someone having the same issues.
11 August 2013 at 5:53pm
Thanks, have you submitted the fix via Github for review? No need to clone / fork you could edit the file by hand through the GUI.
The only way to make it cleaner would be to use DIRECTORY_SEPARATOR so that we handle both / and \ (which I assume was your fix?)
12 August 2013 at 2:41am
Willr, I didn't use DIRECTORY_SEPARATOR on purpouse as to force the path to be normalized using foward slash, since it also works on windows most of the times or at least in this case.
I'll submit it for review.
|Go to Top|