diff options
author | Pietro Cerutti <gahr@FreeBSD.org> | 2018-10-24 17:29:15 +0800 |
---|---|---|
committer | Pietro Cerutti <gahr@FreeBSD.org> | 2018-10-24 17:29:15 +0800 |
commit | 37ef78d3ca7eef5b60f0cb8793a585b07313da69 (patch) | |
tree | a33bee52c26dc2109015646f64f7f70cb6106f3a /www/baikal | |
parent | 7c8b104aea19918811423a0271f96311ab14ed13 (diff) | |
download | freebsd-ports-gnome-37ef78d3ca7eef5b60f0cb8793a585b07313da69.tar.gz freebsd-ports-gnome-37ef78d3ca7eef5b60f0cb8793a585b07313da69.tar.zst freebsd-ports-gnome-37ef78d3ca7eef5b60f0cb8793a585b07313da69.zip |
www/baikal: Upgrade each() to foreach(), the former is deprecated in php 7.2
Obtained from: https://github.com/sabre-io/Baikal/pull/717
Diffstat (limited to 'www/baikal')
-rw-r--r-- | www/baikal/Makefile | 2 | ||||
-rw-r--r-- | www/baikal/files/patch-issue-717 | 93 |
2 files changed, 94 insertions, 1 deletions
diff --git a/www/baikal/Makefile b/www/baikal/Makefile index 514f0e8a9c93..1a5dfd1493df 100644 --- a/www/baikal/Makefile +++ b/www/baikal/Makefile @@ -3,7 +3,7 @@ PORTNAME= baikal PORTVERSION= 0.4.6 -PORTREVISION= 4 +PORTREVISION= 5 CATEGORIES= www MASTER_SITES= https://github.com/fruux/Baikal/releases/download/${PORTVERSION}/ diff --git a/www/baikal/files/patch-issue-717 b/www/baikal/files/patch-issue-717 new file mode 100644 index 000000000000..399718c9892a --- /dev/null +++ b/www/baikal/files/patch-issue-717 @@ -0,0 +1,93 @@ +diff --git Core/Frameworks/Flake/Controller/Cli.php Core/Frameworks/Flake/Controller/Cli.php +index 0fcd10c3..6430b1c3 100644 +--- Core/Frameworks/Flake/Controller/Cli.php ++++ Core/Frameworks/Flake/Controller/Cli.php +@@ -39,9 +39,8 @@ function render() { + } + + function execute() { +- reset($this->aSequence); +- while (list($sKey, ) = each($this->aSequence)) { +- $this->aSequence[$sKey]["block"]->execute(); ++ foreach ($this->aSequence as $aStep) { ++ $aStep["block"]->execute(); + } + } + +diff --git Core/Frameworks/Flake/Core/Render/Container.php Core/Frameworks/Flake/Core/Render/Container.php +index 5f0662cf..ae668151 100644 +--- Core/Frameworks/Flake/Core/Render/Container.php ++++ Core/Frameworks/Flake/Core/Render/Container.php +@@ -58,23 +58,20 @@ function render() { + } + + function execute() { +- reset($this->aSequence); +- while (list($sKey, ) = each($this->aSequence)) { +- $this->aSequence[$sKey]["block"]->execute(); ++ foreach ($this->aSequence as $aStep) { ++ $aStep["block"]->execute(); + } + } + + protected function renderBlocks() { + $aHtml = []; +- reset($this->aSequence); +- while (list($sKey, ) = each($this->aSequence)) { ++ foreach ($this->aSequence as $sKey => $aStep) { + $this->aSequence[$sKey]["rendu"] = $this->aSequence[$sKey]["block"]->render(); + } + + $aHtml = []; +- reset($this->aBlocks); +- while (list($sZone, ) = each($this->aBlocks)) { +- $aHtml[$sZone] = implode("", $this->aBlocks[$sZone]); ++ foreach ($this->aBlocks as $sZone => $aBlock) { ++ $aHtml[$sZone] = implode("", $aBlock); + } + + reset($aHtml); +diff --git Core/Frameworks/Flake/Framework.php Core/Frameworks/Flake/Framework.php +index adc5c781..50b9c12e 100644 +--- Core/Frameworks/Flake/Framework.php ++++ Core/Frameworks/Flake/Framework.php +@@ -122,7 +122,7 @@ static function bootstrap() { + if (isset($_COOKIE) && is_array($_COOKIE)) { $process[] = &$_COOKIE;} + if (isset($_REQUEST) && is_array($_REQUEST)) { $process[] = &$_REQUEST;} + +- while (list($key, $val) = each($process)) { ++ foreach ($process as $key => $val) { + foreach ($val as $k => $v) { + unset($process[$key][$k]); + if (is_array($v)) { +diff --git Core/Frameworks/Flake/Util/Router.php Core/Frameworks/Flake/Util/Router.php +index 15462cb3..02b109d7 100644 +--- Core/Frameworks/Flake/Util/Router.php ++++ Core/Frameworks/Flake/Util/Router.php +@@ -59,10 +59,9 @@ static function getRouteForController($sController) { + + $aRoutes = $GLOBALS["ROUTER"]::getRoutes(); + +- reset($aRoutes); +- while (list($sRoute, ) = each($aRoutes)) { +- if (str_replace("\\Route", "\\Controller", $aRoutes[$sRoute]) === $sController) { +- return $sRoute; ++ foreach ($aRoutes as $sKey => $sRoute) { ++ if (str_replace("\\Route", "\\Controller", $sRoute) === $sController) { ++ return $sKey; + } + } + +diff --git Core/Frameworks/Flake/Util/Tools.php Core/Frameworks/Flake/Util/Tools.php +index 21bf8502..ca371cc3 100644 +--- Core/Frameworks/Flake/Util/Tools.php ++++ Core/Frameworks/Flake/Util/Tools.php +@@ -75,7 +75,7 @@ static function view_array($array_in) { + if (is_array($array_in)) { + $result = '<table border="1" cellpadding="1" cellspacing="0" bgcolor="white">'; + if (!count($array_in)) {$result .= '<tr><td><font face="Verdana,Arial" size="1"><b>' . htmlspecialchars("EMPTY!") . '</b></font></td></tr>';} +- while (list($key, $val) = each($array_in)) { ++ foreach ($array_in as $key => $val) { + $result .= '<tr><td valign="top"><font face="Verdana,Arial" size="1">' . htmlspecialchars((string)$key) . '</font></td><td>'; + if (is_array($array_in[$key])) { + $result .= \Flake\Util\Tools::view_array($array_in[$key]); |