bug fixes

This commit is contained in:
Dennis Eichhorn 2021-06-05 11:01:03 +02:00
parent 92792549d1
commit 8fb4e0b182
5 changed files with 58 additions and 4 deletions

View File

@ -0,0 +1,7 @@
[
{
"src": "Modules/Shop/Install/Application/Shop",
"dest": "Web/Shop",
"name": "Shop"
}
]

45
Admin/Install/CMS.php Normal file
View File

@ -0,0 +1,45 @@
<?php
/**
* Orange Management
*
* PHP Version 8.0
*
* @package Modules\Shop\Admin\Install
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
namespace Modules\Shop\Admin\Install;
use Model\Setting;
use Model\SettingMapper;
use phpOMS\DataStorage\Database\DatabasePool;
/**
* CMS class.
*
* @package Modules\Shop\Admin\Install
* @license OMS License 1.0
* @link https://orange-management.org
* @since 1.0.0
*/
class CMS
{
/**
* Install media 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) : void
{
$app = \Modules\CMS\Admin\Installer::installExternal($dbPool, ['path' => __DIR__ . '/CMS.install.json']);
}
}

View File

@ -2,8 +2,8 @@
"shop_category": {
"name": "shop_category",
"fields": {
"shop_id": {
"name": "shop_id",
"shop_category_id": {
"name": "shop_category_id",
"type": "INT",
"null": false,
"primary": true

View File

@ -18,6 +18,7 @@ use phpOMS\DataStorage\Database\DatabasePool;
use phpOMS\Module\InstallerAbstract;
use phpOMS\Module\ModuleInfo;
use phpOMS\System\File\Local\Directory;
use phpOMS\Config\SettingsInterface;
/**
* Installer class.
@ -32,14 +33,15 @@ final class Installer extends InstallerAbstract
/**
* {@inheritdoc}
*/
public static function install(DatabasePool $dbPool, ModuleInfo $info) : void
public static function install(DatabasePool $dbPool, ModuleInfo $info, SettingsInterface $cfgHandler) : void
{
if (\file_exists(__DIR__ . '/../../../Web/Shop')) {
Directory::delete(__DIR__ . '/../../../Web/Shop');
}
// @todo: replace with app installation (see TimeRecording...)
Directory::copy(__DIR__ . '/Install/Shop', __DIR__ . '/../../../Web/Shop');
parent::install($dbPool, $info);
parent::install($dbPool, $info, $cfgHandler);
}
}