From da200dacf6aff811c522efef7909a07a76fcebd7 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Fri, 26 Jan 2024 22:53:59 +0000 Subject: [PATCH] auto fixes + some impl. --- Admin/Install/db.json | 5 ++ Admin/Installer.php | 5 +- Admin/Routes/Web/Api.php | 2 +- Admin/Routes/Web/Backend.php | 18 ++--- Controller/ApiAttributeController.php | 16 ++++- Controller/ApiController.php | 17 ++--- Controller/BackendController.php | 29 +++----- Models/AmountGroupMapper.php | 14 ++-- Models/AmountMapper.php | 10 +-- Models/AmountTypeL11nMapper.php | 2 +- .../InvestmentObjectAttributeMapper.php | 8 +-- .../InvestmentObjectAttributeTypeMapper.php | 3 +- ...vestmentObjectAttributeValueL11nMapper.php | 8 +-- .../InvestmentObjectAttributeValueMapper.php | 18 ++--- Models/Investment.php | 1 - Models/InvestmentMapper.php | 24 +++---- Models/InvestmentObjectMapper.php | 30 ++++---- Models/InvestmentTypeL11nMapper.php | 2 +- Models/InvestmentTypeMapper.php | 4 +- Theme/Backend/Lang/de.lang.php | 26 +++---- Theme/Backend/Lang/en.lang.php | 26 +++---- Theme/Backend/investment-list.tpl.php | 38 +++++----- ...tpl.php => investment-object-view.tpl.php} | 4 +- ...rofile.tpl.php => investment-view.tpl.php} | 6 +- tests/Autoloader.php | 4 +- tests/Bootstrap.php | 71 +++++++++++-------- 26 files changed, 203 insertions(+), 188 deletions(-) rename Theme/Backend/{investment-object-profile.tpl.php => investment-object-view.tpl.php} (96%) rename Theme/Backend/{investment-profile.tpl.php => investment-view.tpl.php} (98%) diff --git a/Admin/Install/db.json b/Admin/Install/db.json index 610bc60..e369526 100755 --- a/Admin/Install/db.json +++ b/Admin/Install/db.json @@ -263,6 +263,11 @@ "type": "TINYINT(1)", "null": false }, + "investmgmt_attr_type_internal": { + "name": "investmgmt_attr_type_internal", + "type": "TINYINT(1)", + "null": false + }, "investmgmt_attr_type_required": { "description": "Every item must have this attribute type if set to true.", "name": "investmgmt_attr_type_required", diff --git a/Admin/Installer.php b/Admin/Installer.php index 13c9b0f..163b12e 100755 --- a/Admin/Installer.php +++ b/Admin/Installer.php @@ -20,7 +20,6 @@ use phpOMS\Message\Http\HttpRequest; use phpOMS\Message\Http\HttpResponse; use phpOMS\Module\InstallerAbstract; use phpOMS\Module\ModuleInfo; -use phpOMS\Uri\HttpUri; /** * Installer class. @@ -79,7 +78,7 @@ final class Installer extends InstallerAbstract /** @var array $type */ foreach ($types as $type) { $response = new HttpResponse(); - $request = new HttpRequest(new HttpUri('')); + $request = new HttpRequest(); $request->header->account = 1; $request->setData('name', $type['name'] ?? ''); @@ -105,7 +104,7 @@ final class Installer extends InstallerAbstract } $response = new HttpResponse(); - $request = new HttpRequest(new HttpUri('')); + $request = new HttpRequest(); $request->header->account = 1; $request->setData('title', $l11n); diff --git a/Admin/Routes/Web/Api.php b/Admin/Routes/Web/Api.php index 44fef03..f4bb127 100644 --- a/Admin/Routes/Web/Api.php +++ b/Admin/Routes/Web/Api.php @@ -18,7 +18,7 @@ use phpOMS\Account\PermissionType; use phpOMS\Router\RouteVerb; return [ - '^.*/finance/investment/find.*$' => [ + '^.*/finance/investment/find(\?.*$|$)' => [ [ 'dest' => '\Modules\InvestmentManagement\Controller\ApiController:apiInvestmentFind', 'verb' => RouteVerb::GET, diff --git a/Admin/Routes/Web/Backend.php b/Admin/Routes/Web/Backend.php index 5a5797d..ed067c9 100755 --- a/Admin/Routes/Web/Backend.php +++ b/Admin/Routes/Web/Backend.php @@ -6,7 +6,7 @@ use phpOMS\Account\PermissionType; use phpOMS\Router\RouteVerb; return [ - '^.*/finance/investment/list.*$' => [ + '^.*/finance/investment/list(\?.*$|$)' => [ [ 'dest' => '\Modules\InvestmentManagement\Controller\BackendController:viewInvestmentList', 'verb' => RouteVerb::GET, @@ -17,9 +17,9 @@ return [ ], ], ], - '^.*/finance/investment/profile.*$' => [ + '^.*/finance/investment/view(\?.*$|$)' => [ [ - 'dest' => '\Modules\InvestmentManagement\Controller\BackendController:viewInvestmentProfile', + 'dest' => '\Modules\InvestmentManagement\Controller\BackendController:viewInvestmentView', 'verb' => RouteVerb::GET, 'permission' => [ 'module' => BackendController::MODULE_NAME, @@ -28,7 +28,7 @@ return [ ], ], ], - '^.*/finance/investment/create.*$' => [ + '^.*/finance/investment/create(\?.*$|$)' => [ [ 'dest' => '\Modules\InvestmentManagement\Controller\BackendController:viewInvestmentCreate', 'verb' => RouteVerb::GET, @@ -39,9 +39,9 @@ return [ ], ], ], - '^.*/finance/investment/object.*$' => [ + '^.*/finance/investment/object(\?.*$|$)' => [ [ - 'dest' => '\Modules\InvestmentManagement\Controller\BackendController:viewInvestmentObjectProfile', + 'dest' => '\Modules\InvestmentManagement\Controller\BackendController:viewInvestmentObjectView', 'verb' => RouteVerb::GET, 'permission' => [ 'module' => BackendController::MODULE_NAME, @@ -51,7 +51,7 @@ return [ ], ], - '^.*/private/investment/list.*$' => [ + '^.*/private/investment/list(\?.*$|$)' => [ [ 'dest' => '\Modules\InvestmentManagement\Controller\BackendController:viewInvestmentList', 'verb' => RouteVerb::GET, @@ -62,9 +62,9 @@ return [ ], ], ], - '^.*/private/investment/profile.*$' => [ + '^.*/private/investment/view(\?.*$|$)' => [ [ - 'dest' => '\Modules\InvestmentManagement\Controller\BackendController:viewInvestmentProfile', + 'dest' => '\Modules\InvestmentManagement\Controller\BackendController:viewInvestmentView', 'verb' => RouteVerb::GET, 'permission' => [ 'module' => BackendController::MODULE_NAME, diff --git a/Controller/ApiAttributeController.php b/Controller/ApiAttributeController.php index e888406..f89b600 100644 --- a/Controller/ApiAttributeController.php +++ b/Controller/ApiAttributeController.php @@ -61,12 +61,15 @@ final class ApiAttributeController extends Controller return; } - $type = InvestmentObjectAttributeTypeMapper::get()->with('defaults')->where('id', (int) $request->getData('type'))->execute(); + $type = InvestmentObjectAttributeTypeMapper::get() + ->with('defaults') + ->where('id', (int) $request->getData('type')) + ->execute(); if (!$type->repeatable) { $attr = InvestmentObjectAttributeMapper::count() ->with('type') - ->where('type/id', (int) $request->getData('type')) + ->where('type/id', $type->id) ->where('ref', (int) $request->getData('ref')) ->execute(); @@ -164,13 +167,20 @@ final class ApiAttributeController extends Controller ->where('id', $request->getDataInt('type') ?? 0) ->execute(); + if ($type->isInternal) { + $response->header->status = RequestStatusCode::R_403; + $this->createInvalidCreateResponse($request, $response, $val); + + return; + } + $attrValue = $this->createAttributeValueFromRequest($request, $type); $this->createModel($request->header->account, $attrValue, InvestmentObjectAttributeValueMapper::class, 'attr_value', $request->getOrigin()); if ($attrValue->isDefault) { $this->createModelRelation( $request->header->account, - (int) $request->getData('type'), + $type->id, $attrValue->id, InvestmentObjectAttributeTypeMapper::class, 'defaults', '', $request->getOrigin() ); diff --git a/Controller/ApiController.php b/Controller/ApiController.php index 904a02e..2541ca3 100644 --- a/Controller/ApiController.php +++ b/Controller/ApiController.php @@ -99,7 +99,7 @@ final class ApiController extends Controller $investment = new Investment(); $investment->name = $request->getDataString('name') ?? ''; $investment->description = $request->getDataString('description') ?? ''; - $investment->status = $request->getDataInt('status') ?? InvestmentStatus::DRAFT; + $investment->status = InvestmentStatus::tryFromValue($request->getDataInt('status')) ?? InvestmentStatus::DRAFT; $investment->description = $request->getDataString('description') ?? ''; $investment->unit = $request->getDataInt('unit') ?? $this->app->unitId; $investment->createdBy = new NullAccount($request->header->account); @@ -814,7 +814,10 @@ final class ApiController extends Controller { $type = new BaseStringL11nType(); $type->title = $request->getDataString('name') ?? ''; - $type->setL11n($request->getDataString('title') ?? '', $request->getDataString('language') ?? ISO639x1Enum::_EN); + $type->setL11n( + $request->getDataString('title') ?? '', + ISO639x1Enum::tryFromValue($request->getDataString('language')) ?? ISO639x1Enum::_EN + ); return $type; } @@ -878,12 +881,10 @@ final class ApiController extends Controller */ private function createAmountTypeL11nFromRequest(RequestAbstract $request) : BaseStringL11n { - $typeL11n = new BaseStringL11n(); - $typeL11n->ref = $request->getDataInt('type') ?? 0; - $typeL11n->setLanguage( - $request->getDataString('language') ?? $request->header->l11n->language - ); - $typeL11n->content = $request->getDataString('title') ?? ''; + $typeL11n = new BaseStringL11n(); + $typeL11n->ref = $request->getDataInt('type') ?? 0; + $typeL11n->language = ISO639x1Enum::tryFromValue($request->getDataString('language')) ?? $request->header->l11n->language; + $typeL11n->content = $request->getDataString('title') ?? ''; return $typeL11n; } diff --git a/Controller/BackendController.php b/Controller/BackendController.php index 6b17ca8..1a2e79a 100755 --- a/Controller/BackendController.php +++ b/Controller/BackendController.php @@ -14,16 +14,11 @@ declare(strict_types=1); namespace Modules\InvestmentManagement\Controller; -use Modules\Admin\Models\LocalizationMapper; -use Modules\Admin\Models\SettingsEnum; use Modules\InvestmentManagement\Models\InvestmentMapper; use Modules\InvestmentManagement\Models\InvestmentObjectMapper; use Modules\InvestmentManagement\Models\InvestmentTypeMapper; -use Modules\Media\Models\MediaMapper; -use Modules\Media\Models\MediaTypeMapper; use Modules\Organization\Models\UnitMapper; use phpOMS\Contract\RenderableInterface; -use phpOMS\DataStorage\Database\Query\Builder; use phpOMS\Message\RequestAbstract; use phpOMS\Message\ResponseAbstract; use phpOMS\Views\View; @@ -78,10 +73,10 @@ final class BackendController extends Controller * @since 1.0.0 * @codeCoverageIgnore */ - public function viewInvestmentObjectProfile(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface + public function viewInvestmentObjectView(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface { $view = new View($this->app->l11nManager, $request, $response); - $view->setTemplate('/Modules/InvestmentManagement/Theme/Backend/investment-object-profile'); + $view->setTemplate('/Modules/InvestmentManagement/Theme/Backend/investment-object-view'); $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1007101001, $request, $response); $object = InvestmentObjectMapper::get() @@ -95,11 +90,8 @@ final class BackendController extends Controller $view->data['object'] = $object; - /** @var \Model\Setting $settings */ - $settings = $this->app->appSettings->get(null, SettingsEnum::DEFAULT_LOCALIZATION); - - $view->data['attributeView'] = new \Modules\Attribute\Theme\Backend\Components\AttributeView($this->app->l11nManager, $request, $response); - $view->data['attributeView']->data['default_localization'] = LocalizationMapper::get()->where('id', (int) $settings->id)->execute(); + $view->data['attributeView'] = new \Modules\Attribute\Theme\Backend\Components\AttributeView($this->app->l11nManager, $request, $response); + $view->data['attributeView']->data['default_localization'] = $this->app->l11nServer; $view->data['media-upload'] = new \Modules\Media\Theme\Backend\Components\Upload\BaseView($this->app->l11nManager, $request, $response); @@ -118,10 +110,10 @@ final class BackendController extends Controller * @since 1.0.0 * @codeCoverageIgnore */ - public function viewInvestmentProfile(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface + public function viewInvestmentView(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface { $view = new View($this->app->l11nManager, $request, $response); - $view->setTemplate('/Modules/InvestmentManagement/Theme/Backend/investment-profile'); + $view->setTemplate('/Modules/InvestmentManagement/Theme/Backend/investment-view'); $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1007101001, $request, $response); $investment = InvestmentMapper::get() @@ -147,11 +139,8 @@ final class BackendController extends Controller $view->data['investment'] = $investment; - /** @var \Model\Setting $settings */ - $settings = $this->app->appSettings->get(null, SettingsEnum::DEFAULT_LOCALIZATION); - - $view->data['attributeView'] = new \Modules\Attribute\Theme\Backend\Components\AttributeView($this->app->l11nManager, $request, $response); - $view->data['attributeView']->data['default_localization'] = LocalizationMapper::get()->where('id', (int) $settings->id)->execute(); + $view->data['attributeView'] = new \Modules\Attribute\Theme\Backend\Components\AttributeView($this->app->l11nManager, $request, $response); + $view->data['attributeView']->data['default_localization'] = $this->app->l11nServer; $investmentTypes = InvestmentTypeMapper::getAll() ->with('l11n') @@ -166,7 +155,7 @@ final class BackendController extends Controller $view->data['units'] = $units; $view->data['media-upload'] = new \Modules\Media\Theme\Backend\Components\Upload\BaseView($this->app->l11nManager, $request, $response); - $view->data['note'] = new \Modules\Editor\Theme\Backend\Components\Note\BaseView($this->app->l11nManager, $request, $response); + $view->data['note'] = new \Modules\Editor\Theme\Backend\Components\Note\BaseView($this->app->l11nManager, $request, $response); return $view; } diff --git a/Models/AmountGroupMapper.php b/Models/AmountGroupMapper.php index 0f1b13a..1975f84 100644 --- a/Models/AmountGroupMapper.php +++ b/Models/AmountGroupMapper.php @@ -36,10 +36,10 @@ final class AmountGroupMapper extends DataMapperFactory * @since 1.0.0 */ public const COLUMNS = [ - 'investmgmt_amount_group_id' => ['name' => 'investmgmt_amount_group_id', 'type' => 'int', 'internal' => 'id'], - 'investmgmt_amount_group_name' => ['name' => 'investmgmt_amount_group_name', 'type' => 'string', 'internal' => 'name'], - 'investmgmt_amount_group_type' => ['name' => 'investmgmt_amount_group_type', 'type' => 'int', 'internal' => 'type'], - 'investmgmt_amount_group_option' => ['name' => 'investmgmt_amount_group_option', 'type' => 'int', 'internal' => 'option'], + 'investmgmt_amount_group_id' => ['name' => 'investmgmt_amount_group_id', 'type' => 'int', 'internal' => 'id'], + 'investmgmt_amount_group_name' => ['name' => 'investmgmt_amount_group_name', 'type' => 'string', 'internal' => 'name'], + 'investmgmt_amount_group_type' => ['name' => 'investmgmt_amount_group_type', 'type' => 'int', 'internal' => 'type'], + 'investmgmt_amount_group_option' => ['name' => 'investmgmt_amount_group_option', 'type' => 'int', 'internal' => 'option'], ]; /** @@ -49,9 +49,9 @@ final class AmountGroupMapper extends DataMapperFactory * @since 1.0.0 */ public const OWNS_ONE = [ - 'type' => [ - 'mapper' => AmountTypeMapper::class, - 'external' => 'investmgmt_amount_group_type', + 'type' => [ + 'mapper' => AmountTypeMapper::class, + 'external' => 'investmgmt_amount_group_type', ], ]; diff --git a/Models/AmountMapper.php b/Models/AmountMapper.php index 2212343..66d06c9 100644 --- a/Models/AmountMapper.php +++ b/Models/AmountMapper.php @@ -36,11 +36,11 @@ final class AmountMapper extends DataMapperFactory * @since 1.0.0 */ public const COLUMNS = [ - 'investmgmt_amount_id' => ['name' => 'investmgmt_amount_id', 'type' => 'int', 'internal' => 'id'], - 'investmgmt_amount_name' => ['name' => 'investmgmt_amount_name', 'type' => 'string', 'internal' => 'name'], - 'investmgmt_amount_amount' => ['name' => 'investmgmt_amount_amount', 'type' => 'Serializable', 'internal' => 'amount'], - 'investmgmt_amount_date' => ['name' => 'investmgmt_amount_date', 'type' => 'DateTime', 'internal' => 'date'], - 'investmgmt_amount_group' => ['name' => 'investmgmt_amount_group', 'type' => 'int', 'internal' => 'group'], + 'investmgmt_amount_id' => ['name' => 'investmgmt_amount_id', 'type' => 'int', 'internal' => 'id'], + 'investmgmt_amount_name' => ['name' => 'investmgmt_amount_name', 'type' => 'string', 'internal' => 'name'], + 'investmgmt_amount_amount' => ['name' => 'investmgmt_amount_amount', 'type' => 'Serializable', 'internal' => 'amount'], + 'investmgmt_amount_date' => ['name' => 'investmgmt_amount_date', 'type' => 'DateTime', 'internal' => 'date'], + 'investmgmt_amount_group' => ['name' => 'investmgmt_amount_group', 'type' => 'int', 'internal' => 'group'], ]; /** diff --git a/Models/AmountTypeL11nMapper.php b/Models/AmountTypeL11nMapper.php index 8437656..c288b36 100644 --- a/Models/AmountTypeL11nMapper.php +++ b/Models/AmountTypeL11nMapper.php @@ -18,7 +18,7 @@ use phpOMS\DataStorage\Database\Mapper\DataMapperFactory; use phpOMS\Localization\BaseStringL11n; /** - * mapper class. + * Amount type l11n mapper class. * * @package Modules\InvestmentManagement\Models * @license OMS License 2.0 diff --git a/Models/Attribute/InvestmentObjectAttributeMapper.php b/Models/Attribute/InvestmentObjectAttributeMapper.php index 15f33ef..ebd52c9 100644 --- a/Models/Attribute/InvestmentObjectAttributeMapper.php +++ b/Models/Attribute/InvestmentObjectAttributeMapper.php @@ -37,10 +37,10 @@ final class InvestmentObjectAttributeMapper extends DataMapperFactory * @since 1.0.0 */ public const COLUMNS = [ - 'investmgmt_option_attr_id' => ['name' => 'investmgmt_option_attr_id', 'type' => 'int', 'internal' => 'id'], - 'investmgmt_option_attr_option' => ['name' => 'investmgmt_option_attr_option', 'type' => 'int', 'internal' => 'ref'], - 'investmgmt_option_attr_type' => ['name' => 'investmgmt_option_attr_type', 'type' => 'int', 'internal' => 'type'], - 'investmgmt_option_attr_value' => ['name' => 'investmgmt_option_attr_value', 'type' => 'int', 'internal' => 'value'], + 'investmgmt_option_attr_id' => ['name' => 'investmgmt_option_attr_id', 'type' => 'int', 'internal' => 'id'], + 'investmgmt_option_attr_option' => ['name' => 'investmgmt_option_attr_option', 'type' => 'int', 'internal' => 'ref'], + 'investmgmt_option_attr_type' => ['name' => 'investmgmt_option_attr_type', 'type' => 'int', 'internal' => 'type'], + 'investmgmt_option_attr_value' => ['name' => 'investmgmt_option_attr_value', 'type' => 'int', 'internal' => 'value'], ]; /** diff --git a/Models/Attribute/InvestmentObjectAttributeTypeMapper.php b/Models/Attribute/InvestmentObjectAttributeTypeMapper.php index ecf8c78..6efa7ee 100644 --- a/Models/Attribute/InvestmentObjectAttributeTypeMapper.php +++ b/Models/Attribute/InvestmentObjectAttributeTypeMapper.php @@ -42,7 +42,8 @@ final class InvestmentObjectAttributeTypeMapper extends DataMapperFactory 'investmgmt_attr_type_datatype' => ['name' => 'investmgmt_attr_type_datatype', 'type' => 'int', 'internal' => 'datatype'], 'investmgmt_attr_type_fields' => ['name' => 'investmgmt_attr_type_fields', 'type' => 'int', 'internal' => 'fields'], 'investmgmt_attr_type_custom' => ['name' => 'investmgmt_attr_type_custom', 'type' => 'bool', 'internal' => 'custom'], - 'investmgmt_attr_type_repeatable' => ['name' => 'investmgmt_attr_type_repeatable', 'type' => 'bool', 'internal' => 'repeatable'], + 'investmgmt_attr_type_repeatable' => ['name' => 'investmgmt_attr_type_repeatable', 'type' => 'bool', 'internal' => 'repeatable'], + 'investmgmt_attr_type_internal' => ['name' => 'investmgmt_attr_type_internal', 'type' => 'bool', 'internal' => 'isInternal'], 'investmgmt_attr_type_pattern' => ['name' => 'investmgmt_attr_type_pattern', 'type' => 'string', 'internal' => 'validationPattern'], 'investmgmt_attr_type_required' => ['name' => 'investmgmt_attr_type_required', 'type' => 'bool', 'internal' => 'isRequired'], ]; diff --git a/Models/Attribute/InvestmentObjectAttributeValueL11nMapper.php b/Models/Attribute/InvestmentObjectAttributeValueL11nMapper.php index 2653c58..02328d1 100644 --- a/Models/Attribute/InvestmentObjectAttributeValueL11nMapper.php +++ b/Models/Attribute/InvestmentObjectAttributeValueL11nMapper.php @@ -37,10 +37,10 @@ final class InvestmentObjectAttributeValueL11nMapper extends DataMapperFactory * @since 1.0.0 */ public const COLUMNS = [ - 'investmgmt_attr_value_l11n_id' => ['name' => 'investmgmt_attr_value_l11n_id', 'type' => 'int', 'internal' => 'id'], - 'investmgmt_attr_value_l11n_title' => ['name' => 'investmgmt_attr_value_l11n_title', 'type' => 'string', 'internal' => 'content', 'autocomplete' => true], - 'investmgmt_attr_value_l11n_value' => ['name' => 'investmgmt_attr_value_l11n_value', 'type' => 'int', 'internal' => 'ref'], - 'investmgmt_attr_value_l11n_lang' => ['name' => 'investmgmt_attr_value_l11n_lang', 'type' => 'string', 'internal' => 'language'], + 'investmgmt_attr_value_l11n_id' => ['name' => 'investmgmt_attr_value_l11n_id', 'type' => 'int', 'internal' => 'id'], + 'investmgmt_attr_value_l11n_title' => ['name' => 'investmgmt_attr_value_l11n_title', 'type' => 'string', 'internal' => 'content', 'autocomplete' => true], + 'investmgmt_attr_value_l11n_value' => ['name' => 'investmgmt_attr_value_l11n_value', 'type' => 'int', 'internal' => 'ref'], + 'investmgmt_attr_value_l11n_lang' => ['name' => 'investmgmt_attr_value_l11n_lang', 'type' => 'string', 'internal' => 'language'], ]; /** diff --git a/Models/Attribute/InvestmentObjectAttributeValueMapper.php b/Models/Attribute/InvestmentObjectAttributeValueMapper.php index 80ba9a7..fca9c74 100644 --- a/Models/Attribute/InvestmentObjectAttributeValueMapper.php +++ b/Models/Attribute/InvestmentObjectAttributeValueMapper.php @@ -37,15 +37,15 @@ final class InvestmentObjectAttributeValueMapper extends DataMapperFactory * @since 1.0.0 */ public const COLUMNS = [ - 'investmgmt_attr_value_id' => ['name' => 'investmgmt_attr_value_id', 'type' => 'int', 'internal' => 'id'], - 'investmgmt_attr_value_default' => ['name' => 'investmgmt_attr_value_default', 'type' => 'bool', 'internal' => 'isDefault'], - 'investmgmt_attr_value_valueStr' => ['name' => 'investmgmt_attr_value_valueStr', 'type' => 'string', 'internal' => 'valueStr'], - 'investmgmt_attr_value_valueInt' => ['name' => 'investmgmt_attr_value_valueInt', 'type' => 'int', 'internal' => 'valueInt'], - 'investmgmt_attr_value_valueDec' => ['name' => 'investmgmt_attr_value_valueDec', 'type' => 'float', 'internal' => 'valueDec'], - 'investmgmt_attr_value_valueDat' => ['name' => 'investmgmt_attr_value_valueDat', 'type' => 'DateTime', 'internal' => 'valueDat'], - 'investmgmt_attr_value_unit' => ['name' => 'investmgmt_attr_value_unit', 'type' => 'string', 'internal' => 'unit'], - 'investmgmt_attr_value_deptype' => ['name' => 'investmgmt_attr_value_deptype', 'type' => 'int', 'internal' => 'dependingAttributeType'], - 'investmgmt_attr_value_depvalue' => ['name' => 'investmgmt_attr_value_depvalue', 'type' => 'int', 'internal' => 'dependingAttributeValue'], + 'investmgmt_attr_value_id' => ['name' => 'investmgmt_attr_value_id', 'type' => 'int', 'internal' => 'id'], + 'investmgmt_attr_value_default' => ['name' => 'investmgmt_attr_value_default', 'type' => 'bool', 'internal' => 'isDefault'], + 'investmgmt_attr_value_valueStr' => ['name' => 'investmgmt_attr_value_valueStr', 'type' => 'string', 'internal' => 'valueStr'], + 'investmgmt_attr_value_valueInt' => ['name' => 'investmgmt_attr_value_valueInt', 'type' => 'int', 'internal' => 'valueInt'], + 'investmgmt_attr_value_valueDec' => ['name' => 'investmgmt_attr_value_valueDec', 'type' => 'float', 'internal' => 'valueDec'], + 'investmgmt_attr_value_valueDat' => ['name' => 'investmgmt_attr_value_valueDat', 'type' => 'DateTime', 'internal' => 'valueDat'], + 'investmgmt_attr_value_unit' => ['name' => 'investmgmt_attr_value_unit', 'type' => 'string', 'internal' => 'unit'], + 'investmgmt_attr_value_deptype' => ['name' => 'investmgmt_attr_value_deptype', 'type' => 'int', 'internal' => 'dependingAttributeType'], + 'investmgmt_attr_value_depvalue' => ['name' => 'investmgmt_attr_value_depvalue', 'type' => 'int', 'internal' => 'dependingAttributeValue'], ]; /** diff --git a/Models/Investment.php b/Models/Investment.php index 36eca0c..1912420 100644 --- a/Models/Investment.php +++ b/Models/Investment.php @@ -16,7 +16,6 @@ namespace Modules\InvestmentManagement\Models; use Modules\Admin\Models\Account; use Modules\Admin\Models\NullAccount; -use phpOMS\Business\Finance\DepreciationType; use phpOMS\Localization\BaseStringL11nType; /** diff --git a/Models/InvestmentMapper.php b/Models/InvestmentMapper.php index aaf31c8..ded2e5b 100644 --- a/Models/InvestmentMapper.php +++ b/Models/InvestmentMapper.php @@ -39,14 +39,14 @@ final class InvestmentMapper extends DataMapperFactory * @since 1.0.0 */ public const COLUMNS = [ - 'investmgmt_investment_id' => ['name' => 'investmgmt_investment_id', 'type' => 'int', 'internal' => 'id'], - 'investmgmt_investment_name' => ['name' => 'investmgmt_investment_name', 'type' => 'string', 'internal' => 'name'], - 'investmgmt_investment_description' => ['name' => 'investmgmt_investment_description', 'type' => 'string', 'internal' => 'description'], - 'investmgmt_investment_status' => ['name' => 'investmgmt_investment_status', 'type' => 'int', 'internal' => 'status'], - 'investmgmt_investment_unit' => ['name' => 'investmgmt_investment_unit', 'type' => 'int', 'internal' => 'unit'], - 'investmgmt_investment_created_by' => ['name' => 'investmgmt_investment_created_by', 'type' => 'int', 'internal' => 'createdBy', 'readonly' => true], - 'investmgmt_investment_performance' => ['name' => 'investmgmt_investment_performance', 'type' => 'DateTime', 'internal' => 'performanceDate'], - 'investmgmt_investment_created_at' => ['name' => 'investmgmt_investment_created_at', 'type' => 'DateTimeImmutable', 'internal' => 'createdAt', 'readonly' => true], + 'investmgmt_investment_id' => ['name' => 'investmgmt_investment_id', 'type' => 'int', 'internal' => 'id'], + 'investmgmt_investment_name' => ['name' => 'investmgmt_investment_name', 'type' => 'string', 'internal' => 'name'], + 'investmgmt_investment_description' => ['name' => 'investmgmt_investment_description', 'type' => 'string', 'internal' => 'description'], + 'investmgmt_investment_status' => ['name' => 'investmgmt_investment_status', 'type' => 'int', 'internal' => 'status'], + 'investmgmt_investment_unit' => ['name' => 'investmgmt_investment_unit', 'type' => 'int', 'internal' => 'unit'], + 'investmgmt_investment_created_by' => ['name' => 'investmgmt_investment_created_by', 'type' => 'int', 'internal' => 'createdBy', 'readonly' => true], + 'investmgmt_investment_performance' => ['name' => 'investmgmt_investment_performance', 'type' => 'DateTime', 'internal' => 'performanceDate'], + 'investmgmt_investment_created_at' => ['name' => 'investmgmt_investment_created_at', 'type' => 'DateTimeImmutable', 'internal' => 'createdAt', 'readonly' => true], ]; /** @@ -57,8 +57,8 @@ final class InvestmentMapper extends DataMapperFactory */ public const OWNS_ONE = [ 'type' => [ - 'mapper' => InvestmentTypeMapper::class, - 'external' => 'investmgmt_investment_type', + 'mapper' => InvestmentTypeMapper::class, + 'external' => 'investmgmt_investment_type', ], ]; @@ -97,8 +97,8 @@ final class InvestmentMapper extends DataMapperFactory */ public const BELONGS_TO = [ 'createdBy' => [ - 'mapper' => AccountMapper::class, - 'external' => 'investmgmt_investment_created_by', + 'mapper' => AccountMapper::class, + 'external' => 'investmgmt_investment_created_by', ], ]; diff --git a/Models/InvestmentObjectMapper.php b/Models/InvestmentObjectMapper.php index 2fe84b7..ee6fbb7 100644 --- a/Models/InvestmentObjectMapper.php +++ b/Models/InvestmentObjectMapper.php @@ -41,15 +41,15 @@ final class InvestmentObjectMapper extends DataMapperFactory * @since 1.0.0 */ public const COLUMNS = [ - 'investmgmt_option_id' => ['name' => 'investmgmt_option_id', 'type' => 'int', 'internal' => 'id'], - 'investmgmt_option_name' => ['name' => 'investmgmt_option_name', 'type' => 'string', 'internal' => 'name'], - 'investmgmt_option_description' => ['name' => 'investmgmt_option_description', 'type' => 'string', 'internal' => 'description'], - 'investmgmt_option_link' => ['name' => 'investmgmt_option_link', 'type' => 'string', 'internal' => 'link'], - 'investmgmt_option_supplier' => ['name' => 'investmgmt_option_supplier', 'type' => 'int', 'internal' => 'supplier'], - 'investmgmt_option_supplier_alt' => ['name' => 'investmgmt_option_supplier_alt', 'type' => 'string', 'internal' => 'supplierName'], - 'investmgmt_option_item' => ['name' => 'investmgmt_option_item', 'type' => 'int', 'internal' => 'item'], - 'investmgmt_option_approved' => ['name' => 'investmgmt_option_approved', 'type' => 'bool', 'internal' => 'approved'], - 'investmgmt_option_investment' => ['name' => 'investmgmt_option_investment', 'type' => 'int', 'internal' => 'investment'], + 'investmgmt_option_id' => ['name' => 'investmgmt_option_id', 'type' => 'int', 'internal' => 'id'], + 'investmgmt_option_name' => ['name' => 'investmgmt_option_name', 'type' => 'string', 'internal' => 'name'], + 'investmgmt_option_description' => ['name' => 'investmgmt_option_description', 'type' => 'string', 'internal' => 'description'], + 'investmgmt_option_link' => ['name' => 'investmgmt_option_link', 'type' => 'string', 'internal' => 'link'], + 'investmgmt_option_supplier' => ['name' => 'investmgmt_option_supplier', 'type' => 'int', 'internal' => 'supplier'], + 'investmgmt_option_supplier_alt' => ['name' => 'investmgmt_option_supplier_alt', 'type' => 'string', 'internal' => 'supplierName'], + 'investmgmt_option_item' => ['name' => 'investmgmt_option_item', 'type' => 'int', 'internal' => 'item'], + 'investmgmt_option_approved' => ['name' => 'investmgmt_option_approved', 'type' => 'bool', 'internal' => 'approved'], + 'investmgmt_option_investment' => ['name' => 'investmgmt_option_investment', 'type' => 'int', 'internal' => 'investment'], ]; /** @@ -59,13 +59,13 @@ final class InvestmentObjectMapper extends DataMapperFactory * @since 1.0.0 */ public const OWNS_ONE = [ - 'supplier' => [ - 'mapper' => SupplierMapper::class, - 'external' => 'investmgmt_option_supplier', + 'supplier' => [ + 'mapper' => SupplierMapper::class, + 'external' => 'investmgmt_option_supplier', ], - 'item' => [ - 'mapper' => ItemMapper::class, - 'external' => 'investmgmt_option_item', + 'item' => [ + 'mapper' => ItemMapper::class, + 'external' => 'investmgmt_option_item', ], ]; diff --git a/Models/InvestmentTypeL11nMapper.php b/Models/InvestmentTypeL11nMapper.php index c0b5ecd..78b2ec6 100644 --- a/Models/InvestmentTypeL11nMapper.php +++ b/Models/InvestmentTypeL11nMapper.php @@ -18,7 +18,7 @@ use phpOMS\DataStorage\Database\Mapper\DataMapperFactory; use phpOMS\Localization\BaseStringL11n; /** - * mapper class. + * Inspection type l11n mapper class. * * @package Modules\InvestmentManagement\Models * @license OMS License 2.0 diff --git a/Models/InvestmentTypeMapper.php b/Models/InvestmentTypeMapper.php index 60c924e..a832ec1 100644 --- a/Models/InvestmentTypeMapper.php +++ b/Models/InvestmentTypeMapper.php @@ -37,8 +37,8 @@ final class InvestmentTypeMapper extends DataMapperFactory * @since 1.0.0 */ public const COLUMNS = [ - 'investmgmt_investment_type_id' => ['name' => 'investmgmt_investment_type_id', 'type' => 'int', 'internal' => 'id'], - 'investmgmt_investment_type_name' => ['name' => 'investmgmt_investment_type_name', 'type' => 'string', 'internal' => 'title', 'autocomplete' => true], + 'investmgmt_investment_type_id' => ['name' => 'investmgmt_investment_type_id', 'type' => 'int', 'internal' => 'id'], + 'investmgmt_investment_type_name' => ['name' => 'investmgmt_investment_type_name', 'type' => 'string', 'internal' => 'title', 'autocomplete' => true], ]; diff --git a/Theme/Backend/Lang/de.lang.php b/Theme/Backend/Lang/de.lang.php index e80adf8..bc6e500 100644 --- a/Theme/Backend/Lang/de.lang.php +++ b/Theme/Backend/Lang/de.lang.php @@ -25,18 +25,18 @@ return ['InvestmentManagement' => [ 'Title' => 'Titel', 'Files' => 'Dateien', 'Notes' => 'Notizen', - 'Options' => 'Optionen', - 'Option' => 'Option', - 'Description' => 'Beschreibung', - 'Link' => 'Link', - 'Amounts' => 'Beträge', - 'Amount' => 'Betrag', - 'Quantity' => 'Menge', - 'Attributes' => 'Attribute', - 'Type' => 'Typ', - 'Purchase' => 'Kauf', + 'Options' => 'Optionen', + 'Option' => 'Option', + 'Description' => 'Beschreibung', + 'Link' => 'Link', + 'Amounts' => 'Beträge', + 'Amount' => 'Betrag', + 'Quantity' => 'Menge', + 'Attributes' => 'Attribute', + 'Type' => 'Typ', + 'Purchase' => 'Kauf', 'Price' => 'Preis', - 'Supplier' => 'Lieferant', - 'Approved' => 'Genehmigt', - 'Approve' => 'Genehmigen', + 'Supplier' => 'Lieferant', + 'Approved' => 'Genehmigt', + 'Approve' => 'Genehmigen', ]]; diff --git a/Theme/Backend/Lang/en.lang.php b/Theme/Backend/Lang/en.lang.php index 44578f8..ef3a975 100755 --- a/Theme/Backend/Lang/en.lang.php +++ b/Theme/Backend/Lang/en.lang.php @@ -25,18 +25,18 @@ return ['InvestmentManagement' => [ 'Title' => 'Title', 'Files' => 'Files', 'Notes' => 'Notes', - 'Options' => 'Options', - 'Option' => 'Option', - 'Description' => 'Description', - 'Link' => 'Link', - 'Amounts' => 'Amounts', - 'Amount' => 'Amount', - 'Quantity' => 'Quantity', - 'Attributes' => 'Attributes', - 'Type' => 'Type', - 'Purchase' => 'Purchase', + 'Options' => 'Options', + 'Option' => 'Option', + 'Description' => 'Description', + 'Link' => 'Link', + 'Amounts' => 'Amounts', + 'Amount' => 'Amount', + 'Quantity' => 'Quantity', + 'Attributes' => 'Attributes', + 'Type' => 'Type', + 'Purchase' => 'Purchase', 'Price' => 'Price', - 'Supplier' => 'Supplier', - 'Approved' => 'Approved', - 'Approve' => 'Approve', + 'Supplier' => 'Supplier', + 'Approved' => 'Approved', + 'Approve' => 'Approve', ]]; diff --git a/Theme/Backend/investment-list.tpl.php b/Theme/Backend/investment-list.tpl.php index e08104e..946d9ba 100644 --- a/Theme/Backend/investment-list.tpl.php +++ b/Theme/Backend/investment-list.tpl.php @@ -23,53 +23,53 @@ echo $this->data['nav']->render(); ?>
getHtml('Investments'); ?>download
- +
getHtml('ID', '0', '0'); ?> - getHtml('Status'); ?> - getHtml('Name'); ?> - getHtml('Creator'); ?> -
printHtml((string) $value->id); ?> getHtml(':status' . $value->status); ?> printHtml($value->name); ?> - printHtml($this->renderUserName('%3$s %2$s %1$s', [$value->createdBy->name1, $value->createdBy->name2, $value->createdBy->name3, $value->createdBy->login ?? ''])); ?> + printHtml($this->renderUserName('%3$s %2$s %1$s', [$value->createdBy->name1, $value->createdBy->name2, $value->createdBy->name3, $value->createdBy->login ?? ''])); ?>
getHtml('Empty', '0', '0'); ?> diff --git a/Theme/Backend/investment-object-profile.tpl.php b/Theme/Backend/investment-object-view.tpl.php similarity index 96% rename from Theme/Backend/investment-object-profile.tpl.php rename to Theme/Backend/investment-object-view.tpl.php index e3b836a..213c7ec 100644 --- a/Theme/Backend/investment-object-profile.tpl.php +++ b/Theme/Backend/investment-object-view.tpl.php @@ -17,8 +17,8 @@ use phpOMS\Localization\ISO639Enum; /** @var \phpOMS\Views\View $this */ $object = $this->data['object'] ?? null; -$attributeView = $this->data['attributeView']; -$languages = ISO639Enum::getConstants(); +$attributeView = $this->data['attributeView']; +$languages = ISO639Enum::getConstants(); echo $this->data['nav']->render(); ?>
diff --git a/Theme/Backend/investment-profile.tpl.php b/Theme/Backend/investment-view.tpl.php similarity index 98% rename from Theme/Backend/investment-profile.tpl.php rename to Theme/Backend/investment-view.tpl.php index d70e0d9..0b39edb 100644 --- a/Theme/Backend/investment-profile.tpl.php +++ b/Theme/Backend/investment-view.tpl.php @@ -16,9 +16,9 @@ use Modules\InvestmentManagement\Models\InvestmentStatus; use phpOMS\Uri\UriFactory; /** @var \phpOMS\Views\View $this */ -$investment = $this->data['investment'] ?? null; +$investment = $this->data['investment'] ?? null; $investmentStatus = InvestmentStatus::getConstants(); -$files = $investment->files; +$files = $investment->files; $investmentTypes = $this->data['types'] ?? []; echo $this->data['nav']->render(); ?> @@ -234,7 +234,7 @@ echo $this->data['nav']->render(); ?>
diff --git a/tests/Autoloader.php b/tests/Autoloader.php index 83e3b2f..83db700 100644 --- a/tests/Autoloader.php +++ b/tests/Autoloader.php @@ -75,8 +75,8 @@ final class Autoloader */ public static function defaultAutoloader(string $class) : void { - $class = \ltrim($class, '\\'); - $class = \strtr($class, '_\\', '//'); + $class = \ltrim($class, '\\'); + $class = \strtr($class, '_\\', '//'); if (\stripos($class, 'Web/Backend') !== false || \stripos($class, 'Web/Api') !== false) { $class = \is_dir(__DIR__ . '/Web') ? $class : \str_replace('Web/', 'MainRepository/Web/', $class); diff --git a/tests/Bootstrap.php b/tests/Bootstrap.php index ddc049d..9fca3f4 100644 --- a/tests/Bootstrap.php +++ b/tests/Bootstrap.php @@ -1,4 +1,15 @@ [ + 'db' => [ 'core' => [ 'masters' => [ - 'admin' => [ + 'admin' => [ 'db' => 'mysql', /* db type */ 'host' => '127.0.0.1', /* db host address */ 'port' => '3306', /* db host port */ @@ -80,7 +91,7 @@ $CONFIG = [ 'weight' => 1000, /* db table prefix */ 'datetimeformat' => 'Y-m-d H:i:s', ], - 'insert' => [ + 'insert' => [ 'db' => 'mysql', /* db type */ 'host' => '127.0.0.1', /* db host address */ 'port' => '3306', /* db host port */ @@ -90,7 +101,7 @@ $CONFIG = [ 'weight' => 1000, /* db table prefix */ 'datetimeformat' => 'Y-m-d H:i:s', ], - 'select' => [ + 'select' => [ 'db' => 'mysql', /* db type */ 'host' => '127.0.0.1', /* db host address */ 'port' => '3306', /* db host port */ @@ -100,7 +111,7 @@ $CONFIG = [ 'weight' => 1000, /* db table prefix */ 'datetimeformat' => 'Y-m-d H:i:s', ], - 'update' => [ + 'update' => [ 'db' => 'mysql', /* db type */ 'host' => '127.0.0.1', /* db host address */ 'port' => '3306', /* db host port */ @@ -110,7 +121,7 @@ $CONFIG = [ 'weight' => 1000, /* db table prefix */ 'datetimeformat' => 'Y-m-d H:i:s', ], - 'delete' => [ + 'delete' => [ 'db' => 'mysql', /* db type */ 'host' => '127.0.0.1', /* db host address */ 'port' => '3306', /* db host port */ @@ -120,7 +131,7 @@ $CONFIG = [ 'weight' => 1000, /* db table prefix */ 'datetimeformat' => 'Y-m-d H:i:s', ], - 'schema' => [ + 'schema' => [ 'db' => 'mysql', /* db type */ 'host' => '127.0.0.1', /* db host address */ 'port' => '3306', /* db host port */ @@ -132,7 +143,7 @@ $CONFIG = [ ], ], 'postgresql' => [ - 'admin' => [ + 'admin' => [ 'db' => 'pgsql', /* db type */ 'host' => '127.0.0.1', /* db host address */ 'port' => '5432', /* db host port */ @@ -142,7 +153,7 @@ $CONFIG = [ 'weight' => 1000, /* db table prefix */ 'datetimeformat' => 'Y-m-d H:i:s', ], - 'insert' => [ + 'insert' => [ 'db' => 'pgsql', /* db type */ 'host' => '127.0.0.1', /* db host address */ 'port' => '5432', /* db host port */ @@ -152,7 +163,7 @@ $CONFIG = [ 'weight' => 1000, /* db table prefix */ 'datetimeformat' => 'Y-m-d H:i:s', ], - 'select' => [ + 'select' => [ 'db' => 'pgsql', /* db type */ 'host' => '127.0.0.1', /* db host address */ 'port' => '5432', /* db host port */ @@ -162,7 +173,7 @@ $CONFIG = [ 'weight' => 1000, /* db table prefix */ 'datetimeformat' => 'Y-m-d H:i:s', ], - 'update' => [ + 'update' => [ 'db' => 'pgsql', /* db type */ 'host' => '127.0.0.1', /* db host address */ 'port' => '5432', /* db host port */ @@ -172,7 +183,7 @@ $CONFIG = [ 'weight' => 1000, /* db table prefix */ 'datetimeformat' => 'Y-m-d H:i:s', ], - 'delete' => [ + 'delete' => [ 'db' => 'pgsql', /* db type */ 'host' => '127.0.0.1', /* db host address */ 'port' => '5432', /* db host port */ @@ -182,7 +193,7 @@ $CONFIG = [ 'weight' => 1000, /* db table prefix */ 'datetimeformat' => 'Y-m-d H:i:s', ], - 'schema' => [ + 'schema' => [ 'db' => 'pgsql', /* db type */ 'host' => '127.0.0.1', /* db host address */ 'port' => '5432', /* db host port */ @@ -194,37 +205,37 @@ $CONFIG = [ ], ], 'sqlite' => [ - 'admin' => [ + 'admin' => [ 'db' => 'sqlite', /* db type */ 'database' => __DIR__ . '/../Karaka/phpOMS/Localization/Defaults/localization.sqlite', /* db name */ 'weight' => 1000, /* db table prefix */ 'datetimeformat' => 'Y-m-d H:i:s', ], - 'insert' => [ + 'insert' => [ 'db' => 'sqlite', /* db type */ 'database' => __DIR__ . '/../Karaka/phpOMS/Localization/Defaults/localization.sqlite', /* db name */ 'weight' => 1000, /* db table prefix */ 'datetimeformat' => 'Y-m-d H:i:s', ], - 'select' => [ + 'select' => [ 'db' => 'sqlite', /* db type */ 'database' => __DIR__ . '/../Karaka/phpOMS/Localization/Defaults/localization.sqlite', /* db name */ 'weight' => 1000, /* db table prefix */ 'datetimeformat' => 'Y-m-d H:i:s', ], - 'update' => [ + 'update' => [ 'db' => 'sqlite', /* db type */ 'database' => __DIR__ . '/../Karaka/phpOMS/Localization/Defaults/localization.sqlite', /* db name */ 'weight' => 1000, /* db table prefix */ 'datetimeformat' => 'Y-m-d H:i:s', ], - 'delete' => [ + 'delete' => [ 'db' => 'sqlite', /* db type */ 'database' => __DIR__ . '/../Karaka/phpOMS/Localization/Defaults/localization.sqlite', /* db name */ 'weight' => 1000, /* db table prefix */ 'datetimeformat' => 'Y-m-d H:i:s', ], - 'schema' => [ + 'schema' => [ 'db' => 'sqlite', /* db type */ 'database' => __DIR__ . '/../Karaka/phpOMS/Localization/Defaults/localization.sqlite', /* db name */ 'weight' => 1000, /* db table prefix */ @@ -232,7 +243,7 @@ $CONFIG = [ ], ], 'mssql' => [ - 'admin' => [ + 'admin' => [ 'db' => 'mssql', /* db type */ 'host' => '127.0.0.1', /* db host address */ 'port' => '1433', /* db host port */ @@ -242,7 +253,7 @@ $CONFIG = [ 'weight' => 1000, /* db table prefix */ 'datetimeformat' => 'Y-m-d H:i:s', ], - 'insert' => [ + 'insert' => [ 'db' => 'mssql', /* db type */ 'host' => '127.0.0.1', /* db host address */ 'port' => '1433', /* db host port */ @@ -252,7 +263,7 @@ $CONFIG = [ 'weight' => 1000, /* db table prefix */ 'datetimeformat' => 'Y-m-d H:i:s', ], - 'select' => [ + 'select' => [ 'db' => 'mssql', /* db type */ 'host' => '127.0.0.1', /* db host address */ 'port' => '1433', /* db host port */ @@ -262,7 +273,7 @@ $CONFIG = [ 'weight' => 1000, /* db table prefix */ 'datetimeformat' => 'Y-m-d H:i:s', ], - 'update' => [ + 'update' => [ 'db' => 'mssql', /* db type */ 'host' => '127.0.0.1', /* db host address */ 'port' => '1433', /* db host port */ @@ -272,7 +283,7 @@ $CONFIG = [ 'weight' => 1000, /* db table prefix */ 'datetimeformat' => 'Y-m-d H:i:s', ], - 'delete' => [ + 'delete' => [ 'db' => 'mssql', /* db type */ 'host' => '127.0.0.1', /* db host address */ 'port' => '1433', /* db host port */ @@ -282,7 +293,7 @@ $CONFIG = [ 'weight' => 1000, /* db table prefix */ 'datetimeformat' => 'Y-m-d H:i:s', ], - 'schema' => [ + 'schema' => [ 'db' => 'mssql', /* db type */ 'host' => '127.0.0.1', /* db host address */ 'port' => '1433', /* db host port */ @@ -322,16 +333,16 @@ $CONFIG = [ 'password' => '123456', ], ], - 'log' => [ + 'log' => [ 'file' => [ 'path' => __DIR__ . '/Logs', ], ], - 'page' => [ + 'page' => [ 'root' => '/', 'https' => false, ], - 'app' => [ + 'app' => [ 'path' => __DIR__, 'default' => [ 'app' => 'Backend', @@ -350,7 +361,7 @@ $CONFIG = [ ], ], ], - 'socket' => [ + 'socket' => [ 'master' => [ 'host' => '127.0.0.1', 'limit' => 300, @@ -360,7 +371,7 @@ $CONFIG = [ 'language' => [ 'en', ], - 'apis' => [ + 'apis' => [ ], ];