From d44e9e508ec63aa6ea1767ccc463811898b1c233 Mon Sep 17 00:00:00 2001 From: Sebastian Berm Date: Thu, 13 Jul 2017 12:13:49 +0200 Subject: [PATCH 1/2] PHP 7 compatibility Update to make sure this is more compatible with newer apps --- phpagi-asmanager.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/phpagi-asmanager.php b/phpagi-asmanager.php index 856fde0..670987e 100644 --- a/phpagi-asmanager.php +++ b/phpagi-asmanager.php @@ -97,6 +97,11 @@ class AGI_AsteriskManager * @var boolean */ private $_logged_in = FALSE; + + public function setPagi(&$agi) + { + $this->pagi = $agi; + } /** * Constructor @@ -104,7 +109,7 @@ class AGI_AsteriskManager * @param string $config is the name of the config file to parse or a parent agi from which to read the config * @param array $optconfig is an array of configuration vars and vals, stuffed into $this->config['asmanager'] */ - function AGI_AsteriskManager($config=NULL, $optconfig=array()) + function __construct($config=NULL, $optconfig=array()) { // load config if(!is_null($config) && file_exists($config)) From 2993fb3ea64c0d86fe0a36c911db671d46e15050 Mon Sep 17 00:00:00 2001 From: Sebastian Berm Date: Thu, 13 Jul 2017 12:16:59 +0200 Subject: [PATCH 2/2] PHP 7 compatibility Trying to access private pagi variable is not possible. So added a setter for this. --- phpagi.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpagi.php b/phpagi.php index 7b2002a..56cc57d 100644 --- a/phpagi.php +++ b/phpagi.php @@ -1550,7 +1550,7 @@ function say_punctuation($text, $escape_digits='', $frequency=8000) function &new_AsteriskManager() { $this->asm = new AGI_AsteriskManager(NULL, $this->config); - $this->asm->pagi =& $this; + $this->asm->setPagi($this); $this->config =& $this->asm->config; return $this->asm; }