Add update function to reload addons after hook renaming

This commit is contained in:
Hypolite Petovan 2018-01-23 18:57:51 -05:00
parent 0601ba1309
commit d6bdaeaffe
2 changed files with 12 additions and 1 deletions

View file

@ -41,7 +41,7 @@ define('FRIENDICA_PLATFORM', 'Friendica');
define('FRIENDICA_CODENAME', 'Asparagus'); define('FRIENDICA_CODENAME', 'Asparagus');
define('FRIENDICA_VERSION', '3.6-dev'); define('FRIENDICA_VERSION', '3.6-dev');
define('DFRN_PROTOCOL_VERSION', '2.23'); define('DFRN_PROTOCOL_VERSION', '2.23');
define('DB_UPDATE_VERSION', 1246); define('DB_UPDATE_VERSION', 1247);
define('NEW_UPDATE_ROUTINE_VERSION', 1170); define('NEW_UPDATE_ROUTINE_VERSION', 1170);
/** /**

View file

@ -7,6 +7,8 @@ use Friendica\Core\Worker;
use Friendica\Database\DBM; use Friendica\Database\DBM;
use Friendica\Model\User; use Friendica\Model\User;
require_once 'include/dba.php';
/** /**
* *
* update.php - automatic system update * update.php - automatic system update
@ -173,3 +175,12 @@ function update_1245() {
return UPDATE_SUCCESS; return UPDATE_SUCCESS;
} }
function update_1247() {
// Removing hooks with the old name
dba::e("DELETE FROM `hook`
WHERE `hook` LIKE 'plugin_%'");
// Make sure we install the new renamed ones
Addon::reload();
}