From 3020611cd1666e562499a211c654e186875fcc6d Mon Sep 17 00:00:00 2001 From: Olle Haerstedt Date: Wed, 10 Oct 2018 15:13:12 +0200 Subject: [PATCH] Dev: Install UpdateCheck plugin by default --- application/core/LsDefaultDataSets.php | 20 ++++++++++++++++++++ installer/create-database.php | 5 +++++ 2 files changed, 25 insertions(+) diff --git a/application/core/LsDefaultDataSets.php b/application/core/LsDefaultDataSets.php index 6be2834699e..b3e94ceb149 100644 --- a/application/core/LsDefaultDataSets.php +++ b/application/core/LsDefaultDataSets.php @@ -924,4 +924,24 @@ public static function getTutorialEntryData() return $returnArray; } + + /** + * Get data for plugins installed by default. + * Note: Authdb is installed during first login. + * @return array + */ + public static function getDefaultPluginsData() + { + return [ + [ + 'id' => null, + 'name' => 'UpdateCheck', + 'plugin_type' => 'core', + 'active' => 1, + 'version' => '1.0.0', + 'load_error' => 0, + 'load_error_message' => null + ] + ]; + } } diff --git a/installer/create-database.php b/installer/create-database.php index a6c45b29699..3afd48940d3 100755 --- a/installer/create-database.php +++ b/installer/create-database.php @@ -838,6 +838,11 @@ function createDatabase($oDB){ 'version' => 'integer NOT NULL', )); + // Install default plugins. + foreach (LsDefaultDataSets::getDefaultPluginsData() as $plugin) { + $oDB->createCommand()->insert("{{plugins}}", $plugin); + } + // Set database version $oDB->createCommand()->insert("{{settings_global}}", ['stg_name'=> 'DBVersion' , 'stg_value' => $databaseCurrentVersion]);