From 85cbcd1bbb28f57d2697c084bf4487ed13767849 Mon Sep 17 00:00:00 2001 From: Ben Klang Date: Fri, 8 Jan 2010 10:45:43 -0500 Subject: [PATCH] Hylax: Convert classes to PHP5 syntax --- hylax/lib/Driver.php | 10 +++++----- hylax/lib/Driver/hylafax.php | 26 +++++++++++++------------- hylax/lib/Driver/spandsp.php | 30 +++++++++++++++--------------- 3 files changed, 33 insertions(+), 33 deletions(-) diff --git a/hylax/lib/Driver.php b/hylax/lib/Driver.php index a6794cf2d..0a63020e5 100644 --- a/hylax/lib/Driver.php +++ b/hylax/lib/Driver.php @@ -14,16 +14,16 @@ */ class Hylax_Driver { - var $_params; + protected $_params; - function Hylax_Driver($params) + public function __construct($params) { global $conf; $this->_params = $params; } - function getFolder($folder, $path = null) + public function getFolder($folder, $path = null) { return $this->_getFolder($folder, $path); } @@ -39,7 +39,7 @@ class Hylax_Driver { * @return Hylax_Driver The newly created concrete Hylax_Driver * instance, or false on error. */ - function &factory($driver = null, $params = null) + public function &factory($driver = null, $params = null) { if (is_null($driver)) { $driver = $GLOBALS['conf']['fax']['driver']; @@ -74,7 +74,7 @@ class Hylax_Driver { * @return mixed The created concrete Hylax_Driver instance, or false on * error. */ - function &singleton($driver = null, $params = null) + public function &singleton($driver = null, $params = null) { static $instances; diff --git a/hylax/lib/Driver/hylafax.php b/hylax/lib/Driver/hylafax.php index 3050e55d0..8cedc8118 100644 --- a/hylax/lib/Driver/hylafax.php +++ b/hylax/lib/Driver/hylafax.php @@ -18,7 +18,7 @@ class Hylax_Driver_hylafax extends Hylax_Driver { var $_stat_cols = array(); var $_cmd = array(); - function Hylax_Driver_hylafax($params) + public function __construct($params) { parent::Hylax_Driver($params); @@ -27,7 +27,7 @@ class Hylax_Driver_hylafax extends Hylax_Driver { $this->_cmd = array('sendfax' => '/usr/bin/sendfax'); } - function send($number, $data, $time = null) + public function send($number, $data, $time = null) { $command = sprintf('%s -n -d %s', $this->_cmd['sendfax'], @@ -59,24 +59,24 @@ class Hylax_Driver_hylafax extends Hylax_Driver { return PEAR::raiseError(sprintf(_("Could not send fax. %s"), $output)); } - function numFaxesIn() + public function numFaxesIn() { //$inbox = $this->getInbox(); //return count($inbox); } - function numFaxesOut() + public function numFaxesOut() { //$outbox = $this->getOutbox(); //return count($outbox); } - function getInbox() + public function getInbox() { return $this->_getFolder('inbox'); } - function _getFolder($folder, $path = null) + public function _getFolder($folder, $path = null) { switch ($folder) { case 'inbox': @@ -97,7 +97,7 @@ class Hylax_Driver_hylafax extends Hylax_Driver { } } - function getJob($job_id, $folder, $path = null) + public function getJob($job_id, $folder, $path = null) { global $conf; @@ -127,7 +127,7 @@ class Hylax_Driver_hylafax extends Hylax_Driver { return $job; } - function getStatus($job_id) + public function getStatus($job_id) { static $send_q = array(); static $done_q = array(); @@ -160,7 +160,7 @@ class Hylax_Driver_hylafax extends Hylax_Driver { return ''; } - function _getParseSendJob($filename) + protected function _getParseSendJob($filename) { $job = array(); $job_file = file_get_contents($filename); @@ -179,7 +179,7 @@ class Hylax_Driver_hylafax extends Hylax_Driver { return $job; } - function getThumbs($job_id, $ps) + public function getThumbs($job_id, $ps) { if ($this->_vfs->exists(HYLAX_VFS_PATH, $job_id)) { /* Return thumb image list. */ @@ -192,7 +192,7 @@ class Hylax_Driver_hylafax extends Hylax_Driver { return array_keys($images); } - function imagesToVFS($job_id, $ps) + public function imagesToVFS($job_id, $ps) { global $conf; @@ -211,7 +211,7 @@ class Hylax_Driver_hylafax extends Hylax_Driver { return $this->_vfs->listFolder(HYLAX_VFS_PATH . '/' . $job_id, 'doc.png'); } - function _exec($cmd, $input = '') + protected function _exec($cmd, $input = '') { $spec = array(//0 => array('pipe', 'r'), 1 => array('pipe', 'w'), @@ -234,7 +234,7 @@ class Hylax_Driver_hylafax extends Hylax_Driver { return $result; } - function _parseFaxStat($result) + protected function _parseFaxStat($result) { $out = array(); $i = 0; diff --git a/hylax/lib/Driver/spandsp.php b/hylax/lib/Driver/spandsp.php index 8a12bb16e..2c7478069 100644 --- a/hylax/lib/Driver/spandsp.php +++ b/hylax/lib/Driver/spandsp.php @@ -14,11 +14,11 @@ */ class Hylax_Driver_spandsp extends Hylax_Driver { - var $_states = array(); - var $_stat_cols = array(); - var $_cmd = array(); + protected $_states = array(); + protected $_stat_cols = array(); + protected $_cmd = array(); - function Hylax_Driver_spandsp($params) + public function __construct($params) { parent::Hylax_Driver($params); @@ -26,7 +26,7 @@ class Hylax_Driver_spandsp extends Hylax_Driver { $this->_stat_cols = Hylax::getStatCols(); } - function send($number, $data, $time = null) + public function send($number, $data, $time = null) { /* Create a temporary file. */ $filename = sprintf("%s.fax", Horde::getTempFile('hylax')); @@ -37,7 +37,7 @@ class Hylax_Driver_spandsp extends Hylax_Driver { return $this->createCallFile($filename); } - function createCallFile($filename) + public function createCallFile($filename) { global $conf; @@ -59,24 +59,24 @@ class Hylax_Driver_spandsp extends Hylax_Driver { return PEAR::raiseError(sprintf(_("Could not send fax. %s"), $output)); } - function numFaxesIn() + public function numFaxesIn() { //$inbox = $this->getInbox(); //return count($inbox); } - function numFaxesOut() + public function numFaxesOut() { //$outbox = $this->getOutbox(); //return count($outbox); } - function getInbox() + public function getInbox() { // return $this->_getFolder('inbox'); } - function _getFolder($folder, $path = null) + protected function _getFolder($folder, $path = null) { switch ($folder) { case 'inbox': @@ -97,7 +97,7 @@ class Hylax_Driver_spandsp extends Hylax_Driver { } } - function getJob($job_id, $folder, $path = null) + public function getJob($job_id, $folder, $path = null) { global $conf; @@ -127,12 +127,12 @@ class Hylax_Driver_spandsp extends Hylax_Driver { return $job; } - function getStatus($job_id) + public function getStatus($job_id) { return null; } - function getThumbs($job_id, $ps) + public function getThumbs($job_id, $ps) { if ($this->_vfs->exists(HYLAX_VFS_PATH, $job_id)) { /* Return thumb image list. */ @@ -145,7 +145,7 @@ class Hylax_Driver_spandsp extends Hylax_Driver { return array_keys($images); } - function imagesToVFS($job_id, $ps) + public function imagesToVFS($job_id, $ps) { global $conf; @@ -164,7 +164,7 @@ class Hylax_Driver_spandsp extends Hylax_Driver { return $this->_vfs->listFolder(HYLAX_VFS_PATH . '/' . $job_id, 'doc.png'); } - function _exec($cmd, $input = '') + protected function _exec($cmd, $input = '') { $spec = array(//0 => array('pipe', 'r'), 1 => array('pipe', 'w'), -- 2.11.0