From 303de83504f40c36cb494b652c6468d0ce6f8aa4 Mon Sep 17 00:00:00 2001 From: Ben Klang Date: Fri, 8 Jan 2010 10:09:27 -0500 Subject: [PATCH] Hylax: Add Application class to replace lib/base.php --- hylax/lib/Application.php | 84 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 hylax/lib/Application.php diff --git a/hylax/lib/Application.php b/hylax/lib/Application.php new file mode 100644 index 000000000..e033c832f --- /dev/null +++ b/hylax/lib/Application.php @@ -0,0 +1,84 @@ +pushApp('hylax', !defined('AUTH_HANDLER')); + } catch (Horde_Exception $e) { + if ($e->getCode() == 'permission_denied') { + Horde::authenticationFailureRedirect(); + } + 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__) . '/..'); + + /* Hylax Driver */ + $gateway = Hylax_Driver::singleton($conf['fax']['driver'], $conf['fax']['params']); + + /* Hylax storage driver. */ + $hylax_storage = Hylax_Storage::singleton('sql', $conf['sql']); + + /* Start compression, if requested. */ + Horde::compressOutput(); + } + } + + public function perms() + { + static $perms = array(); + if (!empty($perms)) { + return $perms; + } + + return $perms; + } +} \ No newline at end of file -- 2.11.0