1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-05-06 15:45:34 +02:00

added extension loading. please note the additional variable '

$load_extensions = "";' within config.php.


git-svn-id: file:///svn/phpbb/trunk@3528 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen 2003-02-25 16:49:45 +00:00
parent 74c6eec725
commit 46267dce88
2 changed files with 66 additions and 1 deletions

View File

@ -44,6 +44,17 @@ if (!defined('PHPBB_INSTALLED'))
exit;
}
// Load Extensions
if ( (isset($load_extensions)) && ($load_extensions != '') )
{
$load_extensions = explode(',', $load_extensions);
for ($i = 0; $i < count($load_extensions); $i++)
{
@dl(trim($load_extensions[$i]));
}
}
// Include files
require($phpbb_root_path . 'includes/acm/cache_' . $acm_type . '.'.$phpEx);
require($phpbb_root_path . 'db/' . $dbms . '.'.$phpEx);

View File

@ -493,6 +493,8 @@ else if ( ( empty($install_step) || $admin_pass1 != $admin_pass2 || empty($admin
}
else
{
$load_extensions = '';
//
// Go ahead and create the DB, then populate it
//
@ -534,7 +536,40 @@ else
);
$template->pparse('body'); */
die("Error during installation: no $check_exts extension");
// Try to load the Extensions
$loaded_extension = FALSE;
if ( (!@ini_get('safe_mode')) && (@ini_get('enable_dl')) )
{
$suffix = ( (defined('PHP_OS')) && (eregi('win', PHP_OS)) ) ? '.dll' : '.so';
if (!@extension_loaded($check_exts))
{
if (@dl($check_exts . $suffix))
{
$load_extensions .= ($load_extensions == '') ? $check_exts . $suffix : ',' . $check_exts . $suffix;
$loaded_extension = TRUE;
}
}
if (!$loaded_extension)
{
if (!@extension_loaded($check_other))
{
if (@dl($check_other . $suffix))
{
$load_extensions .= ($load_extensions == '') ? $check_other . $suffix : ',' . $check_other . $suffix;
$loaded_extension = TRUE;
}
}
}
}
if (!$loaded_extension)
{
die("Error during installation: no $check_exts extension");
}
}
include($phpbb_root_path . 'db/' . $dbms . '.' . $phpEx);
@ -542,6 +577,24 @@ else
$db = new sql_db($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false);
}
// Add another Extension Checks here if you want, please do not specify the suffix
$check_extensions = array();
$suffix = ( (defined('PHP_OS')) && (eregi('win', PHP_OS)) ) ? '.dll' : '.so';
for ($i = 0; $i < count($check_extensions); $i++)
{
if (!@extension_loaded($check_extensions[$i]))
{
if ( (!@ini_get('safe_mode')) && (@ini_get('enable_dl')) )
{
if (@dl($check_extensions[$i] . $suffix))
{
$load_extensions .= ($load_extensions == '') ? $check_extensions[$i] . $suffix : ',' . $check_extensions[$i] . $suffix;
}
}
}
}
$dbms_schema = 'schemas/' . $available_dbms[$dbms]['SCHEMA'] . '_schema.sql';
$dbms_basic = 'schemas/' . $available_dbms[$dbms]['SCHEMA'] . '_basic.sql';
@ -694,6 +747,7 @@ else
$config_data .= '$dbpasswd = "' . $dbpasswd . '";' . "\n\n";
$config_data .= "\$acm_type = 'file';\n";
$config_data .= '$table_prefix = "' . $table_prefix . '";' . "\n\n";
$config_data .= '$load_extensions = "' . $load_extensions . '";' . "\n\n";
$config_data .= 'define(\'PHPBB_INSTALLED\', true);'."\n\n";
$config_data .= '?' . '>'; // Done this to prevent highlighting editors getting confused!