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
2006-04-26 21:29:54 +00:00
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' );
2004-11-30 11:05:23 +00:00
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 ];
2006-04-28 12:49:44 +00:00
//error_reporting(E_ERROR | E_WARNING | E_PARSE); // This will NOT report uninitialized variables
error_reporting ( E_ALL );
2001-08-09 22:21:55 +00:00
2006-04-26 18:22:28 +00:00
/**
* Remove variables created by register_globals from the global scope
* Thanks to Matt Kavanagh
*/
function deregister_globals ()
{
$not_unset = array (
'GLOBALS' => true ,
'_GET' => true ,
'_POST' => true ,
'_COOKIE' => true ,
'_REQUEST' => true ,
'_SERVER' => true ,
'_SESSION' => true ,
'_ENV' => true ,
'_FILES' => true ,
'phpEx' => true ,
'phpbb_root_path' => true );
// Not only will array_merge and array_keys give a warning if
// a parameter is not an array, array_merge will actually fail.
// So we check if _SESSION has been initialised.
if ( ! isset ( $_SESSION ) || ! is_array ( $_SESSION ))
{
$_SESSION = array ();
}
// Merge all into one extremely huge array; unset
// this later
$input = array_merge (
array_keys ( $_GET ),
array_keys ( $_POST ),
array_keys ( $_COOKIE ),
array_keys ( $_SERVER ),
array_keys ( $_SESSION ),
array_keys ( $_ENV ),
array_keys ( $_FILES )
);
foreach ( $input as $varname )
{
if ( isset ( $not_unset [ $varname ]))
{
// Hacking attempt. No point in continuing.
exit ;
}
unset ( $GLOBALS [ $varname ]);
}
unset ( $input );
}
2006-04-22 16:18:40 +00:00
// If we are on PHP >= 6.0.0 we do not need some code
2006-04-28 12:49:44 +00:00
if ( version_compare ( phpversion (), '6.0.0-dev' , '>=' ))
2006-03-06 23:45:21 +00:00
{
2006-04-22 16:18:40 +00:00
define ( 'STRIP' , false );
2006-03-06 23:45:21 +00:00
}
2006-04-22 16:18:40 +00:00
else
2003-08-23 21:51:31 +00:00
{
2006-04-22 16:18:40 +00:00
set_magic_quotes_runtime ( 0 );
2006-03-06 23:45:21 +00:00
2006-04-22 16:18:40 +00:00
// Be paranoid with passed vars
if ( @ ini_get ( 'register_globals' ) == '1' || strtolower ( @ ini_get ( 'register_globals' )) == 'on' )
2006-03-06 23:45:21 +00:00
{
2006-04-26 18:22:28 +00:00
deregister_globals ();
2006-03-06 23:45:21 +00:00
}
2006-04-22 16:18:40 +00:00
define ( 'STRIP' , ( get_magic_quotes_gpc ()) ? true : false );
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 () . '/' ;
}
2006-04-28 12:49:44 +00:00
// Run the following code if not currently installing
if ( ! defined ( 'IN_INSTALL' ))
2002-04-20 00:22:29 +00:00
{
2006-04-28 12:49:44 +00:00
require ( $phpbb_root_path . 'config.' . $phpEx );
2001-08-09 22:21:55 +00:00
2006-04-28 12:49:44 +00:00
if ( ! defined ( 'PHPBB_INSTALLED' ))
2004-09-16 18:33:22 +00:00
{
2006-04-28 12:49:44 +00:00
header ( 'Location: install/index.' . $phpEx );
exit ;
2004-09-16 18:33:22 +00:00
}
2006-04-28 12:49:44 +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
2006-04-28 12:49:44 +00:00
// Load Extensions
if ( ! empty ( $load_extensions ))
2003-02-25 16:49:45 +00:00
{
2006-04-28 12:49:44 +00:00
$load_extensions = explode ( ',' , $load_extensions );
foreach ( $load_extensions as $extension )
{
@ dl ( trim ( $extension ));
}
2003-02-25 16:49:45 +00:00
}
}
2006-04-28 12:49:44 +00:00
else
{
$acm_type = 'file' ;
}
2003-02-25 16:49:45 +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/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 ();
2003-06-21 15:14:47 +00:00
2006-04-28 12:49:44 +00:00
// Initiate DBAL if not installing
if ( ! defined ( 'IN_INSTALL' ))
{
require ( $phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx );
$db = new $sql_db ();
2001-11-26 12:09:37 +00:00
2006-04-28 12:49:44 +00:00
// Connect to DB
$db -> sql_connect ( $dbhost , $dbuser , $dbpasswd , $dbname , $dbport , false );
2005-03-21 22:43:07 +00:00
2006-04-28 12:49:44 +00:00
// We do not need this any longer, unset for safety purposes
unset ( $dbpasswd );
2003-01-20 05:12:38 +00:00
2006-04-28 12:49:44 +00:00
// Grab global variables, re-cache if necessary
$config = $cache -> obtain_config ();
$dss_seeded = false ;
// Warn about install/ directory
if ( file_exists ( 'install' ))
{
// trigger_error('REMOVE_INSTALL');
}
2004-05-02 13:06:57 +00:00
}
2006-04-28 12:49:44 +00:00
?>