File: base.php

package info (click to toggle)
chora2 2.0.1-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 2,208 kB
  • ctags: 302
  • sloc: php: 1,298; xml: 406; makefile: 66
file content (59 lines) | stat: -rw-r--r-- 1,781 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?php
/**
 * Chora base inclusion file.
 *
 * $Horde: chora/lib/base.php,v 1.101 2004/10/19 00:45:23 chuck Exp $
 *
 * This file brings in all of the dependencies that every Chora script
 * will need, and sets up objects that all scripts use.
 */

// Check for a prior definition of HORDE_BASE (perhaps by an
// auto_prepend_file definition for site customization).
if (!defined('HORDE_BASE')) {
    @define('HORDE_BASE', dirname(__FILE__) . '/../..');
}

// Load the Horde Framework core, and set up inclusion paths.
require_once HORDE_BASE . '/lib/core.php';

// Registry
$registry = &Registry::singleton();
if (is_a(($pushed = $registry->pushApp('chora', !defined('AUTH_HANDLER'))), 'PEAR_Error')) {
    if ($pushed->getCode() == 'permission_denied') {
        Horde::authenticationFailureRedirect(); 
    }
    Horde::fatal($pushed, __FILE__, __LINE__, false);
}
$conf = &$GLOBALS['conf'];
@define('CHORA_TEMPLATES', $registry->get('templates'));

// Notification system.
$notification = &Notification::singleton();
$notification->attach('status');

// Cache
require_once 'Horde/Cache.php';
$cache = &Horde_Cache::singleton($conf['cache']['driver'], Horde::getDriverConfig('cache', $conf['cache']['driver']));

// Find the base file path of Chora.
@define('CHORA_BASE', dirname(__FILE__) . '/..');

// Horde base libraries.
require_once 'Horde/Text.php';
require_once 'Horde/Help.php';

// Chora libraries and config.
require_once CHORA_BASE . '/config/sourceroots.php';
require_once CHORA_BASE . '/lib/Chora.php';
require_once 'Horde/VC.php';

// Initialize objects, path, etc.
Chora::init();

if (Chora::isRestricted($where)) {
    Chora::fatal('403 Forbidden', "$where: Forbidden by server configuration");
}

/* Start compression, if requested. */
Horde::compressOutput();