From 1d48eeb1d99c99ee8e8ecd4e2ebf5b593af9da94 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Mon, 16 Oct 2023 22:23:57 +0000 Subject: [PATCH 01/18] test fixes --- Helper/Php/findMissingNullModelTest.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Helper/Php/findMissingNullModelTest.php b/Helper/Php/findMissingNullModelTest.php index 97ce664..02cd2a5 100644 --- a/Helper/Php/findMissingNullModelTest.php +++ b/Helper/Php/findMissingNullModelTest.php @@ -96,6 +96,16 @@ foreach ($modules as $module) { . ' $null = new Null' . $model . '(2);' . "\n" . ' self::assertEquals(2, $null->getId());' . "\n" . ' }' . "\n" + . "\n" + . ' /**' . "\n" + . ' * @covers Modules\\' . $module . '\Models\Null' . $model . '' . "\n" + . ' * @group framework' . "\n" + . ' */' . "\n" + . ' public function testJsonSerialize() : void' . "\n" + . ' {' . "\n" + . ' $null = new Null' . $model . '(2);' . "\n" + . ' self::assertEquals([\'id\' => 2], $null);' . "\n" + . ' }' . "\n" . '}' . "\n"; \file_put_contents(__DIR__ . '/../../../Modules/' . $module . '/tests/Models/Null' . $model . 'Test.php', $test); From 3518d911af75942b5fb47751bfc1bf54570b9686 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Mon, 16 Oct 2023 23:39:38 +0000 Subject: [PATCH 02/18] Add test cases for null models --- Helper/Php/findMissingNullModelTest.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Helper/Php/findMissingNullModelTest.php b/Helper/Php/findMissingNullModelTest.php index 02cd2a5..1c45aba 100644 --- a/Helper/Php/findMissingNullModelTest.php +++ b/Helper/Php/findMissingNullModelTest.php @@ -80,7 +80,7 @@ foreach ($modules as $module) { . '{' . "\n" . ' /**' . "\n" . ' * @covers Modules\\' . $module . '\Models\Null' . $model . '' . "\n" - . ' * @group framework' . "\n" + . ' * @group module' . "\n" . ' */' . "\n" . ' public function testNull() : void' . "\n" . ' {' . "\n" @@ -89,7 +89,7 @@ foreach ($modules as $module) { . "\n" . ' /**' . "\n" . ' * @covers Modules\\' . $module . '\Models\Null' . $model . '' . "\n" - . ' * @group framework' . "\n" + . ' * @group module' . "\n" . ' */' . "\n" . ' public function testId() : void' . "\n" . ' {' . "\n" @@ -99,7 +99,7 @@ foreach ($modules as $module) { . "\n" . ' /**' . "\n" . ' * @covers Modules\\' . $module . '\Models\Null' . $model . '' . "\n" - . ' * @group framework' . "\n" + . ' * @group module' . "\n" . ' */' . "\n" . ' public function testJsonSerialize() : void' . "\n" . ' {' . "\n" From da813f8d88c9dd0c08acf41ed1d9634a7a77b503 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Mon, 16 Oct 2023 23:43:59 +0000 Subject: [PATCH 03/18] Remove getId() function call from null models --- Helper/Php/findMissingNullModelTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Helper/Php/findMissingNullModelTest.php b/Helper/Php/findMissingNullModelTest.php index 1c45aba..cb4e370 100644 --- a/Helper/Php/findMissingNullModelTest.php +++ b/Helper/Php/findMissingNullModelTest.php @@ -94,7 +94,7 @@ foreach ($modules as $module) { . ' public function testId() : void' . "\n" . ' {' . "\n" . ' $null = new Null' . $model . '(2);' . "\n" - . ' self::assertEquals(2, $null->getId());' . "\n" + . ' self::assertEquals(2, $null->id);' . "\n" . ' }' . "\n" . "\n" . ' /**' . "\n" From 08eef5d657cc256eafa01810ac5402739c7a0354 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Tue, 17 Oct 2023 22:07:19 +0000 Subject: [PATCH 04/18] fix tests --- .../findMissingInvalidApiControllerTest.php | 128 ++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100644 Helper/Php/findMissingInvalidApiControllerTest.php diff --git a/Helper/Php/findMissingInvalidApiControllerTest.php b/Helper/Php/findMissingInvalidApiControllerTest.php new file mode 100644 index 0000000..8712f06 --- /dev/null +++ b/Helper/Php/findMissingInvalidApiControllerTest.php @@ -0,0 +1,128 @@ +header->account = 1; + \$this->module->{$name}(\$request, \$response); + self::assertEquals(RequestStatusCode::R_400, \$response->header->status); + } + + HEREDOC; + + return $invalid; +} + +foreach ($modules as $module) { + if ($module === '..' || $module === '.' + || !\is_dir(__DIR__ . '/../../../Modules/' . $module) + || !\is_dir(__DIR__ . '/../../../Modules/' . $module . '/Controller') + || !\is_file(__DIR__ . '/../../../Modules/' . $module . '/info.json') + || (!empty($allowed) && !\in_array($module, $allowed)) + ) { + continue; + } + + $controllers = \scandir(__DIR__ . '/../../../Modules/' . $module . '/Controller'); + + foreach ($controllers as $controller) { + if (\stripos($controller, 'Api') === false) { + continue; + } + + $content = \file_get_contents(__DIR__ . '/../../../Modules/' . $module . '/Controller/' . $controller); + + $matches = []; + \preg_match_all('/(public function )(.*?)(\()/', $content, $matches); + + $relevantFunction = []; + + foreach ($matches[2] as $match) { + $stripos = \stripos($content, 'public function ' . $match); + $stripos2 = \stripos($content, 'if (!empty($val = ', $stripos); + + if ($stripos2 === false) { + continue; + } + + if ($stripos2 - $stripos > 500) { + continue; + } + + $relevantFunction[] = $match; + } + + $tests1 = \scandir(__DIR__ . '/../../../Modules/' . $module . '/tests/Controller'); + $tests2 = \scandir(__DIR__ . '/../../../Modules/' . $module . '/tests/Controller/Api'); + + $testFilesContent = []; + + foreach ($tests1 as $file) { + if ($file === '..' || $file === '.') { + continue; + } + + $testFilesContent[__DIR__ . '/../../../Modules/' . $module . '/tests/Controller/' . $file] = \file_get_contents(__DIR__ . '/../../../Modules/' . $module . '/tests/Controller/' . $file); + } + + foreach ($tests2 as $file) { + if ($file === '..' || $file === '.') { + continue; + } + + $testFilesContent[__DIR__ . '/../../../Modules/' . $module . '/tests/Controller/Api/' . $file] = \file_get_contents(__DIR__ . '/../../../Modules/' . $module . '/tests/Controller/' . $file); + } + + foreach ($testFilesContent as $path => $testFile) { + foreach ($relevantFunction as $function) { + $offset = 0; + $found = false; + + while (($invalidPos = \stripos('->' . $function . '(', $testFile, $offset)) !== false) { + $offset = $invalidPos + 1; + $found = true; + + $statusPos = \stripos($testFile, 'self::assertEquals(RequestStatusCode::'); + if ($statusPos !== false && $statusPos - $invalidPos < 250) { + $found = false; + + break; + } + } + + if ($found) { + $newContent = \createFunction($function); + $newContent = \rtrim($testFile, " }\n") . "\n }\n" . $newContent . "}\n"; + \file_put_contents($path, $newContent); + } + } + } + } +} From 333158e933cd22ea431348895b2eda160816dcf4 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Wed, 18 Oct 2023 00:40:42 +0000 Subject: [PATCH 05/18] Create invalid api function data tests --- .../findMissingInvalidApiControllerTest.php | 54 +++++++++++++++---- 1 file changed, 43 insertions(+), 11 deletions(-) diff --git a/Helper/Php/findMissingInvalidApiControllerTest.php b/Helper/Php/findMissingInvalidApiControllerTest.php index 8712f06..428276f 100644 --- a/Helper/Php/findMissingInvalidApiControllerTest.php +++ b/Helper/Php/findMissingInvalidApiControllerTest.php @@ -79,13 +79,20 @@ foreach ($modules as $module) { $relevantFunction[] = $match; } - $tests1 = \scandir(__DIR__ . '/../../../Modules/' . $module . '/tests/Controller'); - $tests2 = \scandir(__DIR__ . '/../../../Modules/' . $module . '/tests/Controller/Api'); + $tests1 = \is_dir(__DIR__ . '/../../../Modules/' . $module . '/tests/Controller') ? \scandir(__DIR__ . '/../../../Modules/' . $module . '/tests/Controller') : []; + if ($tests1 === false) { + $tests1 = []; + } + + $tests2 = \is_dir(__DIR__ . '/../../../Modules/' . $module . '/tests/Controller/Api') ? \scandir(__DIR__ . '/../../../Modules/' . $module . '/tests/Controller/Api') : []; + if ($tests2 === false) { + $tests2 = []; + } $testFilesContent = []; foreach ($tests1 as $file) { - if ($file === '..' || $file === '.') { + if ($file === '..' || $file === '.' || !\is_file(__DIR__ . '/../../../Modules/' . $module . '/tests/Controller/' . $file)) { continue; } @@ -93,36 +100,61 @@ foreach ($modules as $module) { } foreach ($tests2 as $file) { - if ($file === '..' || $file === '.') { + if ($file === '..' || $file === '.' || !\is_file(__DIR__ . '/../../../Modules/' . $module . '/tests/Controller/Api/' . $file)) { continue; } - $testFilesContent[__DIR__ . '/../../../Modules/' . $module . '/tests/Controller/Api/' . $file] = \file_get_contents(__DIR__ . '/../../../Modules/' . $module . '/tests/Controller/' . $file); + $testFilesContent[__DIR__ . '/../../../Modules/' . $module . '/tests/Controller/Api/' . $file] = \file_get_contents(__DIR__ . '/../../../Modules/' . $module . '/tests/Controller/Api/' . $file); } + $open = []; + foreach ($testFilesContent as $path => $testFile) { foreach ($relevantFunction as $function) { $offset = 0; - $found = false; + $found = -1; - while (($invalidPos = \stripos('->' . $function . '(', $testFile, $offset)) !== false) { + if (!isset($open[$function])) { + $open[$function] = -1; + } + + while (($invalidPos = \stripos($testFile, '->' . $function . '(', $offset)) !== false) { $offset = $invalidPos + 1; - $found = true; + $found = 0; $statusPos = \stripos($testFile, 'self::assertEquals(RequestStatusCode::'); if ($statusPos !== false && $statusPos - $invalidPos < 250) { - $found = false; + $found = 1; + + $open[$function] = 1; break; } } - if ($found) { + if ($found === 0) { + echo $function . "\n"; $newContent = \createFunction($function); $newContent = \rtrim($testFile, " }\n") . "\n }\n" . $newContent . "}\n"; - \file_put_contents($path, $newContent); + //\file_put_contents($path, $newContent); + $open[$function] = 1; } } } + + if (\is_file(__DIR__ . '/../../../Modules/' . $module . '/tests/Controller/ApiControllerTest.php')) { + $testFile = \file_get_contents(__DIR__ . '/../../../Modules/' . $module . '/tests/Controller/ApiControllerTest.php'); + foreach ($open as $function => $value) { + if ($value === 1) { + continue; + } + + echo $function . "\n"; + $newContent = \createFunction($function); + $newContent = \rtrim($testFile, " }\n") . "\n }\n" . $newContent . "}\n"; + //\file_put_contents($path, $newContent); + $open[$function] = 1; + } + } } } From 92dabf580e3c9137a4db32ab7a8dd5fca76138f6 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Wed, 18 Oct 2023 01:03:57 +0000 Subject: [PATCH 06/18] add invalid api function tests --- .../findMissingInvalidApiControllerTest.php | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Helper/Php/findMissingInvalidApiControllerTest.php b/Helper/Php/findMissingInvalidApiControllerTest.php index 428276f..a6b55fb 100644 --- a/Helper/Php/findMissingInvalidApiControllerTest.php +++ b/Helper/Php/findMissingInvalidApiControllerTest.php @@ -25,15 +25,15 @@ function createFunction($name) { $invalid = <<header->account = 1; - \$this->module->{$name}(\$request, \$response); - self::assertEquals(RequestStatusCode::R_400, \$response->header->status); - } + \$request->header->account = 1; + \$this->module->{$name}(\$request, \$response); + self::assertEquals(RequestStatusCode::R_400, \$response->header->status); + } HEREDOC; @@ -136,7 +136,7 @@ foreach ($modules as $module) { echo $function . "\n"; $newContent = \createFunction($function); $newContent = \rtrim($testFile, " }\n") . "\n }\n" . $newContent . "}\n"; - //\file_put_contents($path, $newContent); + \file_put_contents($path, $newContent); $open[$function] = 1; } } @@ -152,7 +152,7 @@ foreach ($modules as $module) { echo $function . "\n"; $newContent = \createFunction($function); $newContent = \rtrim($testFile, " }\n") . "\n }\n" . $newContent . "}\n"; - //\file_put_contents($path, $newContent); + \file_put_contents($path, $newContent); $open[$function] = 1; } } From 08bb46bff4d4c8526c0e31cb1e156c8495a4e592 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Fri, 20 Oct 2023 13:08:55 +0000 Subject: [PATCH 07/18] icon fixes, loading optimizations --- Helper/Scripts/sitespeedAuth.js | 11 +++--- Helper/Scripts/sitespeedDemoUrls.txt | 47 ++++++++++++++++++++++++++ Helper/Scripts/sitespeedOnlineUrls.txt | 7 ++++ Helper/Scripts/sitespeedUrls.txt | 37 -------------------- 4 files changed, 60 insertions(+), 42 deletions(-) create mode 100644 Helper/Scripts/sitespeedDemoUrls.txt create mode 100644 Helper/Scripts/sitespeedOnlineUrls.txt delete mode 100644 Helper/Scripts/sitespeedUrls.txt diff --git a/Helper/Scripts/sitespeedAuth.js b/Helper/Scripts/sitespeedAuth.js index 018e01a..5c03a70 100644 --- a/Helper/Scripts/sitespeedAuth.js +++ b/Helper/Scripts/sitespeedAuth.js @@ -1,11 +1,12 @@ +// sitespeed.io /var/www/html/Karaka/Build/Helper/Scripts/sitespeedDemoUrls.txt -n 1 -b chrome --preScript /var/www/html/Karaka/Build/Helper/Scripts/sitespeedAuth.js --outputFolder /var/www/html/sitespeed module.exports = async function(context, commands) { - await commands.navigate('https://jingga.app'); + await commands.navigate('http://192.168.178.38/en/backend'); - await commands.addText.byId('admin', 'iName'); - await commands.addText.byId('orange', 'iPassword'); + // await commands.addText.byId('admin', 'iName'); + // await commands.addText.byId('orange', 'iPassword'); await commands.click.byIdAndWait('iLoginButton'); - return commands.wait.byId('u-box', 3000); -}; \ No newline at end of file + return commands.wait.byId('u-box', 1000); +}; diff --git a/Helper/Scripts/sitespeedDemoUrls.txt b/Helper/Scripts/sitespeedDemoUrls.txt new file mode 100644 index 0000000..a7dfea3 --- /dev/null +++ b/Helper/Scripts/sitespeedDemoUrls.txt @@ -0,0 +1,47 @@ +http://192.168.178.38/en/backend +http://192.168.178.38/en/help/general +http://192.168.178.38/en/help/module/list +http://192.168.178.38/en/help/developer +http://192.168.178.38/en/help/developer +http://192.168.178.38/en/admin/group/list +http://192.168.178.38/en/admin/group/settings?id=1#c-tab-1 +http://192.168.178.38/en/admin/account/list +http://192.168.178.38/en/admin/account/settings?id=1#c-tab-1 +http://192.168.178.38/en/admin/module/list +http://192.168.178.38/en/admin/module/info?id=Admin +http://192.168.178.38/en/admin/module/settings?id=Admin#c-tab-1 +http://192.168.178.38/en/admin/module/navigation/list?id=Admin +http://192.168.178.38/en/admin/module/route/list?id=Admin +http://192.168.178.38/en/admin/module/hook/list?id=Admin +http://192.168.178.38/en/admin/module/log?id=Admin +http://192.168.178.38/en/admin/exchange/log/list +http://192.168.178.38/en/admin/exchange/import/list +http://192.168.178.38/en/admin/exchange/export/list +http://192.168.178.38/en/admin/monitoring/general +http://192.168.178.38/en/admin/monitoring/log/list +http://192.168.178.38/en/admin/monitoring/stats +http://192.168.178.38/en/admin/audit/list +http://192.168.178.38/en/admin/audit/single?id=1 +http://192.168.178.38/en/organization/organigram +http://192.168.178.38/en/organization/unit/list +http://192.168.178.38/en/organization/unit/profile?id=1 +http://192.168.178.38/en/organization/department/list +http://192.168.178.38/en/organization/department/profile?id=1 +http://192.168.178.38/en/organization/position/list +http://192.168.178.38/organization/position/profile?id=1 +http://192.168.178.38/en/messages/dashboard +http://192.168.178.38/en/messages/template/list +http://192.168.178.38/en/messages/template/single?id=1 +http://192.168.178.38/en/profile/list +http://192.168.178.38/en/profile/single?id=2 +http://192.168.178.38/en/media/list +http://192.168.178.38/en/media/upload +http://192.168.178.38/en/media/file/create +http://192.168.178.38/en/media/collection/create +http://192.168.178.38/en/news/dashboard +http://192.168.178.38/en/news/article?id=1 +http://192.168.178.38/en/news/archive +http://192.168.178.38/en/news/create +http://192.168.178.38/en/news/draft/list +http://192.168.178.38/en/news/analysis +http://192.168.178.38/en/editor/list \ No newline at end of file diff --git a/Helper/Scripts/sitespeedOnlineUrls.txt b/Helper/Scripts/sitespeedOnlineUrls.txt new file mode 100644 index 0000000..cb9d194 --- /dev/null +++ b/Helper/Scripts/sitespeedOnlineUrls.txt @@ -0,0 +1,7 @@ +https://jingga.app +https://jingga.app/en/solutions +https://jingga.app/en/services +https://jingga.app/en/shop +https://jingga.app/en/shop/item?number=200000 +https://jingga.app/en/terms +https://jingga.app/info?page=setup/install \ No newline at end of file diff --git a/Helper/Scripts/sitespeedUrls.txt b/Helper/Scripts/sitespeedUrls.txt deleted file mode 100644 index 5f8159a..0000000 --- a/Helper/Scripts/sitespeedUrls.txt +++ /dev/null @@ -1,37 +0,0 @@ -https://jingga.app -https://jingga.app/help/general -https://jingga.app/help/module/list -https://jingga.app/help/developer -https://jingga.app/admin/settings/general -https://jingga.app/admin/group/list -https://jingga.app/admin/group/settings?id=1 -https://jingga.app/admin/account/list -https://jingga.app/admin/account/settings?id=1 -https://jingga.app/admin/module/list -https://jingga.app/admin/admin/module/settings?id=Profile -https://jingga.app/admin/job/list -https://jingga.app/admin/monitoring/general -https://jingga.app/admin/monitoring/log/list -https://jingga.app/admin/monitoring/security/dashboard -https://jingga.app/admin/exchange/dashboard -https://jingga.app/admin/exchange/import/list -https://jingga.app/admin/exchange/export/list -https://jingga.app/admin/audit/list -https://jingga.app/organization/organigram -https://jingga.app/organization/unit/list -https://jingga.app/organization/unit/profile?id=1 -https://jingga.app/organization/department/list -https://jingga.app/organization/department/profile?id=1 -https://jingga.app/organization/position/list -https://jingga.app/organization/position/profile?id=1 -https://jingga.app/profile/list -https://jingga.app/profile/single?id=1 -https://jingga.app/media/list -https://jingga.app/news/dashboard -https://jingga.app/news/article?id=1 -https://jingga.app/task/dashboard -https://jingga.app/task/single?id=1 -https://jingga.app/kanban/dashboard -https://jingga.app/kanban/board?id=1 -https://jingga.app/editor/list -https://jingga.app/editor/single?id=1 \ No newline at end of file From ab7e716bcd6d102c0127acafe3d15822eae4fd5c Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Fri, 20 Oct 2023 16:53:41 +0000 Subject: [PATCH 08/18] fix bugs --- Helper/Scripts/sitespeedDemoUrls.txt | 120 ++++++++++++++++++++++++++- 1 file changed, 118 insertions(+), 2 deletions(-) diff --git a/Helper/Scripts/sitespeedDemoUrls.txt b/Helper/Scripts/sitespeedDemoUrls.txt index a7dfea3..494134a 100644 --- a/Helper/Scripts/sitespeedDemoUrls.txt +++ b/Helper/Scripts/sitespeedDemoUrls.txt @@ -28,10 +28,11 @@ http://192.168.178.38/en/organization/unit/profile?id=1 http://192.168.178.38/en/organization/department/list http://192.168.178.38/en/organization/department/profile?id=1 http://192.168.178.38/en/organization/position/list -http://192.168.178.38/organization/position/profile?id=1 +http://192.168.178.38/en/organization/position/profile?id=1 http://192.168.178.38/en/messages/dashboard http://192.168.178.38/en/messages/template/list http://192.168.178.38/en/messages/template/single?id=1 +http://192.168.178.38/en/calendar/dashboard http://192.168.178.38/en/profile/list http://192.168.178.38/en/profile/single?id=2 http://192.168.178.38/en/media/list @@ -44,4 +45,119 @@ http://192.168.178.38/en/news/archive http://192.168.178.38/en/news/create http://192.168.178.38/en/news/draft/list http://192.168.178.38/en/news/analysis -http://192.168.178.38/en/editor/list \ No newline at end of file +http://192.168.178.38/en/editor/list +http://192.168.178.38/en/editor/single?id=1 +http://192.168.178.38/en/orw/resource/list +http://192.168.178.38/en/kanban/dashboard +http://192.168.178.38/en/kanban/board?id=1 +http://192.168.178.38/en/kanban/card?id=1 +http://192.168.178.38/en/contract/list +http://192.168.178.38/en/contract/type/list +http://192.168.178.38/en/survey/list +http://192.168.178.38/en/wiki/dashboard +http://192.168.178.38/en/wiki/doc/single?id=1 +http://192.168.178.38/en/wiki/category/list +http://192.168.178.38/en/wiki/list +http://192.168.178.38/en/qa/dashboard +http://192.168.178.38/en/qa/question?id=1 +http://192.168.178.38/en/helper/list +http://192.168.178.38/en/helper/report/view?id=1 +http://192.168.178.38/en/helper/report/create +http://192.168.178.38/en/helper/template/create +http://192.168.178.38/en/checklist/list +http://192.168.178.38/en/dbeditor/list +http://192.168.178.38/en/dbeditor/editor +http://192.168.178.38/en/tag/list +http://192.168.178.38/en/tag/single?id=1 +http://192.168.178.38/en/workflow/instance/list +http://192.168.178.38/en/workflow/template/list +http://192.168.178.38/en/workflow/template/profile?id=1 +http://192.168.178.38/en/private/timerecording/dashboard +http://192.168.178.38/en/private/support/dashboard +http://192.168.178.38/en/private/purchase/recognition/dashboard +http://192.168.178.38/en/private/purchase/bill?id=1 +http://192.168.178.38/en/private/investment/list +http://192.168.178.38/en/finance/investment/profile?id=1 +http://192.168.178.38/en/businessexpenses/expense/list +http://192.168.178.38/en/businessexpenses/expense?id=1 +http://192.168.178.38/en/cms/application/list +http://192.168.178.38/en/cms/application/page/list?app=2 +http://192.168.178.38/en/cms/application/post/list?app=2 +http://192.168.178.38/en/cms/application/permission?app=2 +http://192.168.178.38/en/cms/application/setting?app=2 +http://192.168.178.38/en/cms/application/files?app=2 +http://192.168.178.38/en/cms/application/theme?app=2 +http://192.168.178.38/en/item/attribute/type/list +http://192.168.178.38/en/item/attribute/type?id=1 +http://192.168.178.38/en/item/list +http://192.168.178.38/en/item/profile?id=3 +http://192.168.178.38/en/sales/client/list +http://192.168.178.38/en/sales/client/profile?id=1 +http://192.168.178.38/en/sales/client/attribute/type/list +http://192.168.178.38/en/sales/client/attribute/type?id=1 +http://192.168.178.38/en/sales/item/list +http://192.168.178.38/en/sales/bill/list +http://192.168.178.38/en/sales/bill?id=1 +http://192.168.178.38/en/sales/analysis +http://192.168.178.38/en/sales/analysis/item +http://192.168.178.38/en/sales/analysis/client +http://192.168.178.38/en/sales/analysis/bill +http://192.168.178.38/en/sales/analysis/region +http://192.168.178.38/en/sales/analysis/rep +http://192.168.178.38/en/purchase/supplier/list +http://192.168.178.38/en/purchase/supplier/profile?id=1 +http://192.168.178.38/en/purchase/supplier/attribute/type/list +http://192.168.178.38/en/purchase/supplier/attribute/type?id=1 +http://192.168.178.38/en/purchase/item/list +http://192.168.178.38/en/purchase/bill/list +http://192.168.178.38/en/purchase/order/suggestion +http://192.168.178.38/en/purchase/analysis +http://192.168.178.38/en/warehouse/stock/list +http://192.168.178.38/en/warehouse/stock?id=1 +http://192.168.178.38/en/warehouse/labeling/item/list +http://192.168.178.38/en/warehouse/labeling/item?id=3 +http://192.168.178.38/en/warehouse/stocktaking/list +http://192.168.178.38/en/warehouse/bill/list +http://192.168.178.38/en/warehouse/bill/list +http://192.168.178.38/en/accounting/entries/dashboard +http://192.168.178.38/enaccounting/asset/list +http://192.168.178.38/en/accounting/costcenter/list +http://192.168.178.38/en/accounting/costobject/list +http://192.168.178.38/en/accounting/coa/list +http://192.168.178.38/en/admin/group/settings?id=1#c-tab-1 +http://192.168.178.38/en/accounting/stack/list +http://192.168.178.38/en/finance/investment/list +http://192.168.178.38/en/finance/investment/profile?id=1 +http://192.168.178.38/en/finance/loan/list +http://192.168.178.38/en/marketing/promotion/list +http://192.168.178.38/en/marketing/event/list +http://192.168.178.38/en/humanresource/staff/list +http://192.168.178.38/en/humanresource/department/list +http://192.168.178.38/en/humanresource/position/list +http://192.168.178.38/en/humanresource/position/list +http://192.168.178.38/en/humanresource/timerecording/dashboard +http://192.168.178.38/en/production/list +http://192.168.178.38/en/production/item/list +http://192.168.178.38/en/support/list +http://192.168.178.38/en/support/settings/dashboard +http://192.168.178.38/en/support/analysis/dashboard +http://192.168.178.38/en/fleet/vehicle/list +http://192.168.178.38/en/fleet/vehicle/profile?id=1 +http://192.168.178.38/en/fleet/driver/list +http://192.168.178.38/en/fleet/driver/profile?id=1 +http://192.168.178.38/en/fleet/inspection/list +http://192.168.178.38/en/fleet/vehicle/attribute/type/list +http://192.168.178.38/en/fleet/vehicle/attribute/type?id=1 +http://192.168.178.38/en/fleet/driver/attribute/type/list +http://192.168.178.38/en/fleet/vehicle/attribute/type?id=1 +http://192.168.178.38/en/equipment/list +http://192.168.178.38/en/equipment/equipment/profile?id=1 +http://192.168.178.38/en/equipment/inspection/list +http://192.168.178.38/en/equipment/attribute/type/list +http://192.168.178.38/en/fleet/equipment/attribute/type?id=1 +http://192.168.178.38/en/controlling/budget/dashboard +http://192.168.178.38/en/controlling/pl/dashboard +http://192.168.178.38/en/controlling/balance/dashboard +http://192.168.178.38/en/legal/privacy +http://192.168.178.38/en/legal/terms +http://192.168.178.38/en/legal/imprint \ No newline at end of file From 376180a95d5bb017a54979b85bee00e447c0ca15 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sun, 22 Oct 2023 16:41:52 +0000 Subject: [PATCH 09/18] fix install --- Helper/Scripts/serverInstall.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Helper/Scripts/serverInstall.sh b/Helper/Scripts/serverInstall.sh index 6dbe78d..1eaa558 100644 --- a/Helper/Scripts/serverInstall.sh +++ b/Helper/Scripts/serverInstall.sh @@ -68,9 +68,9 @@ CREATE USER 'jingga'@'%' IDENTIFIED BY 'dYg8#@wLiWJ3vE'; CREATE USER 'demo'@'%' IDENTIFIED BY 'orange'; CREATE USER 'test'@'%' IDENTIFIED BY 'orange'; -CREATE DATABASE jingga COMMENT 'Main application database'; -CREATE DATABASE demo COMMENT 'Demo application database'; -CREATE DATABASE omt COMMENT 'Tests'; +CREATE DATABASE jingga'; +CREATE DATABASE demo'; +CREATE DATABASE omt'; GRANT ALL PRIVILEGES ON jingga.* TO 'jingga'@'%'; GRANT ALL PRIVILEGES ON demo.* TO 'demo'@'%'; From e727e8ada18fbbc749e45f42312996c6c299b58e Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sat, 11 Nov 2023 05:24:30 +0000 Subject: [PATCH 10/18] include Markdown in phpcs --- Config/phpcs.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/Config/phpcs.xml b/Config/phpcs.xml index 8430a01..a35f990 100755 --- a/Config/phpcs.xml +++ b/Config/phpcs.xml @@ -41,7 +41,6 @@ */Parser/Document/* *Hooks.php *Markdown.js -*Markdown.php *ObjLoader.js config.php *Routes.php From d6e3420b719a940b706f603f726b233ad94428f8 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sun, 26 Nov 2023 21:27:56 +0000 Subject: [PATCH 11/18] cleanup inspection --- Config/phpcs.xml | 1 - Config/phpstan.neon | 2 -- 2 files changed, 3 deletions(-) diff --git a/Config/phpcs.xml b/Config/phpcs.xml index a35f990..843e603 100755 --- a/Config/phpcs.xml +++ b/Config/phpcs.xml @@ -34,7 +34,6 @@ */Accounting/* */JobScheduling/* */TrueSkill.php -*/Simplex.php */BayesianPersonalizedRanking.php */Parser/Spreadsheet/* */Parser/Presentation/* diff --git a/Config/phpstan.neon b/Config/phpstan.neon index 6ae190a..03d3f22 100755 --- a/Config/phpstan.neon +++ b/Config/phpstan.neon @@ -40,7 +40,6 @@ parameters: - */DataStorage/Database/* - */Message/Mail/* - */Auth/OAuth2/* - - */Markdown/Markdown.php - */Socket/* - */node_modules/* - */Install/Application/* @@ -51,7 +50,6 @@ parameters: - */Parser/Document/* - */Parser/Spreadsheet/* - *BayesianPersonalizedRanking.php - - *Simplex.php - *DBSCAN.php - *MeanShift.php - *Datamatrix.php From 2b1be588ea9182549e3199562a2be065ec7c36db Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Fri, 8 Dec 2023 21:52:22 +0000 Subject: [PATCH 12/18] bug fixes --- Config/phpcs.xml | 23 +++++++++++------------ Helper/Scripts/serverInstall.sh | 2 +- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/Config/phpcs.xml b/Config/phpcs.xml index 843e603..57516f1 100755 --- a/Config/phpcs.xml +++ b/Config/phpcs.xml @@ -27,17 +27,16 @@ */tests/* */Sandbox/* */vendor/* -*/OAuth2/* -*/Mail/* -*/Interfaces/* -*/Workflows/* -*/Accounting/* -*/JobScheduling/* -*/TrueSkill.php -*/BayesianPersonalizedRanking.php -*/Parser/Spreadsheet/* -*/Parser/Presentation/* -*/Parser/Document/* +*/Mail/* +*/Interfaces/* +*/Workflows/* +*/Accounting/* +*/JobScheduling/* +*/TrueSkill.php +*/BayesianPersonalizedRanking.php +*/Parser/Spreadsheet/* +*/Parser/Presentation/* +*/Parser/Document/* *Hooks.php *Markdown.js *ObjLoader.js @@ -50,7 +49,7 @@ - + *Sort.php diff --git a/Helper/Scripts/serverInstall.sh b/Helper/Scripts/serverInstall.sh index 1eaa558..d8389ed 100644 --- a/Helper/Scripts/serverInstall.sh +++ b/Helper/Scripts/serverInstall.sh @@ -26,7 +26,7 @@ service fail2ban restart # SSH -# TODO: upload ssh key and disable password login if successful +# upload ssh key and disable password login if successful # https://www.digitalocean.com/community/tutorials/how-to-set-up-ssh-keys-on-ubuntu-20-04 # copy the public key (e.g. *.pub to the file ~/.ssh/authorized_keys of the respective user) From 6ba73f88b059bd0ed5a9cf7420d2f3717fd10f18 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Tue, 2 Jan 2024 23:34:17 +0000 Subject: [PATCH 13/18] update --- Config/phpcs.xml | 2 ++ Config/phpstan.neon | 1 + Config/rector.php | 5 +++++ Helper/Scripts/inspectproject.sh | 6 +++--- Helper/Scripts/serverInstall.sh | 14 ++++++++++++-- 5 files changed, 23 insertions(+), 5 deletions(-) diff --git a/Config/phpcs.xml b/Config/phpcs.xml index 57516f1..8390860 100755 --- a/Config/phpcs.xml +++ b/Config/phpcs.xml @@ -46,6 +46,7 @@ *Sha1.js *Sha1b.js [abcdef0-9]{32}/* +*.min.js @@ -148,6 +149,7 @@ + 7 diff --git a/Config/phpstan.neon b/Config/phpstan.neon index 03d3f22..50470a8 100755 --- a/Config/phpstan.neon +++ b/Config/phpstan.neon @@ -14,6 +14,7 @@ parameters: treatPhpDocTypesAsCertain: false excludePaths: - *.tpl.php + - *.min.js - */Modules/Media/Files/* - */omsSetup/* - */demoSetup/* diff --git a/Config/rector.php b/Config/rector.php index 4cb28db..8cc5baa 100644 --- a/Config/rector.php +++ b/Config/rector.php @@ -61,10 +61,15 @@ return static function (RectorConfig $rectorConfig) : void { $rectorConfig->skip([ $base . '/vendor', + '*/vendor', + '*/node_modules', + $base . '/privateSetup', + $base . '/demoSetup', $base . '/Build', $base . '/MainRepository', $base . '/Resources', $base . '/Tools', + $base . '/Sandbox', $base . '/cssOMS', '*/Admin/Install/Application', SimplifyEmptyCheckOnEmptyArrayRector::class, diff --git a/Helper/Scripts/inspectproject.sh b/Helper/Scripts/inspectproject.sh index a3022ec..8b261be 100644 --- a/Helper/Scripts/inspectproject.sh +++ b/Helper/Scripts/inspectproject.sh @@ -7,19 +7,19 @@ echo "#################################################" echo "# PHP strict" echo "#################################################" -grep -r -L "declare(strict_types=1);" --include=*.php --exclude-dir={*vendor*,*Files*,*privateSetup*,*demoSetup*,*LanguageDetection*,*Resources*,*node_modules*,*privateSetup*,*Build*} --exclude={*.tpl.php,*Hooks.php,*Routes.php,*SearchCommands.php} ${BPATH}/../../phpOMS ${BPATH}/../../Web ${BPATH}/../../Modules ${BPATH}/../../Model +grep -r -L "declare(strict_types=1);" --include=*.php --exclude-dir={*vendor*,*Files*,*privateSetup*,*demoSetup*,*LanguageDetection*,*Resources*,*node_modules*,*privateSetup*,*Build*} --exclude={*.tpl.php,*Hooks.php,*Routes.php,*SearchCommands.php} ${BPATH}/../../../phpOMS ${BPATH}/../../../Web ${BPATH}/../../../Modules ${BPATH}/../../../Model echo "#################################################" echo "# JS security inspection" echo "#################################################" -grep -rlni "onafterprint=\|onbeforeprint=\|onbeforeunload=\|onerror=\|onhaschange=\|onload=\|onmessage=\|onoffline=\|ononline=\|onpagehide=\|onpageshow=\|onpopstate=\|onredo=\|onresize=\|onstorage=\|onund=o\|onunload=\|onblur=\|onchage=\|oncontextmenu=\|onfocus=\|onformchange=\|onforminput=\|oninput=\|oninvalid=\|onreset=\|onselect=\|onsubmit=\|onkeydown=\|onkeypress=\|onkeyup=\|onclick=\|ondblclic=k\|ondrag=\|ondragend=\|ondragenter=\|ondragleave=\|ondragover=\|ondragstart=\|ondrop=\|onmousedown=\|onmousemove=\|onmouseout=\|onmouseover=\|onmouseup=\|onmousewheel=\|onscroll=\|onabor=t\|oncanplay=\|oncanplaythrough=\|ondurationchange=\|onemptied=\|onended=\|onerror=\|onloadeddata=\|onloadedmetadata=\|onloadstart=\|onpause=\|onplay=\|onplaying=\|onprogress=\|onratechange=\|onreadystatechange=\|onseeked=\|onseeking=\|onstalled=\|onsuspend=\|ontimeupdate=\|onvolumechange=" --include=*.js ${BPATH}/../../jsOMS ${BPATH}/../../Model ${BPATH}/../../Modules ${BPATH}/../../Web +grep -rlni "onafterprint=\|onbeforeprint=\|onbeforeunload=\|onerror=\|onhaschange=\|onload=\|onmessage=\|onoffline=\|ononline=\|onpagehide=\|onpageshow=\|onpopstate=\|onredo=\|onresize=\|onstorage=\|onund=o\|onunload=\|onblur=\|onchage=\|oncontextmenu=\|onfocus=\|onformchange=\|onforminput=\|oninput=\|oninvalid=\|onreset=\|onselect=\|onsubmit=\|onkeydown=\|onkeypress=\|onkeyup=\|onclick=\|ondblclic=k\|ondrag=\|ondragend=\|ondragenter=\|ondragleave=\|ondragover=\|ondragstart=\|ondrop=\|onmousedown=\|onmousemove=\|onmouseout=\|onmouseover=\|onmouseup=\|onmousewheel=\|onscroll=\|onabor=t\|oncanplay=\|oncanplaythrough=\|ondurationchange=\|onemptied=\|onended=\|onerror=\|onloadeddata=\|onloadedmetadata=\|onloadstart=\|onpause=\|onplay=\|onplaying=\|onprogress=\|onratechange=\|onreadystatechange=\|onseeked=\|onseeking=\|onstalled=\|onsuspend=\|ontimeupdate=\|onvolumechange=" --include=*.js ${BPATH}/../../../jsOMS ${BPATH}/../../../Model ${BPATH}/../../../Modules ${BPATH}/../../../Web echo "#################################################" echo "# PHPCS" echo "#################################################" -./vendor/bin/phpcs --severity=1 ./ --standard="Build/Config/phpcs.xml" +./vendor/bin/phpcs -s --severity=1 ./ --standard="Build/Config/phpcs.xml" echo "#################################################" echo "# PHP static inspection" diff --git a/Helper/Scripts/serverInstall.sh b/Helper/Scripts/serverInstall.sh index d8389ed..1021607 100644 --- a/Helper/Scripts/serverInstall.sh +++ b/Helper/Scripts/serverInstall.sh @@ -67,14 +67,24 @@ mysql -u root -p CREATE USER 'jingga'@'%' IDENTIFIED BY 'dYg8#@wLiWJ3vE'; CREATE USER 'demo'@'%' IDENTIFIED BY 'orange'; CREATE USER 'test'@'%' IDENTIFIED BY 'orange'; +CREATE USER 'build'@'%' IDENTIFIED BY 'orange'; +# website CREATE DATABASE jingga'; -CREATE DATABASE demo'; + +# demo +CREATE DATABASE omd'; + +# test CREATE DATABASE omt'; +# build +CREATE DATABASE omb'; + GRANT ALL PRIVILEGES ON jingga.* TO 'jingga'@'%'; -GRANT ALL PRIVILEGES ON demo.* TO 'demo'@'%'; +GRANT ALL PRIVILEGES ON omd.* TO 'demo'@'%'; GRANT ALL PRIVILEGES ON omt.* TO 'test'@'%'; +GRANT ALL PRIVILEGES ON omb.* TO 'build'@'%'; FLUSH PRIVILEGES; From bab1a5b83b28ad86660cdba15faf9eed239e860e Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Fri, 12 Jan 2024 00:30:03 +0000 Subject: [PATCH 14/18] continue implementations --- Helper/Php/createPhpFromJsonDb.php | 184 +++++++++++++++++++++++++++++ Helper/Php/langUsageInspector.php | 46 ++++++-- 2 files changed, 222 insertions(+), 8 deletions(-) create mode 100644 Helper/Php/createPhpFromJsonDb.php diff --git a/Helper/Php/createPhpFromJsonDb.php b/Helper/Php/createPhpFromJsonDb.php new file mode 100644 index 0000000..0d69ee6 --- /dev/null +++ b/Helper/Php/createPhpFromJsonDb.php @@ -0,0 +1,184 @@ + + */ +final class ItemMapper extends DataMapperFactory +{ + /** + * Columns. + * + * @var array + * @since 1.0.0 + */ + public const COLUMNS = [ + {$columns} + ]; + + /** + * Primary table. + * + * @var string + * @since 1.0.0 + */ + public const TABLE = '{$table}'; + + /** + * Primary field name. + * + * @var string + * @since 1.0.0 + */ + public const PRIMARYFIELD = '{$primaryfield}'; + + /** + * Has many relation. + * + * @var array + * @since 1.0.0 + */ + public const HAS_MANY = [ + ]; +} + +MAPPER; + +\file_put_contents($output . $name . 'Mapper.php', $mapper); + +//////////// Create model +$model = <<< MODEL + $this->id, + ]; + } + + /** + * {@inheritdoc} + */ + public function jsonSerialize() : mixed + { + return $this->toArray(); + } +} + +MODEL; + +\file_put_contents($output . $name . '.php', $model); + +//////////// Create null model +$nullmodel = <<< NULLMODEL +id = $id; + } + + /** + * {@inheritdoc} + */ + public function jsonSerialize() : mixed + { + return ['id' => $this->id]; + } +} + +NULLMODEL; + +\file_put_contents($output . 'Null' . $name . '.php', $nullmodel); \ No newline at end of file diff --git a/Helper/Php/langUsageInspector.php b/Helper/Php/langUsageInspector.php index 5334556..956e216 100644 --- a/Helper/Php/langUsageInspector.php +++ b/Helper/Php/langUsageInspector.php @@ -16,22 +16,22 @@ declare(strict_types=1); function printUsage() : void { - echo 'Usage: -d -m + echo 'Usage: -m '; -'; - echo "\t" . '-d Destination/output directory.' . "\n"; - echo "\t" . '-m Module directory.' . "\n"; + echo "\t" . '-m Module name.' . "\n"; } -$destination = ($key = \array_search('-d', $argv)) === false || $key === \count($argv) - 1 ? null : \trim($argv[$key + 1], '" '); -$modulePath = ($key = \array_search('-m', $argv)) === false || $key === \count($argv) - 1 ? null : \trim($argv[$key + 1], '" '); +// $destination = ($key = \array_search('-d', $argv)) === false || $key === \count($argv) - 1 ? null : \trim($argv[$key + 1], '" '); +$moduleName = ($key = \array_search('-m', $argv)) === false || $key === \count($argv) - 1 ? null : \trim($argv[$key + 1], '" '); -if (!isset($destination) || !isset($modulePath)) { +if (!isset($moduleName)) { \printUsage(); return; } +$modulePath = __DIR__ . '/../../../Modules/' . $moduleName; + $sources = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($modulePath)); $tpls = []; $langs = []; @@ -69,7 +69,8 @@ foreach($langs as $lang => $data) { $fileContent = \file_get_contents($tpl); foreach ($data as $key => $word) { - if (\stripos($fileContent, '$this->getHtml(\'' . $key . '\')') !== false + if ((\stripos($fileContent, '$this->getHtml(\'' . $key . '\')') !== false + || \stripos($fileContent, '$this->getHtml(\'' . $key . '\', \'' . $moduleName . '\', \'Backend\')') !== false) && ($key = \array_search($key, $unusedLanguage)) !== false ) { unset($unusedLanguage[$key]); @@ -81,3 +82,32 @@ foreach($langs as $lang => $data) { echo 'Language files have different length: ' . ($unequalLength ? 'yes' : 'no') . "\n"; echo 'Unused language components: ' . "\n"; \var_dump($unusedLanguage); + +$sources = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($modulePath)); +$tpls = []; +$langs = []; + +foreach ($sources as $source) { + if ($source->isFile() + && (($temp = \strlen($source->getPathname()) - \strlen('lang.php')) >= 0 && \strpos($source->getPathname(), 'lang.php', $temp) !== false) + && \strlen(\explode('.', \basename($source->getPathname()))[0]) === 2 + ) { + $file = \file_get_contents($source->getPathname()); + $lines = \explode("\n", $file); + $exclude = []; + + foreach ($lines as $line) { + foreach ($unusedLanguage as $unused) { + if (\strpos($line, ' \'' . $unused . '\' ') !== false + && \stripos($unused, ':') === false + ) { + continue 2; + } + } + + $exclude[] = $line; + } + + \file_put_contents($source->getPathname(), \implode("\n", $exclude)); + } +} From a4fd24597fb81048cb411e3f38caf4302fd59d72 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Fri, 26 Jan 2024 22:53:58 +0000 Subject: [PATCH 15/18] auto fixes + some impl. --- Config/.php-cs-fixer.php | 26 +++++++------- Config/reportLang.php | 2 +- .../findMissingInvalidApiControllerTest.php | 2 +- Helper/Scripts/sitespeedDemoUrls.txt | 36 +++++++++---------- Js/createImages.js | 4 +-- LICENSE.txt | 2 +- 6 files changed, 37 insertions(+), 35 deletions(-) diff --git a/Config/.php-cs-fixer.php b/Config/.php-cs-fixer.php index 7f84d88..a428ed1 100644 --- a/Config/.php-cs-fixer.php +++ b/Config/.php-cs-fixer.php @@ -3,6 +3,7 @@ $finder = PhpCsFixer\Finder::create() ->exclude('MainRepository') ->exclude('vendor') + ->exclude('node_modules') ->exclude('Build') ->in(__DIR__ . '/../../'); @@ -18,18 +19,18 @@ $rules = '{ }, "binary_operator_spaces": { "operators": { - "=": "align", - ".=": "align", - "+=": "align", - "-=": "align", - "*=": "align", - "\/=": "align", - "|=": "align", - "&=": "align", - "=>": "align", - "??=": "align", - ">>=": "align", - "<<=": "align" + "=": "align_single_space_minimal", + ".=": "align_single_space_minimal", + "+=": "align_single_space_minimal", + "-=": "align_single_space_minimal", + "*=": "align_single_space_minimal", + "\/=": "align_single_space_minimal", + "|=": "align_single_space_minimal", + "&=": "align_single_space_minimal", + "=>": "align_single_space_minimal", + "??=": "align_single_space_minimal", + ">>=": "align_single_space_minimal", + "<<=": "align_single_space_minimal" } }, "cast_spaces": { @@ -48,6 +49,7 @@ $rules = '{ "declare_equal_normalize": { "space": "none" }, + "nullable_type_declaration_for_default_null_value": true, "elseif": true, "encoding": true, "explicit_indirect_variable": true, diff --git a/Config/reportLang.php b/Config/reportLang.php index 0e6fed0..884e4a6 100755 --- a/Config/reportLang.php +++ b/Config/reportLang.php @@ -2187,7 +2187,7 @@ return [ 'phpOMS\tests\Utils\PermutationTest:testPermute' => ['description' => 'An array can be permuted', 'type' => 'framework'], 'phpOMS\tests\Utils\PermutationTest:testIsPermutation' => ['description' => 'Two string can be checked if they are a permutation of each other', 'type' => 'framework'], 'phpOMS\tests\Utils\PermutationTest:testIsPalindrome' => ['description' => 'A string can be checked if it is a palindrome', 'type' => 'framework'], - 'phpOMS\tests\Utils\PermutationTest:testPermutate' => ['description' => 'An array can be permuted with a permutation key', 'type' => 'framework'], + 'phpOMS\tests\Utils\PermutationTest:testPermute' => ['description' => 'An array can be permuted with a permutation key', 'type' => 'framework'], 'phpOMS\tests\Utils\PermutationTest:testWrongPermuteKeyLength' => ['description' => 'A none-existing permutation key throws a OutOfBoundsException', 'type' => 'framework'], 'phpOMS\tests\Utils\StringCompareTest' => ['description' => 'String comparison / dictionary', 'type' => 'framework'], diff --git a/Helper/Php/findMissingInvalidApiControllerTest.php b/Helper/Php/findMissingInvalidApiControllerTest.php index a6b55fb..c70de70 100644 --- a/Helper/Php/findMissingInvalidApiControllerTest.php +++ b/Helper/Php/findMissingInvalidApiControllerTest.php @@ -28,7 +28,7 @@ function createFunction($name) public function testInvalid{$name}() : void { \$response = new HttpResponse(); - \$request = new HttpRequest(new HttpUri('')); + \$request = new HttpRequest(); \$request->header->account = 1; \$this->module->{$name}(\$request, \$response); diff --git a/Helper/Scripts/sitespeedDemoUrls.txt b/Helper/Scripts/sitespeedDemoUrls.txt index 494134a..2f3cbce 100644 --- a/Helper/Scripts/sitespeedDemoUrls.txt +++ b/Helper/Scripts/sitespeedDemoUrls.txt @@ -21,20 +21,20 @@ http://192.168.178.38/en/admin/monitoring/general http://192.168.178.38/en/admin/monitoring/log/list http://192.168.178.38/en/admin/monitoring/stats http://192.168.178.38/en/admin/audit/list -http://192.168.178.38/en/admin/audit/single?id=1 +http://192.168.178.38/en/admin/audit/view?id=1 http://192.168.178.38/en/organization/organigram http://192.168.178.38/en/organization/unit/list -http://192.168.178.38/en/organization/unit/profile?id=1 +http://192.168.178.38/en/organization/unit/view?id=1 http://192.168.178.38/en/organization/department/list -http://192.168.178.38/en/organization/department/profile?id=1 +http://192.168.178.38/en/organization/department/view?id=1 http://192.168.178.38/en/organization/position/list -http://192.168.178.38/en/organization/position/profile?id=1 +http://192.168.178.38/en/organization/position/view?id=1 http://192.168.178.38/en/messages/dashboard http://192.168.178.38/en/messages/template/list -http://192.168.178.38/en/messages/template/single?id=1 +http://192.168.178.38/en/messages/template/view?id=1 http://192.168.178.38/en/calendar/dashboard http://192.168.178.38/en/profile/list -http://192.168.178.38/en/profile/single?id=2 +http://192.168.178.38/en/profile/view?id=2 http://192.168.178.38/en/media/list http://192.168.178.38/en/media/upload http://192.168.178.38/en/media/file/create @@ -46,7 +46,7 @@ http://192.168.178.38/en/news/create http://192.168.178.38/en/news/draft/list http://192.168.178.38/en/news/analysis http://192.168.178.38/en/editor/list -http://192.168.178.38/en/editor/single?id=1 +http://192.168.178.38/en/editor/view?id=1 http://192.168.178.38/en/orw/resource/list http://192.168.178.38/en/kanban/dashboard http://192.168.178.38/en/kanban/board?id=1 @@ -55,7 +55,7 @@ http://192.168.178.38/en/contract/list http://192.168.178.38/en/contract/type/list http://192.168.178.38/en/survey/list http://192.168.178.38/en/wiki/dashboard -http://192.168.178.38/en/wiki/doc/single?id=1 +http://192.168.178.38/en/wiki/doc/view?id=1 http://192.168.178.38/en/wiki/category/list http://192.168.178.38/en/wiki/list http://192.168.178.38/en/qa/dashboard @@ -68,16 +68,16 @@ http://192.168.178.38/en/checklist/list http://192.168.178.38/en/dbeditor/list http://192.168.178.38/en/dbeditor/editor http://192.168.178.38/en/tag/list -http://192.168.178.38/en/tag/single?id=1 +http://192.168.178.38/en/tag/view?id=1 http://192.168.178.38/en/workflow/instance/list http://192.168.178.38/en/workflow/template/list -http://192.168.178.38/en/workflow/template/profile?id=1 +http://192.168.178.38/en/workflow/template/view?id=1 http://192.168.178.38/en/private/timerecording/dashboard http://192.168.178.38/en/private/support/dashboard http://192.168.178.38/en/private/purchase/recognition/dashboard http://192.168.178.38/en/private/purchase/bill?id=1 http://192.168.178.38/en/private/investment/list -http://192.168.178.38/en/finance/investment/profile?id=1 +http://192.168.178.38/en/finance/investment/view?id=1 http://192.168.178.38/en/businessexpenses/expense/list http://192.168.178.38/en/businessexpenses/expense?id=1 http://192.168.178.38/en/cms/application/list @@ -90,9 +90,9 @@ http://192.168.178.38/en/cms/application/theme?app=2 http://192.168.178.38/en/item/attribute/type/list http://192.168.178.38/en/item/attribute/type?id=1 http://192.168.178.38/en/item/list -http://192.168.178.38/en/item/profile?id=3 +http://192.168.178.38/en/item/view?id=3 http://192.168.178.38/en/sales/client/list -http://192.168.178.38/en/sales/client/profile?id=1 +http://192.168.178.38/en/sales/client/view?id=1 http://192.168.178.38/en/sales/client/attribute/type/list http://192.168.178.38/en/sales/client/attribute/type?id=1 http://192.168.178.38/en/sales/item/list @@ -105,7 +105,7 @@ http://192.168.178.38/en/sales/analysis/bill http://192.168.178.38/en/sales/analysis/region http://192.168.178.38/en/sales/analysis/rep http://192.168.178.38/en/purchase/supplier/list -http://192.168.178.38/en/purchase/supplier/profile?id=1 +http://192.168.178.38/en/purchase/supplier/view?id=1 http://192.168.178.38/en/purchase/supplier/attribute/type/list http://192.168.178.38/en/purchase/supplier/attribute/type?id=1 http://192.168.178.38/en/purchase/item/list @@ -127,7 +127,7 @@ http://192.168.178.38/en/accounting/coa/list http://192.168.178.38/en/admin/group/settings?id=1#c-tab-1 http://192.168.178.38/en/accounting/stack/list http://192.168.178.38/en/finance/investment/list -http://192.168.178.38/en/finance/investment/profile?id=1 +http://192.168.178.38/en/finance/investment/view?id=1 http://192.168.178.38/en/finance/loan/list http://192.168.178.38/en/marketing/promotion/list http://192.168.178.38/en/marketing/event/list @@ -142,16 +142,16 @@ http://192.168.178.38/en/support/list http://192.168.178.38/en/support/settings/dashboard http://192.168.178.38/en/support/analysis/dashboard http://192.168.178.38/en/fleet/vehicle/list -http://192.168.178.38/en/fleet/vehicle/profile?id=1 +http://192.168.178.38/en/fleet/vehicle/view?id=1 http://192.168.178.38/en/fleet/driver/list -http://192.168.178.38/en/fleet/driver/profile?id=1 +http://192.168.178.38/en/fleet/driver/view?id=1 http://192.168.178.38/en/fleet/inspection/list http://192.168.178.38/en/fleet/vehicle/attribute/type/list http://192.168.178.38/en/fleet/vehicle/attribute/type?id=1 http://192.168.178.38/en/fleet/driver/attribute/type/list http://192.168.178.38/en/fleet/vehicle/attribute/type?id=1 http://192.168.178.38/en/equipment/list -http://192.168.178.38/en/equipment/equipment/profile?id=1 +http://192.168.178.38/en/equipment/equipment/view?id=1 http://192.168.178.38/en/equipment/inspection/list http://192.168.178.38/en/equipment/attribute/type/list http://192.168.178.38/en/fleet/equipment/attribute/type?id=1 diff --git a/Js/createImages.js b/Js/createImages.js index 4f0404d..bf7ee07 100755 --- a/Js/createImages.js +++ b/Js/createImages.js @@ -47,12 +47,12 @@ const src = [ __dirname + '/../../Modules/Help/Docs/Help/img/help-general-module-list.png' ], [ - 'http://192.168.178.38/en/backend/help/module/single?id=Admin', + 'http://192.168.178.38/en/backend/help/module/view?id=Admin', '//*[@id="content"]', __dirname + '/../../Modules/Help/Docs/Help/img/help-general-module-readme.png' ], [ - 'http://192.168.178.38/en/backend/help/module/single?id=Admin&page=Dev%2Fstructure', + 'http://192.168.178.38/en/backend/help/module/view?id=Admin&page=Dev%2Fstructure', '//*[@id="content"]', __dirname + '/../../Modules/Help/Docs/Help/img/help-general-module-structure.png' ], diff --git a/LICENSE.txt b/LICENSE.txt index 18d430e..4ba0161 100755 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -27,7 +27,7 @@ Version 2.0 Subject to the terms and conditions of this License, each Contributor grants to You after purchase a perpetual, worldwide, non-exclusive, irrevocable copyright license to prepare Derivative Works of, publicly display, publicly perform the Work and such Derivative Works in Source or Object form. You are not allowed to sublicense, reproduce, or distribute the Work and such Derivative Works in Source or Object form. -3. Redistribution. +3. Redistribution You may not reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form. From e0e06144e703478cc6cd34af74906bb491a4a781 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Tue, 30 Jan 2024 21:29:20 +0000 Subject: [PATCH 16/18] bump --- Helper/Php/findMissingNullModelTest.php | 2 +- Helper/Scripts/serverInstall.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Helper/Php/findMissingNullModelTest.php b/Helper/Php/findMissingNullModelTest.php index cb4e370..831f8f8 100644 --- a/Helper/Php/findMissingNullModelTest.php +++ b/Helper/Php/findMissingNullModelTest.php @@ -29,7 +29,7 @@ foreach ($modules as $module) { foreach ($models as $model) { if ($model === '..' || $model === '.' - || \stripos($model, 'Null') !== 0 + || !\str_starts_with($model, 'Null') ) { continue; } diff --git a/Helper/Scripts/serverInstall.sh b/Helper/Scripts/serverInstall.sh index 1021607..32427f3 100644 --- a/Helper/Scripts/serverInstall.sh +++ b/Helper/Scripts/serverInstall.sh @@ -37,7 +37,7 @@ service fail2ban restart ## Web ############################################################### -apt-get install php8.1 php8.1-dev php8.1-cli php8.1-common php8.1-mysql php8.1-pgsql php8.1-xdebug php8.1-opcache php8.1-pdo php8.1-sqlite php8.1-mbstring php8.1-curl php8.1-imap php8.1-bcmath php8.1-zip php8.1-dom php8.1-xml php8.1-phar php8.1-gd php-pear apache2 libapache2-mpm-itk apache2-utils mariadb-server mariadb-client wkhtmltopdf tesseract-ocr poppler-utils +apt-get install php8.1 php8.1-dev php8.1-cli php8.1-common php8.1-mysql php8.1-pgsql php8.1-xdebug php8.1-opcache php8.1-pdo php8.1-sqlite php8.1-mbstring php8.1-curl php8.1-imap php8.1-bcmath php8.1-zip php8.1-dom php8.1-xml php8.1-phar php8.1-gd php-pear apache2 libapache2-mpm-itk apache2-utils mariadb-server mariadb-client wkhtmltopdf tesseract-ocr poppler-utils imagemagick pecl install pcov #echo "extension=pcov.so" > /etc/php/cli/conf.d/20-xdebug.ini From 0c919d99cca8495938765cd40f92f684d5c4a4ae Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sun, 4 Feb 2024 20:34:11 +0000 Subject: [PATCH 17/18] update --- Config/phpcs.xml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/Config/phpcs.xml b/Config/phpcs.xml index 8390860..56de329 100755 --- a/Config/phpcs.xml +++ b/Config/phpcs.xml @@ -27,13 +27,6 @@ */tests/* */Sandbox/* */vendor/* -*/Mail/* -*/Interfaces/* -*/Workflows/* -*/Accounting/* -*/JobScheduling/* -*/TrueSkill.php -*/BayesianPersonalizedRanking.php */Parser/Spreadsheet/* */Parser/Presentation/* */Parser/Document/* From bff698ca3fff8009fb414ae4431e22da080c9aeb Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Fri, 15 Mar 2024 20:24:37 +0000 Subject: [PATCH 18/18] code fixes --- Config/phpcs.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Config/phpcs.xml b/Config/phpcs.xml index 56de329..96f7f77 100755 --- a/Config/phpcs.xml +++ b/Config/phpcs.xml @@ -96,6 +96,7 @@ */tests/* + *oLib.js *StringUtils.js @@ -113,6 +114,7 @@ + */Message/Mail/* *Server.php *Ftp/File.php *Ftp/Directory.php