From d8183ce9fe14e0c02e4c66b904b4a43cc4b9d7dc Mon Sep 17 00:00:00 2001 From: John Volk Date: Mon, 14 Aug 2023 19:37:46 -0400 Subject: [PATCH] Add CompareArrays helper function to help with nested arrays --- sccpManTraits/helperFunctions.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sccpManTraits/helperFunctions.php b/sccpManTraits/helperFunctions.php index fdbdd42..17d33f6 100644 --- a/sccpManTraits/helperFunctions.php +++ b/sccpManTraits/helperFunctions.php @@ -288,7 +288,13 @@ trait helperfunctions { return $sccp_conf_init; } - + public function compareArrays(array $a, array $b){ + if (array_diff_assoc($a, $b)===[]) { + return 0; + } + return ($a>$b)?1:-1; + } + public function checkTftpMapping(){ exec('in.tftpd -V', $tftpInfo); $info['TFTP Server'] = array('Version' => 'Not Found', 'about' => 'Mapping not available');