From c1380fad946d200c8debe611ebc67eb7e69bf1e2 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Tue, 5 Jul 2016 18:10:28 +0200 Subject: [PATCH] Implement activation --- Module/InstallerAbstract.php | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/Module/InstallerAbstract.php b/Module/InstallerAbstract.php index 2b187a461..42612a3a6 100644 --- a/Module/InstallerAbstract.php +++ b/Module/InstallerAbstract.php @@ -58,7 +58,7 @@ class InstallerAbstract $sth->bindValue(':internal', $info->getInternalName(), \PDO::PARAM_INT); $sth->bindValue(':theme', 'Default', \PDO::PARAM_STR); $sth->bindValue(':path', $info->getDirectory(), \PDO::PARAM_STR); - $sth->bindValue(':active', 1, \PDO::PARAM_INT); + $sth->bindValue(':active', 0, \PDO::PARAM_INT); $sth->bindValue(':version', $info->getVersion(), \PDO::PARAM_STR); $sth->execute(); @@ -100,6 +100,25 @@ class InstallerAbstract { self::registerInDatabase($dbPool, $info); self::initRoutes($info); + self::activate($dbPool, $info); + } + + /** + * Activate after install. + * + * @param Pool $dbPool Database instance + * @param InfoManager $info Module info + * + * @return void + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ + private static function activate(Pool $dbPool, InfoManager $info) + { + /** @var ActivateAbstract $class */ + $class = '\Modules\\' . $info->getDirectory() . '\Admin\Activate'; + $class::activate($dbPool, $info); } /**