From d8de4bfb0284d8200b681421460560346a550e95 Mon Sep 17 00:00:00 2001 From: azett Date: Wed, 3 Oct 2018 13:53:40 +0200 Subject: [PATCH] Replaced some more class-named constructors (and calls to them). Removed unused and/or commented code. Replaced calls to deprecated each() with array_shift() (not completely done yet, still some more to fix!). Replaced call to deprecated create_function() with real callback function. --- admin/panels/maintain/admin.maintain.php | 4 ++-- admin/panels/themes/admin.themes.php | 2 +- admin/panels/themes/admin.themes.style.php | 2 +- .../panels/uploader/admin.uploader.browse.php | 2 +- fp-includes/core/core.bplustree.class.php | 22 +------------------ fp-includes/core/core.fpdb.class.php | 2 +- fp-includes/core/core.users.php | 2 +- fp-includes/core/core.utils.php | 2 +- fp-includes/core/core.widgets.php | 2 +- fp-includes/core/function.list_categories.php | 3 --- fp-includes/smarty/Smarty_Compiler.class.php | 16 +++++++------- .../plugins/function.list_categories.php | 3 --- search.php | 2 +- 13 files changed, 19 insertions(+), 45 deletions(-) diff --git a/admin/panels/maintain/admin.maintain.php b/admin/panels/maintain/admin.maintain.php index 587b622..04180c4 100755 --- a/admin/panels/maintain/admin.maintain.php +++ b/admin/panels/maintain/admin.maintain.php @@ -21,7 +21,7 @@ //$this->smarty = $GLOBALS['_FP_SMARTY']; $this->_directory = CACHE_DIR; - parent::fs_filelister(); + parent::__construct(); } function _checkFile($directory, $file) { @@ -42,7 +42,7 @@ function __construct() { $this->index = entry_init(); - parent::fs_filelister(); + parent::__construct(); } function _checkFile($directory, $file) { diff --git a/admin/panels/themes/admin.themes.php b/admin/panels/themes/admin.themes.php index aca505d..9ef7dc4 100644 --- a/admin/panels/themes/admin.themes.php +++ b/admin/panels/themes/admin.themes.php @@ -10,7 +10,7 @@ if ($theme['version'] > 0.703) $this->actions['style'] = true; - parent::AdminPanel($smarty); + parent::__construct($smarty); } diff --git a/admin/panels/themes/admin.themes.style.php b/admin/panels/themes/admin.themes.style.php index e349ca1..36c4ed6 100644 --- a/admin/panels/themes/admin.themes.style.php +++ b/admin/panels/themes/admin.themes.style.php @@ -4,7 +4,7 @@ function __construct() { $this->_directory = THEMES_DIR . THE_THEME; - parent::fs_filelister(); + parent::__construct(); } function _checkFile($d, $f) { diff --git a/admin/panels/uploader/admin.uploader.browse.php b/admin/panels/uploader/admin.uploader.browse.php index 661d3ef..6daad8d 100644 --- a/admin/panels/uploader/admin.uploader.browse.php +++ b/admin/panels/uploader/admin.uploader.browse.php @@ -26,7 +26,7 @@ $this->thumburl = BLOG_BASEURL . 'admin.php?p=uploader&action=thumb&f='; - return parent::fs_filelister($d); + return parent::__construct($d); } function _checkFile($d, $f) { diff --git a/fp-includes/core/core.bplustree.class.php b/fp-includes/core/core.bplustree.class.php index e30df22..dfc9779 100755 --- a/fp-includes/core/core.bplustree.class.php +++ b/fp-includes/core/core.bplustree.class.php @@ -721,26 +721,6 @@ class BPlusTree_Node { } - /* - * mimics python's map(None, a, b) - * returns the list of (a,b) pairs - * where a is in list $a and b is in list $b - * - * - - function _oldpairs($a, $b) { - $c = array(); - reset($a); - reset($b); - while((list(,$v1) = each($a)) && - (list(,$v2) = each($b))) { - $c[] = array($v1, $v2); - } - return $c; - } - */ - - /** * mimic's python's map(None, a, b); * a, b must be of the same size @@ -1383,7 +1363,7 @@ class BPlusTree_Node { echo $indent, "seeks {", implode(", ", $this->indices),"}\n"; if (($flag & BPT_FLAG_INTERIOR) == BPT_FLAG_INTERIOR) { reset($this->indices); - while(list(,$i) = each($this->indices)) { + while($i = array_shift($this->indices)) { if ($i!=BPT_NULLSEEK) { // interior $n =& $this->getclone($i); diff --git a/fp-includes/core/core.fpdb.class.php b/fp-includes/core/core.fpdb.class.php index 1eba70b..e455b61 100644 --- a/fp-includes/core/core.fpdb.class.php +++ b/fp-includes/core/core.fpdb.class.php @@ -624,7 +624,7 @@ if (!$this->hasMore()) return false; - list($k,$id) = each($this->list); + $id = array_shift($this->list); $comment = comment_parse($this->entryid, $id); $couplet = array(&$id, &$comment); diff --git a/fp-includes/core/core.users.php b/fp-includes/core/core.users.php index 4458b3b..a87a33d 100755 --- a/fp-includes/core/core.users.php +++ b/fp-includes/core/core.users.php @@ -8,7 +8,7 @@ function bdb_entrylister() { $this->_cachefile = CACHE_DIR . 'userlist.php'; - parent::cache_filelister(); + parent::__construct(); } function _checkFile($directory, $file) { diff --git a/fp-includes/core/core.utils.php b/fp-includes/core/core.utils.php index e93a2c9..3bc668c 100644 --- a/fp-includes/core/core.utils.php +++ b/fp-includes/core/core.utils.php @@ -175,7 +175,7 @@ if (!function_exists('fnmatch')) { $string .= $outerldelim; - while (list(,$val) = each($array)) { + while ($val = array_shift($array)) { $string .= $rdelim; if (is_array($val)) { diff --git a/fp-includes/core/core.widgets.php b/fp-includes/core/core.widgets.php index 4360ff5..2363c97 100755 --- a/fp-includes/core/core.widgets.php +++ b/fp-includes/core/core.widgets.php @@ -45,7 +45,7 @@ do { $content = array(); - list(,$id) = each($this->_list[$hor]); + $id = array_shift($this->_list[$hor]); $newid=$id;# @list($newid, $params) = explode(":", $id); if (@$params) $params = explode(',', $params); else $params = array(); diff --git a/fp-includes/core/function.list_categories.php b/fp-includes/core/function.list_categories.php index d61e927..2353e13 100644 --- a/fp-includes/core/function.list_categories.php +++ b/fp-includes/core/function.list_categories.php @@ -20,7 +20,6 @@ function smarty_function_list_categories($params) //, &$smarty) 'selected' => array() ); - //list($catId) = each($categories); $cat_params = array_merge($cat_params, $params); // makese 'selected' an arr @@ -106,8 +105,6 @@ function do_print_categories_list(&$lines, &$indentstack, &$result, $params) { $cat_entry = $params['selected']; - //list($catId) = each($categories); - if (isset($params['type']) && ($params['type']=='form' || $params['type']=='check')) { $string = '