From a98e51dd4509c14e790fd3eacb4f23d42eedafd8 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Thu, 24 Jun 2021 00:03:34 +0200 Subject: [PATCH] add app to installer --- Admin/Install/Search.php | 8 ++++---- Admin/Installer.php | 9 +++++---- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Admin/Install/Search.php b/Admin/Install/Search.php index a3874b8..dd9cb14 100755 --- a/Admin/Install/Search.php +++ b/Admin/Install/Search.php @@ -14,7 +14,7 @@ declare(strict_types=1); namespace Modules\Navigation\Admin\Install; -use phpOMS\DataStorage\Database\DatabasePool; +use phpOMS\Application\ApplicationAbstract; /** * Search class. @@ -30,14 +30,14 @@ final class Search * Install navigation providing * * @param string $path Module path - * @param DatabasePool $dbPool Database pool for database interaction + * @param ApplicationAbstract $app Application * * @return void * * @since 1.0.0 */ - public static function install(string $path, DatabasePool $dbPool) : void + public static function install(string $path, ApplicationAbstract $app) : void { - \Modules\Search\Admin\Installer::installExternal($dbPool, ['path' => __DIR__ . '/SearchCommands.php']); + \Modules\Search\Admin\Installer::installExternal($app, ['path' => __DIR__ . '/SearchCommands.php']); } } diff --git a/Admin/Installer.php b/Admin/Installer.php index 132a509..95ee7b9 100755 --- a/Admin/Installer.php +++ b/Admin/Installer.php @@ -19,6 +19,7 @@ use Modules\Navigation\Models\NavElementMapper; use phpOMS\DataStorage\Database\DatabasePool; use phpOMS\Module\InstallerAbstract; use phpOMS\System\File\PathException; +use phpOMS\Application\ApplicationAbstract; /** * Installer class. @@ -33,7 +34,7 @@ final class Installer extends InstallerAbstract /** * Install data from providing modules. * - * @param DatabasePool $dbPool Database pool + * @param ApplicationAbstract $app Application * @param array $data Module info * * @return array @@ -43,10 +44,10 @@ final class Installer extends InstallerAbstract * * @since 1.0.0 */ - public static function installExternal(DatabasePool $dbPool, array $data) : array + public static function installExternal(ApplicationAbstract $app, array $data) : array { try { - $dbPool->get()->con->query('select 1 from `nav`'); + $app->dbPool->get()->con->query('select 1 from `nav`'); } catch (\Exception $e) { return []; // @codeCoverageIgnore } @@ -62,7 +63,7 @@ final class Installer extends InstallerAbstract } foreach ($navData as $link) { - self::installLink($dbPool, $link); + self::installLink($app->dbPool, $link); } return [];