Merge branch 'develop'

This commit is contained in:
Dennis Eichhorn 2024-03-15 22:51:56 +00:00
commit 03dcf48a3b
17 changed files with 623 additions and 95 deletions

View File

@ -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,

View File

@ -27,21 +27,11 @@
<exclude-pattern>*/tests/*</exclude-pattern>
<exclude-pattern>*/Sandbox/*</exclude-pattern>
<exclude-pattern>*/vendor/*</exclude-pattern>
<exclude-pattern>*/OAuth2/*</exclude-pattern><!-- @todo: temporarily disabled-->
<exclude-pattern>*/Mail/*</exclude-pattern><!-- @todo: temporarily disabled-->
<exclude-pattern>*/Interfaces/*</exclude-pattern><!-- @todo: temporarily disabled-->
<exclude-pattern>*/Workflows/*</exclude-pattern><!-- @todo: temporarily disabled-->
<exclude-pattern>*/Accounting/*</exclude-pattern><!-- @todo: temporarily disabled-->
<exclude-pattern>*/JobScheduling/*</exclude-pattern><!-- @todo: temporarily disabled-->
<exclude-pattern>*/TrueSkill.php</exclude-pattern><!-- @todo: temporarily disabled-->
<exclude-pattern>*/Simplex.php</exclude-pattern><!-- @todo: temporarily disabled-->
<exclude-pattern>*/BayesianPersonalizedRanking.php</exclude-pattern><!-- @todo: temporarily disabled-->
<exclude-pattern>*/Parser/Spreadsheet/*</exclude-pattern><!-- @note: false positive due to libs -->
<exclude-pattern>*/Parser/Presentation/*</exclude-pattern><!-- @note: false positive due to libs -->
<exclude-pattern>*/Parser/Document/*</exclude-pattern><!-- @note: false positive due to libs -->
<exclude-pattern>*/Parser/Spreadsheet/*</exclude-pattern><!-- false positive due to libs -->
<exclude-pattern>*/Parser/Presentation/*</exclude-pattern><!-- false positive due to libs -->
<exclude-pattern>*/Parser/Document/*</exclude-pattern><!-- false positive due to libs -->
<exclude-pattern>*Hooks.php</exclude-pattern>
<exclude-pattern>*Markdown.js</exclude-pattern>
<exclude-pattern>*Markdown.php</exclude-pattern>
<exclude-pattern>*ObjLoader.js</exclude-pattern>
<exclude-pattern>config.php</exclude-pattern>
<exclude-pattern>*Routes.php</exclude-pattern>
@ -49,10 +39,11 @@
<exclude-pattern>*Sha1.js</exclude-pattern>
<exclude-pattern>*Sha1b.js</exclude-pattern>
<exclude-pattern>[abcdef0-9]{32}/*</exclude-pattern>
<exclude-pattern>*.min.js</exclude-pattern>
<arg value="q"/>
<arg name="colors"/>
<arg name="tab-width" value="4"/>
<!-- <rule ref="Generic.Classes.DuplicateClassName"/> @todo: disabled until bug is fixed. currently namespace is ignored which creates a lot of false positives e.g. Installer, Updater, Controller, etc. -->
<!-- <rule ref="Generic.Classes.DuplicateClassName"/> @todo disabled until bug is fixed. currently namespace is ignored which creates a lot of false positives e.g. Installer, Updater, Controller, etc. -->
<rule ref="Generic.CodeAnalysis.EmptyStatement"/>
<rule ref="Generic.CodeAnalysis.ForLoopWithTestFunctionCall">
<exclude-pattern>*Sort.php</exclude-pattern>
@ -105,6 +96,7 @@
<exclude-pattern>*/tests/*</exclude-pattern><!-- inline function definition -->
</rule>
<rule ref="Generic.Formatting.MultipleStatementAlignment">
<exclude name="Generic.Formatting.MultipleStatementAlignment.NotSameWarning"/>
<exclude-pattern>*oLib.js</exclude-pattern><!-- I don't know why it doesn't understand this -->
<exclude-pattern>*StringUtils.js</exclude-pattern><!-- I don't know why it doesn't understand this -->
</rule>
@ -122,6 +114,7 @@
<rule ref="Generic.NamingConventions.UpperCaseConstantName"/>
<rule ref="Generic.PHP.LowerCaseConstant"/>
<rule ref="Generic.PHP.NoSilencedErrors">
<exclude-pattern>*/Message/Mail/*</exclude-pattern>
<exclude-pattern>*Server.php</exclude-pattern><!-- Socket shouldn't output errors -->
<exclude-pattern>*Ftp/File.php</exclude-pattern><!-- Socket shouldn't output errors -->
<exclude-pattern>*Ftp/Directory.php</exclude-pattern><!-- Socket shouldn't output errors -->
@ -151,6 +144,7 @@
<exclude name="PEAR.Commenting.ClassComment.MissingAuthorTag"/>
<exclude name="PEAR.Commenting.ClassComment.MissingCategoryTag"/>
<exclude name="PEAR.Commenting.ClassComment.InvalidVersion"/>
<exclude name="PEAR.Commenting.ClassComment.DuplicateLicenseTag"/>
</rule>
<rule ref="PEAR.Commenting.FunctionComment">
<severity>7</severity>

View File

@ -14,6 +14,7 @@ parameters:
treatPhpDocTypesAsCertain: false
excludePaths:
- *.tpl.php
- *.min.js
- */Modules/Media/Files/*
- */omsSetup/*
- */demoSetup/*
@ -40,7 +41,6 @@ parameters:
- */DataStorage/Database/*
- */Message/Mail/*
- */Auth/OAuth2/*
- */Markdown/Markdown.php
- */Socket/*
- */node_modules/*
- */Install/Application/*
@ -51,7 +51,6 @@ parameters:
- */Parser/Document/*
- */Parser/Spreadsheet/*
- *BayesianPersonalizedRanking.php
- *Simplex.php
- *DBSCAN.php
- *MeanShift.php
- *Datamatrix.php

View File

@ -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,

View File

@ -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'],

View File

@ -0,0 +1,184 @@
<?php
$jsonStr = '';
$name = 'ItemPackaging';
$namespace = 'Modules\IteManagement\Models';
$output = __DIR__ . '/../../../' . \str_replace('\\', '/', $namespace) . '/';
//////////// Create Mapper
$mapper = <<< MAPPER
<?php
/**
* Jingga
*
* PHP Version 8.1
*
* @package {$namespace}
* @copyright Dennis Eichhorn
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
namespace {$namespace};
use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
/**
* {$name} mapper class.
*
* @package {$namespace}
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*
* @template T of {$name}
* @extends DataMapperFactory<T>
*/
final class ItemMapper extends DataMapperFactory
{
/**
* Columns.
*
* @var array<string, array{name:string, type:string, internal:string, autocomplete?:bool, readonly?:bool, writeonly?:bool, annotations?: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<string, array{mapper:class-string, table:string, self?:?string, external?:?string, column?:string}>
* @since 1.0.0
*/
public const HAS_MANY = [
];
}
MAPPER;
\file_put_contents($output . $name . 'Mapper.php', $mapper);
//////////// Create model
$model = <<< MODEL
<?php
/**
* Jingga
*
* PHP Version 8.1
*
* @package {$namespace}
* @copyright Dennis Eichhorn
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
namespace {$namespace};
/**
* {$name} class.
*
* @package {$namespace}
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*/
class {$name} implements \JsonSerializable
{
{$members}
/**
* {@inheritdoc}
*/
public function toArray() : array
{
return [
'id' => $this->id,
];
}
/**
* {@inheritdoc}
*/
public function jsonSerialize() : mixed
{
return $this->toArray();
}
}
MODEL;
\file_put_contents($output . $name . '.php', $model);
//////////// Create null model
$nullmodel = <<< NULLMODEL
<?php
/**
* Jingga
*
* PHP Version 8.1
*
* @package {$namespace}
* @copyright Dennis Eichhorn
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
namespace {$namespace};
/**
* Null model
*
* @package {$namespace}
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*/
final class Null{$name} extends {$name}
{
/**
* Constructor
*
* @param int $id Model id
*
* @since 1.0.0
*/
public function __construct(int $id = 0)
{
$this->id = $id;
}
/**
* {@inheritdoc}
*/
public function jsonSerialize() : mixed
{
return ['id' => $this->id];
}
}
NULLMODEL;
\file_put_contents($output . 'Null' . $name . '.php', $nullmodel);

View File

@ -0,0 +1,160 @@
<?php
/**
* Jingga
*
* PHP Version 8.1
*
* @package Helper
* @copyright Dennis Eichhorn
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
/*
1. find Api functions that have a validation function ($val = $)
2. find Test script where this one is getting called
3. Check if invalid check exists
4. If not, add at bottom of file
*/
$modules = \scandir(__DIR__ . '/../../../Modules');
function createFunction($name)
{
$invalid = <<<HEREDOC
public function testInvalid{$name}() : void
{
\$response = new HttpResponse();
\$request = new HttpRequest();
\$request->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 = \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 === '.' || !\is_file(__DIR__ . '/../../../Modules/' . $module . '/tests/Controller/' . $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 === '.' || !\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/Api/' . $file);
}
$open = [];
foreach ($testFilesContent as $path => $testFile) {
foreach ($relevantFunction as $function) {
$offset = 0;
$found = -1;
if (!isset($open[$function])) {
$open[$function] = -1;
}
while (($invalidPos = \stripos($testFile, '->' . $function . '(', $offset)) !== false) {
$offset = $invalidPos + 1;
$found = 0;
$statusPos = \stripos($testFile, 'self::assertEquals(RequestStatusCode::');
if ($statusPos !== false && $statusPos - $invalidPos < 250) {
$found = 1;
$open[$function] = 1;
break;
}
}
if ($found === 0) {
echo $function . "\n";
$newContent = \createFunction($function);
$newContent = \rtrim($testFile, " }\n") . "\n }\n" . $newContent . "}\n";
\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;
}
}
}
}

View File

@ -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;
}
@ -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,12 +89,22 @@ 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"
. ' $null = new Null' . $model . '(2);' . "\n"
. ' self::assertEquals(2, $null->getId());' . "\n"
. ' self::assertEquals(2, $null->id);' . "\n"
. ' }' . "\n"
. "\n"
. ' /**' . "\n"
. ' * @covers Modules\\' . $module . '\Models\Null' . $model . '' . "\n"
. ' * @group module' . "\n"
. ' */' . "\n"
. ' public function testJsonSerialize() : void' . "\n"
. ' {' . "\n"
. ' $null = new Null' . $model . '(2);' . "\n"
. ' self::assertEquals([\'id\' => 2], $null);' . "\n"
. ' }' . "\n"
. '}' . "\n";

View File

@ -16,22 +16,22 @@ declare(strict_types=1);
function printUsage() : void
{
echo 'Usage: -d <DESTINATION_PATH> -m <PATH>
echo 'Usage: -m <PATH>';
';
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));
}
}

View File

@ -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"

View File

@ -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)
@ -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
@ -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';
CREATE DATABASE jingga COMMENT 'Main application database';
CREATE DATABASE demo COMMENT 'Demo application database';
CREATE DATABASE omt COMMENT 'Tests';
# website
CREATE DATABASE jingga';
# 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;

View File

@ -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);
};
return commands.wait.byId('u-box', 1000);
};

View File

@ -0,0 +1,163 @@
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/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/view?id=1
http://192.168.178.38/en/organization/department/list
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/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/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/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
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
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
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/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
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/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/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/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
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/view?id=3
http://192.168.178.38/en/sales/client/list
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
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/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
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/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
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/view?id=1
http://192.168.178.38/en/fleet/driver/list
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/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
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

View File

@ -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

View File

@ -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

View File

@ -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'
],

View File

@ -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.