Hylax: Fix call-time-pass-by-reference
authorBen Klang <ben@alkaloid.net>
Thu, 7 Jan 2010 03:27:02 +0000 (22:27 -0500)
committerBen Klang <ben@alkaloid.net>
Thu, 7 Jan 2010 15:56:26 +0000 (10:56 -0500)
hylax/folder.php
hylax/lib/Driver.php
hylax/lib/Hylax.php
hylax/lib/Storage.php
hylax/lib/base.php
hylax/scripts/fax_create.php
hylax/scripts/fax_save_recv_data.php
hylax/summary.php
hylax/view.php

index f5f209e..410a382 100644 (file)
@@ -86,7 +86,7 @@ foreach ($base_folders as $key => $value) {
 }
 
 /* Set up template. */
-$template = &new Horde_Template();
+$template = new Horde_Template();
 if ($folder == 'archive') {
     $template->set('folder_name', $path);
 } else {
index 499ad35..a6794cf 100644 (file)
@@ -50,7 +50,7 @@ class Hylax_Driver {
         include_once dirname(__FILE__) . '/Driver/' . $driver . '.php';
         $class = 'Hylax_Driver_' . $driver;
         if (class_exists($class)) {
-            $hylax = &new $class($params);
+            $hylax = new $class($params);
             return $hylax;
         } else {
             Horde::fatal(PEAR::raiseError(sprintf(_("No such backend \"%s\" found"), $driver)), __FILE__, __LINE__);
index 1d92992..c98bd9a 100644 (file)
@@ -47,7 +47,7 @@ class Hylax {
 
         /* Get the image. */
         require_once HYLAX_BASE . '/lib/Image.php';
-        $image = &new Hylax_Image();
+        $image = new Hylax_Image();
         $image->loadData($data);
         $image->getImage($page, $preview);
     }
@@ -58,7 +58,7 @@ class Hylax {
 
         /* Get the pdf. */
         require_once HYLAX_BASE . '/lib/Image.php';
-        $image = &new Hylax_Image();
+        $image = new Hylax_Image();
         $image->loadData($data);
         $image->getPDF();
     }
index fa58e3a..94a80ca 100644 (file)
@@ -90,7 +90,7 @@ class Hylax_Storage {
 
         /* Create a fax image object. */
         require_once HYLAX_BASE . '/lib/Image.php';
-        $image = &new Hylax_Image();
+        $image = new Hylax_Image();
         $image->loadData($data);
         if (empty($info['fax_pages'])) {
             $info['fax_pages'] = $image->getNumPages();
@@ -155,7 +155,7 @@ class Hylax_Storage {
         include_once dirname(__FILE__) . '/Storage/' . $driver . '.php';
         $class = 'Hylax_Storage_' . $driver;
         if (class_exists($class)) {
-            $storage = &new $class($params);
+            $storage = new $class($params);
             return $storage;
         } else {
             Horde::fatal(PEAR::raiseError(sprintf(_("No such backend \"%s\" found"), $driver)), __FILE__, __LINE__);
index 55962d3..fc01b6f 100644 (file)
  * $Horde: incubator/hylax/lib/base.php,v 1.16 2009/07/13 20:05:46 slusarz Exp $
  */
 
-// Check for a prior definition of HORDE_BASE (perhaps by an
-// auto_prepend_file definition for site customization).
+if (!defined('HYLAX_BASE')) {
+    define('HYLAX_BASE', dirname(__FILE__). '/..');
+}
+
 if (!defined('HORDE_BASE')) {
-    @define('HORDE_BASE', dirname(__FILE__) . '/../..');
+    /* If horde does not live directly under the app directory, the HORDE_BASE
+     * constant should be defined in config/horde.local.php. */
+    if (file_exists(HYLAX_BASE. '/config/horde.local.php')) {
+        include HYLAX_BASE . '/config/horde.local.php';
+    } else {
+        define('HORDE_BASE', HYLAX_BASE . '/..');
+    }
 }
 
 // Load the Horde Framework core, and set up inclusion paths.
index a502ded..03c06f8 100755 (executable)
@@ -22,7 +22,7 @@ if (!Horde_Cli::runningFromCLI()) {
 
 /* Load the CLI environment - make sure there's no time limit, init
  * some variables, etc. */
-$cli = &new Horde_Cli();
+$cli = new Horde_Cli();
 $cli->init();
 
 /* Create the fax information array. Set fax_type to 1 for outgoing. */
index 370d068..0ae2c26 100755 (executable)
@@ -22,7 +22,7 @@ if (!Horde_Cli::runningFromCLI()) {
 
 /* Load the CLI environment - make sure there's no time limit, init some
  * variables, etc. */
-$cli = &new Horde_Cli();
+$cli = new Horde_Cli();
 $cli->init();
 
 /* Get the arguments. The first argument is the filename from which the job ID
index 24a8c76..81569ad 100644 (file)
@@ -26,7 +26,7 @@ foreach ($outbox as $item) {
 }
 
 /* Set up actions. */
-$template = &new Horde_Template();
+$template = new Horde_Template();
 $template->set('in_faxes', $gateway->numFaxesIn());
 $template->set('out_faxes', $gateway->numFaxesOut());
 $template->set('inbox', $fmt_inbox, true);
index 429b45e..bf725fb 100644 (file)
@@ -40,7 +40,7 @@ $title = _("View Fax");
 $pages = Hylax::getPages($fax_id, $fax['fax_pages']);
 
 /* Set up template. */
-$template = &new Horde_Template();
+$template = new Horde_Template();
 $template->set('form', '');
 $template->set('pages', $pages);
 $template->set('menu', Hylax::getMenu('string'));