phpBB
Statistics
| Revision:

root / tags / milestone_3 / phpBB / common.php

History | View | Annotate | Download (2.6 kB)

1 38 psotfx
<?php
2 5114 acydburn
/**
3 5114 acydburn
*
4 5114 acydburn
* @package phpBB3
5 5114 acydburn
* @version $Id$
6 5114 acydburn
* @copyright (c) 2005 phpBB Group
7 5114 acydburn
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
8 5114 acydburn
*
9 5114 acydburn
*/
10 38 psotfx
11 5031 psotfx
// Remove the following line to enable this software, be sure you note what it
12 5031 psotfx
// says before continuing
13 5031 psotfx
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 5031 psotfx
15 5193 acydburn
/**
16 5193 acydburn
*/
17 3341 psotfx
if (!defined('IN_PHPBB'))
18 2327 psotfx
{
19 4970 psotfx
        exit;
20 2327 psotfx
}
21 2327 psotfx
22 4441 psotfx
$starttime = explode(' ', microtime());
23 4441 psotfx
$starttime = $starttime[1] + $starttime[0];
24 4441 psotfx
25 2954 ludovic_arnaud
error_reporting(E_ERROR | E_WARNING | E_PARSE); // This will NOT report uninitialized variables
26 2954 ludovic_arnaud
//error_reporting(E_ALL);
27 2923 psotfx
set_magic_quotes_runtime(0);
28 824 psotfx
29 4427 ludovic_arnaud
// Be paranoid with passed vars
30 4427 ludovic_arnaud
if (@ini_get('register_globals'))
31 4427 ludovic_arnaud
{
32 4427 ludovic_arnaud
        foreach ($_REQUEST as $var_name => $void)
33 4427 ludovic_arnaud
        {
34 4427 ludovic_arnaud
                unset(${$var_name});
35 4427 ludovic_arnaud
        }
36 4427 ludovic_arnaud
}
37 4427 ludovic_arnaud
38 5136 acydburn
if (defined('IN_CRON'))
39 5136 acydburn
{
40 5136 acydburn
        chdir($phpbb_root_path);
41 5136 acydburn
        $phpbb_root_path = getcwd() . '/';
42 5136 acydburn
}
43 5136 acydburn
44 2673 psotfx
require($phpbb_root_path . 'config.'.$phpEx);
45 824 psotfx
46 3341 psotfx
if (!defined('PHPBB_INSTALLED'))
47 2532 psotfx
{
48 2673 psotfx
        header('Location: install/install.'.$phpEx);
49 2673 psotfx
        exit;
50 824 psotfx
}
51 824 psotfx
52 4984 acydburn
if (defined('DEBUG_EXTRA'))
53 4984 acydburn
{
54 4984 acydburn
        $base_memory_usage = 0;
55 4984 acydburn
        if (function_exists('memory_get_usage'))
56 4984 acydburn
        {
57 4984 acydburn
                $base_memory_usage = memory_get_usage();
58 4984 acydburn
        }
59 4984 acydburn
}
60 4984 acydburn
61 3528 acydburn
// Load Extensions
62 3531 psotfx
if (!empty($load_extensions))
63 3528 acydburn
{
64 3528 acydburn
        $load_extensions = explode(',', $load_extensions);
65 3528 acydburn
66 3531 psotfx
        foreach ($load_extensions as $extension)
67 3528 acydburn
        {
68 3531 psotfx
                @dl(trim($extension));
69 3528 acydburn
        }
70 3528 acydburn
}
71 3528 acydburn
72 4647 psotfx
define('STRIP', (get_magic_quotes_gpc()) ? true : false);
73 4578 psotfx
74 5246 acydburn
// Include files
75 5246 acydburn
require($phpbb_root_path . 'includes/acm/acm_' . $acm_type . '.' . $phpEx);
76 5246 acydburn
require($phpbb_root_path . 'includes/acm/acm_main.' . $phpEx);
77 5246 acydburn
require($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx);
78 5246 acydburn
require($phpbb_root_path . 'includes/template.' . $phpEx);
79 5246 acydburn
require($phpbb_root_path . 'includes/session.' . $phpEx);
80 5246 acydburn
require($phpbb_root_path . 'includes/functions.' . $phpEx);
81 5246 acydburn
require($phpbb_root_path . 'includes/constants.' . $phpEx);
82 5246 acydburn
83 2970 psotfx
// Set PHP error handler to ours
84 2970 psotfx
set_error_handler('msg_handler');
85 1452 bartvb
86 3341 psotfx
// Instantiate some basic classes
87 4164 psotfx
$user                = new user();
88 4164 psotfx
$auth                = new auth();
89 4346 psotfx
$template        = new template();
90 5246 acydburn
$cache                = new cache();
91 5193 acydburn
$db                        = new $sql_db();
92 4164 psotfx
93 4164 psotfx
// Connect to DB
94 4120 acydburn
$db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false);
95 2673 psotfx
96 5108 acydburn
// We do not need this any longer, unset for safety purposes
97 5108 acydburn
unset($dbpasswd);
98 5108 acydburn
99 3341 psotfx
// Grab global variables, re-cache if necessary
100 5246 acydburn
$config = $cache->obtain_config();
101 3360 ludovic_arnaud
102 4883 acydburn
// Warn about install/ directory
103 4883 acydburn
if (file_exists('install'))
104 4883 acydburn
{
105 4883 acydburn
//        trigger_error('REMOVE_INSTALL');
106 4883 acydburn
}
107 4883 acydburn
108 3341 psotfx
?>