phpBB
Statistics
| Revision:

root / tags / milestone_3 / phpBB / common.php

History | View | Annotate | Download (2.6 kB)

1
<?php
2
/** 
3
*
4
* @package phpBB3
5
* @version $Id: common.php 5246 2005-10-02 18:43:11Z acydburn $
6
* @copyright (c) 2005 phpBB Group 
7
* @license http://opensource.org/licenses/gpl-license.php GNU Public License 
8
*
9
*/
10
11
// Remove the following line to enable this software, be sure you note what it
12
// says before continuing
13
die('This software is unsupported in any and all respects. By removing this notice (found in common.php) you are noting your acceptance of this. Do not ask support questions of any kind for this release at either area51.phpbb.com or www.phpbb.com. Support for this version will appear when the beta cycle begins');
14
15
/**
16
*/
17
if (!defined('IN_PHPBB'))
18
{
19
        exit;
20
}
21
22
$starttime = explode(' ', microtime());
23
$starttime = $starttime[1] + $starttime[0];
24
25
error_reporting(E_ERROR | E_WARNING | E_PARSE); // This will NOT report uninitialized variables
26
//error_reporting(E_ALL);
27
set_magic_quotes_runtime(0);
28
29
// Be paranoid with passed vars
30
if (@ini_get('register_globals'))
31
{
32
        foreach ($_REQUEST as $var_name => $void)
33
        {
34
                unset(${$var_name});
35
        }
36
}
37
38
if (defined('IN_CRON'))
39
{
40
        chdir($phpbb_root_path);
41
        $phpbb_root_path = getcwd() . '/';
42
}
43
44
require($phpbb_root_path . 'config.'.$phpEx);
45
46
if (!defined('PHPBB_INSTALLED'))
47
{
48
        header('Location: install/install.'.$phpEx);
49
        exit;
50
}
51
52
if (defined('DEBUG_EXTRA'))
53
{
54
        $base_memory_usage = 0;
55
        if (function_exists('memory_get_usage'))
56
        {
57
                $base_memory_usage = memory_get_usage();
58
        }
59
}
60
61
// Load Extensions
62
if (!empty($load_extensions))
63
{
64
        $load_extensions = explode(',', $load_extensions);
65
66
        foreach ($load_extensions as $extension)
67
        {
68
                @dl(trim($extension));
69
        }
70
}
71
72
define('STRIP', (get_magic_quotes_gpc()) ? true : false);
73
74
// Include files
75
require($phpbb_root_path . 'includes/acm/acm_' . $acm_type . '.' . $phpEx);
76
require($phpbb_root_path . 'includes/acm/acm_main.' . $phpEx);
77
require($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx);
78
require($phpbb_root_path . 'includes/template.' . $phpEx);
79
require($phpbb_root_path . 'includes/session.' . $phpEx);
80
require($phpbb_root_path . 'includes/functions.' . $phpEx);
81
require($phpbb_root_path . 'includes/constants.' . $phpEx);
82
83
// Set PHP error handler to ours
84
set_error_handler('msg_handler');
85
86
// Instantiate some basic classes
87
$user                = new user();
88
$auth                = new auth();
89
$template        = new template();
90
$cache                = new cache();
91
$db                        = new $sql_db();
92
93
// Connect to DB
94
$db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false);
95
96
// We do not need this any longer, unset for safety purposes
97
unset($dbpasswd);
98
99
// Grab global variables, re-cache if necessary
100
$config = $cache->obtain_config();
101
102
// Warn about install/ directory
103
if (file_exists('install'))
104
{
105
//        trigger_error('REMOVE_INSTALL');
106
}
107
108
?>