Hylax: Convert classes to PHP5 syntax
authorBen Klang <ben@alkaloid.net>
Fri, 8 Jan 2010 15:45:43 +0000 (10:45 -0500)
committerBen Klang <ben@alkaloid.net>
Fri, 8 Jan 2010 15:45:43 +0000 (10:45 -0500)
hylax/lib/Driver.php
hylax/lib/Driver/hylafax.php
hylax/lib/Driver/spandsp.php

index a6794cf..0a63020 100644 (file)
  */
 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;
 
index 3050e55..8cedc81 100644 (file)
@@ -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;
index 8a12bb1..2c74780 100644 (file)
  */
 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'),