Skip to content

Commit

Permalink
fix addon handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Colinax committed Mar 5, 2020
1 parent d2655e2 commit 1bd686c
Showing 1 changed file with 10 additions and 15 deletions.
25 changes: 10 additions & 15 deletions wbce/install/update.php
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ function status_msg($message, $class = 'grey', $element = 'span')
* Adding field default_theme to settings table
*/

echo "Set default_theme<br />";
echo "<br />Set default_theme<br />";
Settings::Set('default_theme', $DEFAULT_THEME);
if (defined("WB_SECFORM_TIMEOUT"))
Settings::Set('wb_secform_timeout', '7200');
Expand Down Expand Up @@ -839,39 +839,36 @@ function status_msg($message, $class = 'grey', $element = 'span')
* Reload all addons
*/

// delete modules
//$database->query("DELETE FROM ".TABLE_PREFIX."addons WHERE type = 'module'");
// Truncate addons
$database->query("TRUNCATE `".TABLE_PREFIX."addons`");
echo 'Truncate addons table<br />';

// Load all modules
if (($handle = opendir(WB_PATH . '/modules/'))) {
while (false !== ($file = readdir($handle))) {
if ($file != '' and substr($file, 0, 1) != '.' and $file != 'admin.php' and $file != 'index.php') {
if ($file != '' && substr($file, 0, 1) != '.' && $file != 'admin.php' && $file != 'index.php') {
load_module(WB_PATH . '/modules/' . $file);
// upgrade_module($file, true);
}
}
closedir($handle);
}
echo 'Modules reloaded<br />';
echo '<br />Modules reloaded<br />';

// delete templates
$database->query("DELETE FROM ".TABLE_PREFIX."addons WHERE type = 'template'");
// Load all templates
if (($handle = opendir(WB_PATH . '/templates/'))) {
while (false !== ($file = readdir($handle))) {
if ($file != '' and substr($file, 0, 1) != '.' and $file != 'index.php') {
if ($file != '' && substr($file, 0, 1) != '.' && $file != 'index.php') {
load_template(WB_PATH . '/templates/' . $file);
}
}
closedir($handle);
}
echo '<br />Templates reloaded<br />';

// delete languages
$database->query("DELETE FROM ".TABLE_PREFIX."addons WHERE type = 'language'");
// Load all languages
if (($handle = opendir(WB_PATH . '/languages/'))) {
while (false !== ($file = readdir($handle))) {
if ($file != '' and substr($file, 0, 1) != '.' and $file != 'index.php') {
if ($file != '' && substr($file, 0, 1) != '.' && $file != 'index.php') {
load_language(WB_PATH . '/languages/' . $file);
}
}
Expand All @@ -880,8 +877,6 @@ function status_msg($message, $class = 'grey', $element = 'span')
echo '<br />Languages reloaded<br />';




/**********************************************************
* Set Version to new Version
*/
Expand Down Expand Up @@ -931,4 +926,4 @@ function status_msg($message, $class = 'grey', $element = 'span')
</table>
</div>
</body>
</html>
</html>

0 comments on commit 1bd686c

Please sign in to comment.