mirror of
https://github.com/Karaka-Management/oms-Organization.git
synced 2026-02-05 19:18:40 +00:00
Optimize navigation install
This commit is contained in:
parent
9549bb4184
commit
af791278e1
|
|
@ -27,24 +27,17 @@ use phpOMS\DataStorage\Database\DatabasePool;
|
|||
class Navigation
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
* Install navigation providing
|
||||
*
|
||||
* @param string $path Module path
|
||||
* @param DatabasePool $dbPool Database pool for database interaction
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public static function install(string $path, DatabasePool $dbPool)
|
||||
public static function install(string $path = null, DatabasePool $dbPool = null) : void
|
||||
{
|
||||
$navFile = \file_get_contents(__DIR__ . '/Navigation.install.json');
|
||||
|
||||
if ($navFile === false) {
|
||||
throw new \Exception();
|
||||
}
|
||||
|
||||
$navData = \json_decode($navFile, true);
|
||||
|
||||
if ($navData === false) {
|
||||
throw new \Exception();
|
||||
}
|
||||
|
||||
$class = '\\Modules\\Navigation\\Admin\\Installer';
|
||||
/** @var $class \Modules\Navigation\Admin\Installer */
|
||||
$class::installExternal($dbPool, $navData);
|
||||
\Modules\Navigation\Admin\Installer::installExternal($dbPool, ['path' => __DIR__ . '/Navigation.install.json']);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user