Commit a43ca5cb authored by James William's avatar James William Committed by Robert Lyon

Bug 1799933: Fixing dwoo template issue for windows

behatnotneeded

Change-Id: I69f4eaa13630cd127b173098132d7defdde53917
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent 2ac68757
...@@ -38,13 +38,3 @@ composer dump-autoload -o ...@@ -38,13 +38,3 @@ composer dump-autoload -o
Then remove the hashes from the auto-generated /vendor files: E.g. Then remove the hashes from the auto-generated /vendor files: E.g.
ComposerAutoloaderInit26e38f1cfb40040c9ff6097c09aee6d7::getLoader(); ComposerAutoloaderInit26e38f1cfb40040c9ff6097c09aee6d7::getLoader();
becomes ComposerAutoloaderInit::getLoader(); becomes ComposerAutoloaderInit::getLoader();
I found a bug in /Dwoo/Template/Str.php
This looks like a check for Windows OS, but 0 in strpos is a position,
so it runs if WIN is not in position 0. I changed it to false to stop
the following error on upgrade:
Unable to chmod /var/lib/maharadata/1704stable/dwoo/compile/raw/var/ to 511:
Array, referer: http://mahara/admin/upgrade.php
line 524: if (strpos(PHP_OS, 'WIN') !== 0 && $baseDir !== null) {}
replaced with:
if (strpos(PHP_OS, 'WIN') !== false && $baseDir !== null) {
\ No newline at end of file
...@@ -519,9 +519,14 @@ class Str implements ITemplate ...@@ -519,9 +519,14 @@ class Str implements ITemplate
} }
usleep(20); usleep(20);
} }
/**
* The following code doesn't seem to work anymore for WIN or non-WIN OS
* so will comment out - if you are having trouble with setting up dataroot compile paths
* try uncommenting this
*/
/*
// enforce the correct mode for all directories created // enforce the correct mode for all directories created
if (strpos(PHP_OS, 'WIN') !== false && $baseDir !== null) { if (preg_match('/WIN/', PHP_OS) && $baseDir !== null) {
$path = strtr(str_replace($baseDir, '', $path), '\\', '/'); $path = strtr(str_replace($baseDir, '', $path), '\\', '/');
$folders = explode('/', trim($path, '/')); $folders = explode('/', trim($path, '/'));
foreach ($folders as $folder) { foreach ($folders as $folder) {
...@@ -531,5 +536,6 @@ class Str implements ITemplate ...@@ -531,5 +536,6 @@ class Str implements ITemplate
} }
} }
} }
*/
} }
} }
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