8
0
Fork 0

Improve windows support, fixes #264, #298 and #307

Dieser Commit ist enthalten in:
Stéphane Goetz 2015-08-15 16:31:36 +02:00
Ursprung edb670ba3e
Commit dc1965a2e7
4 geänderte Dateien mit 17 neuen und 5 gelöschten Zeilen

Datei anzeigen

@ -490,6 +490,11 @@ The `web.config` needs an entry for `<rewrite>` under `<system.webServer>`:
To use clean URLs on IIS 6, you will need to use a custom URL rewrite module, such as [URL Rewriter](http://urlrewriter.net/).
## Known Issues
- __Windows UTF-8 files support__ Files with UTF-8 characters cannot be handled on windows, this issue has no known fix yet.
## Support
If you need help using Daux.io, or have found a bug, please create an issue on the <a href="https://github.com/justinwalsh/daux.io/issues" target="_blank">GitHub repo</a>.

Datei anzeigen

@ -59,10 +59,13 @@ class GeneratorHelper
$dir = opendir($source);
while (false !== ($file = readdir($dir))) {
if ($file != '.' && $file != '..') {
if (is_dir($source . '/' . $file)) {
static::copyRecursive($source . '/' . $file, $destination . '/' . $file);
if (is_dir($source . DIRECTORY_SEPARATOR . $file)) {
static::copyRecursive(
$source . DIRECTORY_SEPARATOR . $file,
$destination . DIRECTORY_SEPARATOR . $file
);
} else {
copy($source . '/' . $file, $destination . '/' . $file);
copy($source . DIRECTORY_SEPARATOR . $file, $destination . DIRECTORY_SEPARATOR . $file);
}
}
}

Datei anzeigen

@ -71,7 +71,11 @@ class Server
$this->daux = $daux;
$this->host = $_SERVER['HTTP_HOST'];
$this->base_url = $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']);
// The path has a special treatment on windows, revert the slashes
$dir = dirname($_SERVER['PHP_SELF']);
$this->base_url = $_SERVER['HTTP_HOST'] . (DIRECTORY_SEPARATOR == "\\"? str_replace($dir,"\\","/") : $dir);
$t = strrpos($this->base_url, '/index.php');
if ($t != false) {
$this->base_url = substr($this->base_url, 0, $t);

Datei anzeigen

@ -98,7 +98,7 @@ class Builder
*/
protected static function getFilename($file)
{
$parts = explode('/', $file);
$parts = explode(DIRECTORY_SEPARATOR, $file);
return end($parts);
}