Skip to content

Commit

Permalink
Installer fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jdarwood007 committed Nov 22, 2023
1 parent 2df03a6 commit 21c0d25
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Sources/Autoloader.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
}

// Do any third-party scripts want in on the fun?
if (class_exists('SMF\\Config', false) && $hook_value !== (Config::$modSettings['integrate_autoload'] ?? '')) {
if (class_exists('SMF\\Config', false) && !defined('SMF_INSTALLING') && $hook_value !== (Config::$modSettings['integrate_autoload'] ?? '')) {
if (!class_exists('SMF\\IntegrationHook', false) && is_file($sourcedir . '/IntegrationHook.php')) {
require_once $sourcedir . '/IntegrationHook.php';
}
Expand Down
14 changes: 7 additions & 7 deletions other/install.php
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ function initialize_inputs()
foreach ($databases as $key => $dummy)
{
$type = ($key == 'mysqli') ? 'mysql' : $key;
$ftp->unlink('install_' . DB_SCRIPT_VERSION . '_' . $type . '.sql');
$ftp->unlink('install_' . DB_SCRIPT_VERSION . '_' . Db::getClass($type) . '.sql');
}

$ftp->close();
Expand All @@ -268,7 +268,7 @@ function initialize_inputs()
foreach ($databases as $key => $dummy)
{
$type = ($key == 'mysqli') ? 'mysql' : $key;
@unlink(Config::$boarddir . '/install_' . DB_SCRIPT_VERSION . '_' . $type . '.sql');
@unlink(Config::$boarddir . '/install_' . DB_SCRIPT_VERSION . '_' . Db::getClass($type) . '.sql');
}
}

Expand Down Expand Up @@ -479,11 +479,11 @@ function Welcome()
if ($db['supported'])
{
$type = ($key == 'mysqli') ? 'mysql' : $key;
if (!file_exists(Config::$boarddir . '/install_' . DB_SCRIPT_VERSION . '_' . $type . '.sql'))
if (!file_exists(Config::$boarddir . '/install_' . DB_SCRIPT_VERSION . '_' . Db::getClass($type) . '.sql'))
{
$databases[$key]['supported'] = false;
$notFoundSQLFile = true;
Lang::$txt['error_db_script_missing'] = sprintf(Lang::$txt['error_db_script_missing'], 'install_' . DB_SCRIPT_VERSION . '_' . $type . '.sql');
Lang::$txt['error_db_script_missing'] = sprintf(Lang::$txt['error_db_script_missing'], 'install_' . DB_SCRIPT_VERSION . '_' . Db::getClass($type) . '.sql');
}
else
$incontext['supported_databases'][] = $db;
Expand Down Expand Up @@ -868,9 +868,9 @@ function DatabaseSettings()
Config::load();

// Better find the database file!
if (!file_exists(Config::$sourcedir . '/Db/APIs/' . Config::$db_type . '.php'))
if (!file_exists(Config::$sourcedir . '/Db/APIs/' . Db::getClase(Config::$db_type) . '.php'))
{
$incontext['error'] = sprintf(Lang::$txt['error_db_file'], 'Db/APIs/' . Config::$db_type . '.php');
$incontext['error'] = sprintf(Lang::$txt['error_db_file'], 'Db/APIs/' . Db::getClase(Config::$db_type) . '.php');
return false;
}

Expand Down Expand Up @@ -1222,7 +1222,7 @@ function DatabasePopulation()

// Read in the SQL. Turn this on and that off... internationalize... etc.
$type = (Config::$db_type == 'mysqli' ? 'mysql' : Config::$db_type);
$sql_lines = explode("\n", strtr(implode(' ', file(Config::$boarddir . '/install_' . DB_SCRIPT_VERSION . '_' . $type . '.sql')), $replaces));
$sql_lines = explode("\n", strtr(implode(' ', file(Config::$boarddir . '/install_' . DB_SCRIPT_VERSION . '_' . Db::getClass($type) . '.sql')), $replaces));

// Execute the SQL.
$current_statement = '';
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 21c0d25

Please sign in to comment.