2001-02-24 00:31:58 +00:00
< ? php
2005-04-09 12:26:45 +00:00
/**
*
* @ package phpBB3
* @ version $Id $
* @ copyright ( c ) 2005 phpBB Group
* @ license http :// opensource . org / licenses / gpl - license . php GNU Public License
*
2006-01-04 07:51:04 +00:00
* Minimum Requirement : PHP 4.3 . 3
2005-04-09 12:26:45 +00:00
*/
2004-11-30 11:05:23 +00:00
// Remove the following line to enable this software, be sure you note what it
// says before continuing
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' );
2005-08-17 15:57:50 +00:00
/**
*/
2003-01-21 14:33:07 +00:00
if ( ! defined ( 'IN_PHPBB' ))
2002-03-18 23:45:24 +00:00
{
2004-09-01 15:47:46 +00:00
exit ;
2002-03-18 23:45:24 +00:00
}
2003-08-27 16:32:44 +00:00
$starttime = explode ( ' ' , microtime ());
$starttime = $starttime [ 1 ] + $starttime [ 0 ];
2002-10-17 02:50:50 +00:00
error_reporting ( E_ERROR | E_WARNING | E_PARSE ); // This will NOT report uninitialized variables
//error_reporting(E_ALL);
2002-10-04 13:09:10 +00:00
set_magic_quotes_runtime ( 0 );
2001-08-09 22:21:55 +00:00
2006-03-06 23:45:21 +00:00
// Protect against GLOBALS tricks
if ( isset ( $_REQUEST [ 'GLOBALS' ]) || isset ( $_FILES [ 'GLOBALS' ]))
{
exit ;
}
// Protect against _SESSION tricks
if ( isset ( $_SESSION ) && ! is_array ( $_SESSION ))
{
exit ;
}
2003-08-23 21:51:31 +00:00
// Be paranoid with passed vars
2006-03-06 23:45:21 +00:00
if ( @ ini_get ( 'register_globals' ) == '1' || strtolower ( @ ini_get ( 'register_globals' )) == 'on' )
2003-08-23 21:51:31 +00:00
{
2006-03-06 23:45:21 +00:00
$not_unset = array ( '_GET' , '_POST' , '_COOKIE' , '_REQUEST' , '_SERVER' , '_SESSION' , '_ENV' , '_FILES' , 'phpEx' , 'phpbb_root_path' );
// Not only will array_merge give a warning if a parameter
// is not an array, it will actually fail. So we check if
// _SESSION has been initialised.
if ( ! isset ( $_SESSION ) || ! is_array ( $_SESSION ))
2003-08-23 21:51:31 +00:00
{
2006-03-06 23:45:21 +00:00
$_SESSION = array ();
2003-08-23 21:51:31 +00:00
}
2006-03-06 23:45:21 +00:00
// Merge all into one extremely huge array; unset
// this later
$input = array_merge ( $_GET , $_POST , $_COOKIE , $_SERVER , $_SESSION , $_ENV , $_FILES );
foreach ( $input as $varname => $void )
{
if ( ! in_array ( $varname , $not_unset ))
{
unset ( ${$varname} );
}
}
unset ( $input );
2003-08-23 21:51:31 +00:00
}
2005-04-30 14:28:07 +00:00
if ( defined ( 'IN_CRON' ))
{
chdir ( $phpbb_root_path );
$phpbb_root_path = getcwd () . '/' ;
}
2002-07-14 14:45:26 +00:00
require ( $phpbb_root_path . 'config.' . $phpEx );
2001-08-09 22:21:55 +00:00
2003-01-21 14:33:07 +00:00
if ( ! defined ( 'PHPBB_INSTALLED' ))
2002-04-20 00:22:29 +00:00
{
2006-03-18 16:39:05 +00:00
header ( 'Location: install/index.' . $phpEx );
2002-07-14 14:45:26 +00:00
exit ;
2001-08-09 22:21:55 +00:00
}
2004-09-16 18:33:22 +00:00
if ( defined ( 'DEBUG_EXTRA' ))
{
$base_memory_usage = 0 ;
if ( function_exists ( 'memory_get_usage' ))
{
$base_memory_usage = memory_get_usage ();
}
}
2003-02-25 16:49:45 +00:00
// Load Extensions
2003-02-25 18:20:33 +00:00
if ( ! empty ( $load_extensions ))
2003-02-25 16:49:45 +00:00
{
$load_extensions = explode ( ',' , $load_extensions );
2003-02-25 18:20:33 +00:00
foreach ( $load_extensions as $extension )
2003-02-25 16:49:45 +00:00
{
2003-02-25 18:20:33 +00:00
@ dl ( trim ( $extension ));
2003-02-25 16:49:45 +00:00
}
}
2003-11-05 18:51:31 +00:00
define ( 'STRIP' , ( get_magic_quotes_gpc ()) ? true : false );
2003-10-12 11:59:23 +00:00
2005-10-02 18:43:11 +00:00
// Include files
require ( $phpbb_root_path . 'includes/acm/acm_' . $acm_type . '.' . $phpEx );
require ( $phpbb_root_path . 'includes/acm/acm_main.' . $phpEx );
require ( $phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx );
require ( $phpbb_root_path . 'includes/template.' . $phpEx );
require ( $phpbb_root_path . 'includes/session.' . $phpEx );
2006-01-04 07:51:04 +00:00
require ( $phpbb_root_path . 'includes/auth.' . $phpEx );
2005-10-02 18:43:11 +00:00
require ( $phpbb_root_path . 'includes/functions.' . $phpEx );
require ( $phpbb_root_path . 'includes/constants.' . $phpEx );
2002-10-26 12:36:38 +00:00
// Set PHP error handler to ours
set_error_handler ( 'msg_handler' );
2002-07-14 14:45:26 +00:00
2003-01-21 14:33:07 +00:00
// Instantiate some basic classes
2003-06-21 15:14:47 +00:00
$user = new user ();
$auth = new auth ();
2003-08-06 18:33:03 +00:00
$template = new template ();
2005-10-02 18:43:11 +00:00
$cache = new cache ();
2005-08-17 15:57:50 +00:00
$db = new $sql_db ();
2003-06-21 15:14:47 +00:00
// Connect to DB
2003-06-13 16:45:07 +00:00
$db -> sql_connect ( $dbhost , $dbuser , $dbpasswd , $dbname , $dbport , false );
2001-11-26 12:09:37 +00:00
2005-03-21 22:43:07 +00:00
// We do not need this any longer, unset for safety purposes
unset ( $dbpasswd );
2003-01-21 14:33:07 +00:00
// Grab global variables, re-cache if necessary
2005-10-02 18:43:11 +00:00
$config = $cache -> obtain_config ();
2003-01-20 05:12:38 +00:00
2004-05-02 13:06:57 +00:00
// Warn about install/ directory
if ( file_exists ( 'install' ))
{
// trigger_error('REMOVE_INSTALL');
}
2006-03-18 16:39:05 +00:00
?>