mirror of
https://github.com/Karaka-Management/oms-Navigation.git
synced 2026-01-27 23:58:40 +00:00
add app to installer
This commit is contained in:
parent
1d1e03943e
commit
a98e51dd45
|
|
@ -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']);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 [];
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user