*/
require_once dirname(__FILE__) . '/lib/Application.php';
-$hylax = new Hylax_Application(array('init' => true));
+$hylax = Horde_Registry::appInit('hylax');
/* Load Cover Page templates */
require HYLAX_BASE . '/config/covers.php';
*/
require_once dirname(__FILE__) . '/lib/Application.php';
-$hylax = new Hylax_Application(array('init' => true));
+$hylax = Horde_Registry::appInit('hylax');
$folder = strtolower(Horde_Util::getFormData('folder', 'inbox'));
$path = Horde_Util::getFormData('path');
* did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
*/
-// FIXME: Do we need AUTH_HANDLER here?
-//@define('AUTH_HANDLER', true);
require_once dirname(__FILE__) . '/lib/Application.php';
-$hylax = new Hylax_Application(array('init' => true));
+$hylax = Horde_Registry::appInit('hylax', array('authentication' => 'none'));
$fax_id = Horde_Util::getFormData('fax_id');
$page = Horde_Util::getFormData('page');
$preview = Horde_Util::getFormData('preview');
/* Set up the cache object. */
-require_once 'Horde/Cache.php';
-$cache = &Horde_Cache::singleton($conf['cache']['driver'], Horde::getDriverConfig('cache', $conf['cache']['driver']));
-if (is_a($cache, 'PEAR_Error')) {
- Horde::fatal($cache, __FILE__, __LINE__);
-}
+$cache = Horde_Cache::singleton($conf['cache']['driver'], Horde::getDriverConfig('cache', $conf['cache']['driver']));
/* Call the get the image data using cache. */
$id = $fax_id . '_' . $page . ($preview ? '_p' : '');
*
* See the enclosed file COPYING for license information (GPL). If you
* did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
*/
if (!defined('HYLAX_BASE')) {
class Hylax_Application extends Horde_Registry_Application
{
+ public $version = 'H4 (0.1-git)';
+
public $gateway = null;
public $storage = null;
- function __construct($args = array())
+ protected function _init()
{
- if (!empty($args['init'])) {
-
- // Registry.
- $registry = &Horde_Registry::singleton();
- $GLOBALS['registry'] = &$registry;
-
- try {
- $registry->pushApp('hylax', !defined('AUTH_HANDLER'));
- } catch (Horde_Exception $e) {
- if ($e->getCode() == 'permission_denied') {
- Horde_Auth::authenticateFailure('hylax', $e);
- }
- Horde::fatal($e, __FILE__, __LINE__, false);
- }
-
- $conf = &$GLOBALS['conf'];
- define('HYLAX_TEMPLATES', $registry->get('templates'));
-
- /* Notification system. */
- $notification = &Horde_Notification::singleton();
- $notification->attach('status');
- $GLOBALS['notification'] = &$notification;
-
- /* Find the base file path of Hylax. */
- define('HYLAX_BASE', dirname(__FILE__) . '/..');
+ if (!defined('HYLAX_TEMPLATES')) {
+ define('HYLAX_TEMPLATES', $GLOBALS['registry']->get('templates'));
+ }
- /* Hylax Driver */
- $this->gateway = &Hylax_Driver::singleton($conf['fax']['driver'],
- $conf['fax']['params']);
+ /* Notification system. */
+ $notification = Horde_Notification::singleton();
+ $notification->attach('status');
+ $GLOBALS['notification'] = &$notification;
- /* Hylax storage driver. */
- $this->storage = &Hylax_Storage::singleton('sql', $conf['sql']);
+ /* Hylax Driver */
+ $this->gateway = Hylax_Driver::singleton($conf['fax']['driver'],
+ $conf['fax']['params']);
- /* Start compression, if requested. */
- Horde::compressOutput();
- }
+ /* Hylax storage driver. */
+ $this->storage = Hylax_Storage::singleton('sql', $conf['sql']);
}
- public function perms()
- {
- static $perms = array();
- if (!empty($perms)) {
- return $perms;
- }
-
- return $perms;
- }
}
}
/* Unserialize the gateway params. */
- require_once 'Horde/Serialize.php';
$gateway['gateway_params'] = Horde_Serialize::unserialize($gateway['gateway_params'], Horde_Serialize::UTF7_BASIC);
/* Unserialize the gateway send params. */
}
/* Serialize the gateway params. */
- require_once 'Horde/Serialize.php';
if (!empty($info['gateway_params'])) {
$info['gateway_params'] = Horde_Serialize::serialize($info['gateway_params'], Horde_Serialize::UTF7_BASIC);
} else {
}
/* Serialize the message params. */
- require_once 'Horde/Serialize.php';
$message_params = Horde_Serialize::serialize($message_params, Horde_Serialize::UTF7_BASIC);
$sql = 'INSERT INTO swoosh_messages (message_id, user_uid, gateway_id, message_batch_id, message_text, message_params, message_submitted) VALUES (?, ?, ?, ?, ?, ?, ?)';
*/
require_once dirname(__FILE__) . '/lib/Application.php';
-$hylax = new Hylax_Application(array('init' => true));
+$hylax = Horde_Registry::appInit('hylax');
$fax_id = Horde_Util::getFormData('fax_id');
$url = Horde_Util::getFormData('url', 'folder.php');
#!/usr/bin/php
<?php
-// No need for auth.
-@define('AUTH_HANDLER', true);
-
require_once dirname(__FILE__) . '/../lib/Application.php';
-$hylax = new Hylax_Application(array('init' => true));
+$hylax = Horde_Registry::appInit('hylax', array('authentication' => 'none'));
// Make sure no one runs this from the web.
if (!Horde_Cli::runningFromCLI()) {
#!/usr/bin/php
<?php
-// No need for auth.
-@define('AUTH_HANDLER', true);
-
require_once dirname(__FILE__) . '/../lib/Application.php';
-$hylax = new Hylax_Application(array('init' => true));
+$hylax = Horde_Registry::appInit('hylax', array('authentication' => 'none'));
// Make sure no one runs this from the web.
if (!Horde_Cli::runningFromCLI()) {
#!/usr/bin/php
<?php
-// No need for auth.
-@define('AUTH_HANDLER', true);
-
require_once dirname(__FILE__) . '/../lib/Application.php';
-$hylax = new Hylax_Application(array('init' => true));
+$hylax = Horde_Registry::appInit('hylax', array('authentication' => 'none'));
// Make sure no one runs this from the web.
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();
/* Store the raw fax postscript data. */
#!/usr/bin/php
<?php
-// No need for auth.
-@define('AUTH_HANDLER', true);
-
require_once dirname(__FILE__) . '/../lib/Application.php';
-$hylax = new Hylax_Application(array('init' => true));
+$hylax = Horde_Registry::appInit('hylax', array('authentication' => 'none'));
// Make sure no one runs this from the web.
if (!Horde_Cli::runningFromCLI()) {
#!/usr/bin/php
<?php
-// No need for auth.
-@define('AUTH_HANDLER', true);
-
require_once dirname(__FILE__) . '/../lib/Application.php';
-$hylax = new Hylax_Application(array('init' => true));
+$hylax = Horde_Registry::appInit('hylax', array('authentication' => 'none'));
// Make sure no one runs this from the web.
if (!Horde_Cli::runningFromCLI()) {
*/
require_once dirname(__FILE__) . '/lib/Application.php';
-$hylax = new Hylax_Application(array('init' => true));
+$hylax = Horde_Registry::appInit('hylax');
$fax_id = Horde_Util::getFormData('fax_id');
$folder = strtolower(Horde_Util::getFormData('folder'));
*/
require_once dirname(__FILE__) . '/lib/Application.php';
-$hylax = new Hylax_Application(array('init' => true));
+$hylax = Horde_Registry::appInit('hylax');
$fmt_inbox = array();
$inbox = $hylax->gateway->getFolder('inbox');
*/
require_once dirname(__FILE__) . '/lib/Application.php';
-$hylax = new Hylax_Application(array('init' => true));
+$hylax = Horde_Registry::appInit('hylax');
$fax_id = Horde_Util::getFormData('fax_id');
$url = Horde_Util::getFormData('url');