Commit 8b0737fd authored by Melissa Draper's avatar Melissa Draper
Browse files

Replace DIRECTORY_SEPERATOR with / for windows compatability



bug #643503

Change-Id: I74bb2e6a5e431103d40561baea39914346e5f7a6
Signed-off-by: default avatarMelissa Draper <melissa@catalyst.net.nz>
parent 7a121df6
...@@ -231,7 +231,7 @@ class LeapImportBlog extends LeapImportArtefactPlugin { ...@@ -231,7 +231,7 @@ class LeapImportBlog extends LeapImportArtefactPlugin {
$importer->trace($blogpostlink); $importer->trace($blogpostlink);
$pathname = urldecode((string)$blogpostlink['href']); $pathname = urldecode((string)$blogpostlink['href']);
$dir = dirname($importer->get('filename')); $dir = dirname($importer->get('filename'));
$pathname = $dir . DIRECTORY_SEPARATOR . $pathname; $pathname = $dir . '/' . $pathname;
if (!file_exists($pathname)) { if (!file_exists($pathname)) {
return false; return false;
} }
......
...@@ -276,7 +276,7 @@ class LeapImportFile extends LeapImportArtefactPlugin { ...@@ -276,7 +276,7 @@ class LeapImportFile extends LeapImportArtefactPlugin {
$data->parent = $parent; $data->parent = $parent;
} }
$pathname = $dir . DIRECTORY_SEPARATOR . $pathname; $pathname = $dir . '/' . $pathname;
// This API sucks, but that's not my problem // This API sucks, but that's not my problem
if (!$id = ArtefactTypeFile::save_file($pathname, $data, $importer->get('usrobj'), true)) { if (!$id = ArtefactTypeFile::save_file($pathname, $data, $importer->get('usrobj'), true)) {
......
...@@ -69,7 +69,7 @@ $CFG = (object)array_merge((array)$cfg, (array)$CFG); ...@@ -69,7 +69,7 @@ $CFG = (object)array_merge((array)$cfg, (array)$CFG);
// Fix up paths in $CFG // Fix up paths in $CFG
foreach (array('docroot', 'dataroot') as $path) { foreach (array('docroot', 'dataroot') as $path) {
$CFG->{$path} = (substr($CFG->{$path}, -1) != DIRECTORY_SEPARATOR) ? $CFG->{$path} . DIRECTORY_SEPARATOR : $CFG->{$path}; $CFG->{$path} = (substr($CFG->{$path}, -1) != '/') ? $CFG->{$path} . '/' : $CFG->{$path};
} }
// xmldb stuff // xmldb stuff
......
...@@ -1364,7 +1364,7 @@ class PluginImportLeap extends PluginImport { ...@@ -1364,7 +1364,7 @@ class PluginImportLeap extends PluginImport {
$this->trace($link); $this->trace($link);
$pathname = urldecode((string)$link['href']); $pathname = urldecode((string)$link['href']);
$dir = dirname($this->get('filename')); $dir = dirname($this->get('filename'));
$pathname = $dir . DIRECTORY_SEPARATOR . $pathname; $pathname = $dir . '/' . $pathname;
if (!file_exists($pathname)) { if (!file_exists($pathname)) {
return false; return false;
} }
......
...@@ -65,7 +65,7 @@ $CFG = (object)array_merge((array)$cfg, (array)$CFG); ...@@ -65,7 +65,7 @@ $CFG = (object)array_merge((array)$cfg, (array)$CFG);
// Fix up paths in $CFG // Fix up paths in $CFG
foreach (array('docroot', 'dataroot') as $path) { foreach (array('docroot', 'dataroot') as $path) {
$CFG->{$path} = (substr($CFG->{$path}, -1) != DIRECTORY_SEPARATOR) ? $CFG->{$path} . DIRECTORY_SEPARATOR : $CFG->{$path}; $CFG->{$path} = (substr($CFG->{$path}, -1) != '/') ? $CFG->{$path} . '/' : $CFG->{$path};
} }
// xmldb stuff // xmldb stuff
......
...@@ -720,7 +720,7 @@ function rmdirr($dirname) ...@@ -720,7 +720,7 @@ function rmdirr($dirname)
} }
// Recurse // Recurse
rmdirr($dirname . DIRECTORY_SEPARATOR . $entry); rmdirr($dirname . '/' . $entry);
} }
// Clean up // Clean up
......
...@@ -15,8 +15,8 @@ function dirsize($path) ...@@ -15,8 +15,8 @@ function dirsize($path)
$size = 0; $size = 0;
// Trailing slash // Trailing slash
if (substr($path, -1, 1) !== DIRECTORY_SEPARATOR) { if (substr($path, -1, 1) !== '/') {
$path .= DIRECTORY_SEPARATOR; $path .= '/';
} }
// Sanity check // Sanity check
...@@ -43,7 +43,7 @@ function dirsize($path) ...@@ -43,7 +43,7 @@ function dirsize($path)
// Get list of directories or filesizes // Get list of directories or filesizes
$path = $queue[$i] . $entry; $path = $queue[$i] . $entry;
if (is_dir($path)) { if (is_dir($path)) {
$path .= DIRECTORY_SEPARATOR; $path .= '/';
$subdirs[] = $path; $subdirs[] = $path;
} elseif (is_file($path)) { } elseif (is_file($path)) {
$size += filesize($path); $size += filesize($path);
......
...@@ -726,7 +726,7 @@ class Theme { ...@@ -726,7 +726,7 @@ class Theme {
private function _get_path($filename, $all, $plugindirectory, $returnprefix) { private function _get_path($filename, $all, $plugindirectory, $returnprefix) {
$list = array(); $list = array();
$plugindirectory = ($plugindirectory && substr($plugindirectory, -1) != DIRECTORY_SEPARATOR) ? $plugindirectory . DIRECTORY_SEPARATOR : $plugindirectory; $plugindirectory = ($plugindirectory && substr($plugindirectory, -1) != '/') ? $plugindirectory . '/' : $plugindirectory;
foreach ($this->inheritance as $themedir) { foreach ($this->inheritance as $themedir) {
if (is_readable(get_config('docroot') . $plugindirectory . 'theme/' . $themedir . '/static/' . $filename)) { if (is_readable(get_config('docroot') . $plugindirectory . 'theme/' . $themedir . '/static/' . $filename)) {
......
Markdown is supported
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