Rename the EventSocket class.

This commit is contained in:
markjcrane
2016-04-02 19:23:16 -06:00
parent 7fa92ef54f
commit 51ea37ed18
6 changed files with 13 additions and 14 deletions

View File

@@ -111,7 +111,7 @@ if (!$included) {
$fax_cover_font = $_SESSION['fax']['cover_font']['text'];
}
else{
require_once "resources/classes/EventSocket.php";
require_once "resources/classes/event_socket.php";
}
if(!function_exists('correct_path')) {

View File

@@ -25,7 +25,7 @@
*/
require_once "root.php";
require_once "resources/classes/EventSocket.php";
require_once "resources/classes/event_socket.php";
//define the install class
class detect_switch {
@@ -144,7 +144,7 @@ require_once "resources/classes/EventSocket.php";
}
protected function connect_event_socket(){
$esl = new EventSocket;
$esl = new event_socket;
if ($esl->connect($this->event_host, $this->event_port, $this->event_password)) {
$this->event_socket = $esl->reset_fp();
return true;
@@ -153,7 +153,7 @@ require_once "resources/classes/EventSocket.php";
}
protected function event_socket_request($cmd) {
$esl = new EventSocket($this->event_socket);
$esl = new event_socket($this->event_socket);
$result = $esl->request($cmd);
$esl->reset_fp();
return $result;

View File

@@ -348,7 +348,7 @@ include "root.php";
}
protected function restart_switch() {
$esl = new EventSocket;
$esl = new event_socket;
if(!$esl->connect($this->global_settings->switch_event_host(), $this->global_settings->switch_event_port(), $this->global_settings->switch_event_password())) {
throw new Exception("Failed to connect to switch");
}

View File

@@ -37,13 +37,12 @@ class Buffer {
return $tmp;
}
}
//$b = new Buffer;
//$b->append("hello\nworld\n");
//print($b->read_line());
//print($b->read_line());
class EventSocket {
class event_socket {
private $buffer;
private $fp;
@@ -173,7 +172,7 @@ class EventSocket {
/*
function event_socket_create($host, $port, $password) {
$esl = new EventSocket;
$esl = new event_socket;
if ($esl->connect($host, $port, $password)) {
return $esl->reset_fp();
}
@@ -181,14 +180,14 @@ function event_socket_create($host, $port, $password) {
}
function event_socket_request($fp, $cmd) {
$esl = new EventSocket($fp);
$esl = new event_socket($fp);
$result = $esl->request($cmd);
$esl->reset_fp();
return $result;
}
*/
// $esl = new EventSocket;
// $esl = new event_socket;
// $esl->connect('127.0.0.1', 8021, 'ClueCon');
// print($esl->request('api sofia status'));

View File

@@ -111,7 +111,7 @@ function load_extensions() {
load_extensions();
function event_socket_create($host, $port, $password) {
$esl = new EventSocket;
$esl = new event_socket;
if ($esl->connect($host, $port, $password)) {
return $esl->reset_fp();
}
@@ -119,7 +119,7 @@ function event_socket_create($host, $port, $password) {
}
function event_socket_request($fp, $cmd) {
$esl = new EventSocket($fp);
$esl = new event_socket($fp);
$result = $esl->request($cmd);
$esl->reset_fp();
return $result;
@@ -142,7 +142,7 @@ function event_socket_request_cmd($cmd) {
unset ($prep_statement);
}
$esl = new EventSocket;
$esl = new event_socket;
if (!$esl->connect($event_socket_ip_address, $event_socket_port, $event_socket_password)) {
return false;
}

View File

@@ -301,7 +301,7 @@ if(!function_exists('fax_split_dtmf')) {
//includes
if (!defined('STDIN')) { include "root.php"; }
require_once "resources/require.php";
include "resources/classes/EventSocket.php";
include "resources/classes/event_socket.php";
include "resources/phpmailer/class.phpmailer.php";
include "resources/phpmailer/class.smtp.php"; // optional, gets called from within class.phpmailer.php if not already loaded