Commit e99a6096 authored by totten's avatar totten
Browse files

Merge branch 'windows' into 'master'

core#1643 - Prevent broken paths on windows during civicrm-setup

See merge request !2
parents 4ed87a90 543bd332
......@@ -220,8 +220,9 @@ abstract class AbstractAssetRule implements AssetRuleInterface {
* PHP-encoded expression for $path, relative to a `$baseDir` variable
*/
protected function exportPath($path, $cwd = NULL) {
// FIXME Windows, but don't add dep-hell
$isAbsolute = $path{0} === '/';
// This should work for both unix and windows. (Except an odd edge-case: Unix systems with relative paths that have a ":")
$len = strlen($path);
$isAbsolute = ($len > 0 && $path{0} === '/') || ($len > 1 && $path{1} === ':');
if (!$isAbsolute) {
return '$baseDir . ' . var_export('/' . $path, 1);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment