Commit 9d554c02 authored by Robert Lyon's avatar Robert Lyon
Browse files

Bug 1816840: Adjustments to dwoo library to fix unserialize problem



behatnotneeded

Change-Id: I5c219529ab0a5d193b6cbaf20207a76dec752515
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent 6dbc374d
...@@ -38,3 +38,9 @@ composer dump-autoload -o ...@@ -38,3 +38,9 @@ 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();
Additional changes:
The Dwoo plugin is being unmaintained again so we need also make any
changes committed to their master branch
https://github.com/dwoo-project/dwoo/compare/1.3.7...master
...@@ -71,7 +71,7 @@ class Loader implements ILoader ...@@ -71,7 +71,7 @@ class Loader implements ILoader
if (file_exists($cacheFile)) { if (file_exists($cacheFile)) {
$chachedClassPath = unserialize(file_get_contents($cacheFile)); $chachedClassPath = @unserialize(file_get_contents($cacheFile));
if (is_array($chachedClassPath)) { if (is_array($chachedClassPath)) {
$this->classPath = $chachedClassPath + $this->classPath; $this->classPath = $chachedClassPath + $this->classPath;
...@@ -180,9 +180,15 @@ class Loader implements ILoader ...@@ -180,9 +180,15 @@ class Loader implements ILoader
$cacheFile = $this->cacheDir . 'classpath-' . substr(strtr($pluginDir, '/\\:' . PATH_SEPARATOR, '----'), $cacheFile = $this->cacheDir . 'classpath-' . substr(strtr($pluginDir, '/\\:' . PATH_SEPARATOR, '----'),
strlen($pluginDir) > 80 ? - 80 : 0) . '.d' . Core::RELEASE_TAG . '.php'; strlen($pluginDir) > 80 ? - 80 : 0) . '.d' . Core::RELEASE_TAG . '.php';
$this->paths[$pluginDir] = $cacheFile; $this->paths[$pluginDir] = $cacheFile;
$chachedClassPath = null;
if (file_exists($cacheFile)) { if (file_exists($cacheFile)) {
$classpath = file_get_contents($cacheFile); $chachedClassPath = @unserialize(file_get_contents($cacheFile));
$this->classPath = unserialize($classpath) + $this->classPath; }
if (is_array($chachedClassPath)) {
$this->classPath = $chachedClassPath + $this->classPath;
} else { } else {
$this->rebuildClassPathCache($pluginDir, $cacheFile); $this->rebuildClassPathCache($pluginDir, $cacheFile);
} }
......
...@@ -60,8 +60,7 @@ class PluginIf extends BlockPlugin implements ICompilableBlock, IElseable ...@@ -60,8 +60,7 @@ class PluginIf extends BlockPlugin implements ICompilableBlock, IElseable
{ {
$p = array(); $p = array();
reset($params); foreach($params as $k => $v) {
while (list($k, $v) = each($params)) {
$v = (string)$v; $v = (string)$v;
if (substr($v, 0, 1) === '"' || substr($v, 0, 1) === '\'') { if (substr($v, 0, 1) === '"' || substr($v, 0, 1) === '\'') {
$vmod = strtolower(substr($v, 1, - 1)); $vmod = strtolower(substr($v, 1, - 1));
......
...@@ -92,7 +92,7 @@ class PluginTextformat extends BlockPlugin ...@@ -92,7 +92,7 @@ class PluginTextformat extends BlockPlugin
"\r" "\r"
), "\n", $this->buffer)); ), "\n", $this->buffer));
while (list($i) = each($pgs)) { foreach($pgs as $i => $v) {
if (empty($pgs[$i])) { if (empty($pgs[$i])) {
continue; continue;
} }
......
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