Browse Source

warnings when no plugins installed

pull/1/head
Friendika 11 years ago
parent
commit
f2242826d8
1 changed files with 17 additions and 12 deletions
  1. +17
    -12
      boot.php

+ 17
- 12
boot.php View File

@ -430,6 +430,8 @@ function check_config(&$a) {
$r = q("SELECT * FROM `addon` WHERE `installed` = 1");
if(count($r))
$installed = $r;
else
$installed = array();
$plugins = get_config('system','addon');
$plugins_arr = array();
@ -438,21 +440,24 @@ function check_config(&$a) {
$plugins_arr = explode(',',str_replace(' ', '',$plugins));
$installed_arr = array();
foreach($installed as $i) {
if(! in_array($i['name'],$plugins_arr)) {
logger("Addons: uninstalling " . $i['name']);
q("DELETE FROM `addon` WHERE `id` = %d LIMIT 1",
intval($i['id'])
);
@include_once('addon/' . $i['name'] . '/' . $i['name'] . '.php');
if(function_exists($i['name'] . '_uninstall')) {
$func = $i['name'] . '_uninstall';
$func();
if(count($installed)) {
foreach($installed as $i) {
if(! in_array($i['name'],$plugins_arr)) {
logger("Addons: uninstalling " . $i['name']);
q("DELETE FROM `addon` WHERE `id` = %d LIMIT 1",
intval($i['id'])
);
@include_once('addon/' . $i['name'] . '/' . $i['name'] . '.php');
if(function_exists($i['name'] . '_uninstall')) {
$func = $i['name'] . '_uninstall';
$func();
}
}
else
$installed_arr[] = $i['name'];
}
else
$installed_arr[] = $i['name'];
}
if(count($plugins_arr)) {


Loading…
Cancel
Save