From 854e3d7508274d5ce3209120634b601e29974d0b Mon Sep 17 00:00:00 2001 From: Ben Klang Date: Wed, 6 Jan 2010 22:27:02 -0500 Subject: [PATCH] Hylax: Fix call-time-pass-by-reference --- hylax/folder.php | 2 +- hylax/lib/Driver.php | 2 +- hylax/lib/Hylax.php | 4 ++-- hylax/lib/Storage.php | 4 ++-- hylax/lib/base.php | 14 +++++++++++--- hylax/scripts/fax_create.php | 2 +- hylax/scripts/fax_save_recv_data.php | 2 +- hylax/summary.php | 2 +- hylax/view.php | 2 +- 9 files changed, 21 insertions(+), 13 deletions(-) diff --git a/hylax/folder.php b/hylax/folder.php index f5f209e69..410a382ee 100644 --- a/hylax/folder.php +++ b/hylax/folder.php @@ -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 { diff --git a/hylax/lib/Driver.php b/hylax/lib/Driver.php index 499ad3532..a6794cf2d 100644 --- a/hylax/lib/Driver.php +++ b/hylax/lib/Driver.php @@ -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__); diff --git a/hylax/lib/Hylax.php b/hylax/lib/Hylax.php index 1d92992fe..c98bd9a33 100644 --- a/hylax/lib/Hylax.php +++ b/hylax/lib/Hylax.php @@ -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(); } diff --git a/hylax/lib/Storage.php b/hylax/lib/Storage.php index fa58e3a58..94a80cad6 100644 --- a/hylax/lib/Storage.php +++ b/hylax/lib/Storage.php @@ -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__); diff --git a/hylax/lib/base.php b/hylax/lib/base.php index 55962d3ca..fc01b6f03 100644 --- a/hylax/lib/base.php +++ b/hylax/lib/base.php @@ -13,10 +13,18 @@ * $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. diff --git a/hylax/scripts/fax_create.php b/hylax/scripts/fax_create.php index a502ded3b..03c06f885 100755 --- a/hylax/scripts/fax_create.php +++ b/hylax/scripts/fax_create.php @@ -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. */ diff --git a/hylax/scripts/fax_save_recv_data.php b/hylax/scripts/fax_save_recv_data.php index 370d068f0..0ae2c262d 100755 --- a/hylax/scripts/fax_save_recv_data.php +++ b/hylax/scripts/fax_save_recv_data.php @@ -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 diff --git a/hylax/summary.php b/hylax/summary.php index 24a8c76fd..81569ad54 100644 --- a/hylax/summary.php +++ b/hylax/summary.php @@ -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); diff --git a/hylax/view.php b/hylax/view.php index 429b45ebd..bf725fbca 100644 --- a/hylax/view.php +++ b/hylax/view.php @@ -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')); -- 2.11.0