aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2003-02-25 16:49:45 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2003-02-25 16:49:45 +0000
commit46267dce884f76204a21f8c72bb0eb28c47c228c (patch)
treee34b1d78d3542ec58839b7467a09e4d8517ceb27
parent74c6eec7257d99949a273287c97e0a52e492beba (diff)
downloadforums-46267dce884f76204a21f8c72bb0eb28c47c228c.tar
forums-46267dce884f76204a21f8c72bb0eb28c47c228c.tar.gz
forums-46267dce884f76204a21f8c72bb0eb28c47c228c.tar.bz2
forums-46267dce884f76204a21f8c72bb0eb28c47c228c.tar.xz
forums-46267dce884f76204a21f8c72bb0eb28c47c228c.zip
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
-rw-r--r--phpBB/common.php11
-rw-r--r--phpBB/install/install.php56
2 files changed, 66 insertions, 1 deletions
diff --git a/phpBB/common.php b/phpBB/common.php
index f9bf10da9e..e637594f5a 100644
--- a/phpBB/common.php
+++ b/phpBB/common.php
@@ -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);
diff --git a/phpBB/install/install.php b/phpBB/install/install.php
index 79f4218879..95c612cc55 100644
--- a/phpBB/install/install.php
+++ b/phpBB/install/install.php
@@ -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!