$db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false, defined('PHPBB_DB_NEW_LINK') ? PHPBB_DB_NEW_LINK : false); unset($dbpasswd); $config['am_dir_perms'] = 755; $config['am_file_perms'] = 644; // -------------------------- begin stealing from acp_mods // include automod files include "{$phpbb_root_path}includes/functions_transfer.{$phpEx}"; include "./includes/editor.{$phpEx}"; include "./includes/functions_mods.{$phpEx}"; include "./includes/mod_parser.{$phpEx}"; $edited_root = '../../mod/'; $backup_root = ''; $editor = new editor_direct(); $editor->create_edited_root($edited_root); $parser = new parser('xml'); $parser->set_file($mod_path); $actions = $parser->get_actions(); $mod_installed = true; // not all MODs will have edits (!) if (isset($actions['EDITS'])) { foreach ($actions['EDITS'] as $filename => $edits) { // see if the file to be opened actually exists if (!file_exists("{$phpbb_root_path}{$filename}")) { $mod_installed = false; continue; } else { $status = $editor->open_file($filename, $backup_root); if (is_string($status)) { $mod_installed = false; continue; }