mirror of
https://github.com/Karaka-Management/oms-SalesAnalysis.git
synced 2026-01-11 19:38:39 +00:00
Optimize navigation install
This commit is contained in:
parent
201ceb9612
commit
6e0347459c
|
|
@ -29,7 +29,7 @@ class Navigation
|
||||||
/**
|
/**
|
||||||
* Install navigation providing
|
* Install navigation providing
|
||||||
*
|
*
|
||||||
* @param string $path Path to some file
|
* @param string $path Module path
|
||||||
* @param DatabasePool $dbPool Database pool for database interaction
|
* @param DatabasePool $dbPool Database pool for database interaction
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
|
|
@ -38,20 +38,6 @@ class Navigation
|
||||||
*/
|
*/
|
||||||
public static function install(string $path = null, DatabasePool $dbPool = null) : void
|
public static function install(string $path = null, DatabasePool $dbPool = null) : void
|
||||||
{
|
{
|
||||||
$navFile = \file_get_contents(__DIR__ . '/Navigation.install.json');
|
\Modules\Navigation\Admin\Installer::installExternal($dbPool, ['path' => __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);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user