1: <?php
2: /**
3: * Hylax Application class file.
4: *
5: * This file brings in all of the dependencies that every Hylax script will
6: * need, and sets up objects that all scripts use.
7: *
8: * Copyright 2003-2012 Horde LLC (http://www.horde.org/)
9: *
10: * See the enclosed file COPYING for license information (GPL). If you
11: * did not receive this file, see http://www.horde.org/licenses/gpl.
12: *
13: * @package Hylax
14: */
15:
16: if (!defined('HYLAX_BASE')) {
17: define('HYLAX_BASE', dirname(__FILE__). '/..');
18: }
19:
20: if (!defined('HORDE_BASE')) {
21: /* If horde does not live directly under the app directory, the HORDE_BASE
22: * constant should be defined in config/horde.local.php. */
23: if (file_exists(HYLAX_BASE. '/config/horde.local.php')) {
24: include HYLAX_BASE . '/config/horde.local.php';
25: } else {
26: define('HORDE_BASE', HYLAX_BASE . '/..');
27: }
28: }
29:
30: /* Load the Horde Framework core (needed to autoload
31: * Horde_Registry_Application::). */
32: require_once HORDE_BASE . '/lib/core.php';
33:
34: class Hylax_Application extends Horde_Registry_Application
35: {
36: public $version = 'H4 (0.1-git)';
37:
38: public $gateway = null;
39: public $storage = null;
40:
41: protected function _init()
42: {
43: /* Hylax Driver */
44: $this->gateway = Hylax_Driver::singleton($conf['fax']['driver'],
45: $conf['fax']['params']);
46:
47: /* Hylax storage driver. */
48: $this->storage = Hylax_Storage::singleton('sql', $conf['sql']);
49: }
50:
51: }
52: