Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d06769c48b | ||
|
|
4c0390f082 | ||
|
|
95bee3dc8c | ||
|
|
65132d8a4a | ||
|
|
b2243cd06d | ||
|
|
8f09b67d86 | ||
|
|
fe459aec80 |
@@ -44,6 +44,11 @@ final class CoreLibsLoggingErrorMessagesTest extends TestCase
|
|||||||
'str' => 'INFO',
|
'str' => 'INFO',
|
||||||
'expected' => 'info',
|
'expected' => 'info',
|
||||||
],
|
],
|
||||||
|
'notice' => [
|
||||||
|
'level' => 'notice',
|
||||||
|
'str' => 'NOTICE',
|
||||||
|
'expected' => 'notice',
|
||||||
|
],
|
||||||
'warn' => [
|
'warn' => [
|
||||||
'level' => 'warn',
|
'level' => 'warn',
|
||||||
'str' => 'WARN',
|
'str' => 'WARN',
|
||||||
@@ -106,6 +111,7 @@ final class CoreLibsLoggingErrorMessagesTest extends TestCase
|
|||||||
'str' => $str,
|
'str' => $str,
|
||||||
'id' => '',
|
'id' => '',
|
||||||
'target' => '',
|
'target' => '',
|
||||||
|
'target_style' => '',
|
||||||
'highlight' => [],
|
'highlight' => [],
|
||||||
],
|
],
|
||||||
$em->getLastErrorMsg()
|
$em->getLastErrorMsg()
|
||||||
@@ -139,6 +145,7 @@ final class CoreLibsLoggingErrorMessagesTest extends TestCase
|
|||||||
'level' => 'info',
|
'level' => 'info',
|
||||||
'str' => 'INFO MESSAGE',
|
'str' => 'INFO MESSAGE',
|
||||||
'target' => '',
|
'target' => '',
|
||||||
|
'target_style' => '',
|
||||||
'highlight' => [],
|
'highlight' => [],
|
||||||
],
|
],
|
||||||
$em->getLastErrorMsg()
|
$em->getLastErrorMsg()
|
||||||
@@ -154,6 +161,7 @@ final class CoreLibsLoggingErrorMessagesTest extends TestCase
|
|||||||
'level' => 'info',
|
'level' => 'info',
|
||||||
'str' => 'INFO MESSAGE',
|
'str' => 'INFO MESSAGE',
|
||||||
'target' => '',
|
'target' => '',
|
||||||
|
'target_style' => '',
|
||||||
'highlight' => [],
|
'highlight' => [],
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
@@ -171,6 +179,7 @@ final class CoreLibsLoggingErrorMessagesTest extends TestCase
|
|||||||
'level' => 'error',
|
'level' => 'error',
|
||||||
'str' => 'ERROR MESSAGE',
|
'str' => 'ERROR MESSAGE',
|
||||||
'target' => '',
|
'target' => '',
|
||||||
|
'target_style' => '',
|
||||||
'highlight' => [],
|
'highlight' => [],
|
||||||
],
|
],
|
||||||
$em->getLastErrorMsg()
|
$em->getLastErrorMsg()
|
||||||
@@ -186,6 +195,7 @@ final class CoreLibsLoggingErrorMessagesTest extends TestCase
|
|||||||
'level' => 'info',
|
'level' => 'info',
|
||||||
'str' => 'INFO MESSAGE',
|
'str' => 'INFO MESSAGE',
|
||||||
'target' => '',
|
'target' => '',
|
||||||
|
'target_style' => '',
|
||||||
'highlight' => [],
|
'highlight' => [],
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
@@ -193,6 +203,7 @@ final class CoreLibsLoggingErrorMessagesTest extends TestCase
|
|||||||
'level' => 'error',
|
'level' => 'error',
|
||||||
'str' => 'ERROR MESSAGE',
|
'str' => 'ERROR MESSAGE',
|
||||||
'target' => '',
|
'target' => '',
|
||||||
|
'target_style' => '',
|
||||||
'highlight' => [],
|
'highlight' => [],
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
@@ -232,6 +243,22 @@ final class CoreLibsLoggingErrorMessagesTest extends TestCase
|
|||||||
'log_error' => true,
|
'log_error' => true,
|
||||||
'expected' => '<ERROR> OTHER ERROR MESSAGE',
|
'expected' => '<ERROR> OTHER ERROR MESSAGE',
|
||||||
],
|
],
|
||||||
|
'notice' => [
|
||||||
|
'id' => '100',
|
||||||
|
'level' => 'notice',
|
||||||
|
'str' => 'NOTICE MESSAGE',
|
||||||
|
'message' => null,
|
||||||
|
'log_error' => null,
|
||||||
|
'expected' => '<NOTICE> NOTICE MESSAGE',
|
||||||
|
],
|
||||||
|
'notice, message' => [
|
||||||
|
'id' => '100',
|
||||||
|
'level' => 'notice',
|
||||||
|
'str' => 'NOTICE MESSAGE',
|
||||||
|
'message' => 'OTHER NOTICE MESSAGE',
|
||||||
|
'log_error' => null,
|
||||||
|
'expected' => '<NOTICE> OTHER NOTICE MESSAGE',
|
||||||
|
],
|
||||||
'crash' => [
|
'crash' => [
|
||||||
'id' => '300',
|
'id' => '300',
|
||||||
'level' => 'crash',
|
'level' => 'crash',
|
||||||
|
|||||||
10
composer.lock
generated
10
composer.lock
generated
@@ -1180,16 +1180,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "phpstan/phpstan",
|
"name": "phpstan/phpstan",
|
||||||
"version": "1.10.33",
|
"version": "1.10.34",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/phpstan/phpstan.git",
|
"url": "https://github.com/phpstan/phpstan.git",
|
||||||
"reference": "03b1cf9f814ba0863c4e9affea49a4d1ed9a2ed1"
|
"reference": "7f806b6f1403e6914c778140e2ba07c293cb4901"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/03b1cf9f814ba0863c4e9affea49a4d1ed9a2ed1",
|
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/7f806b6f1403e6914c778140e2ba07c293cb4901",
|
||||||
"reference": "03b1cf9f814ba0863c4e9affea49a4d1ed9a2ed1",
|
"reference": "7f806b6f1403e6914c778140e2ba07c293cb4901",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -1238,7 +1238,7 @@
|
|||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2023-09-04T12:20:53+00:00"
|
"time": "2023-09-13T09:49:47+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "phpstan/phpstan-deprecation-rules",
|
"name": "phpstan/phpstan-deprecation-rules",
|
||||||
|
|||||||
12
vendor/composer/installed.json
vendored
12
vendor/composer/installed.json
vendored
@@ -1179,17 +1179,17 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "phpstan/phpstan",
|
"name": "phpstan/phpstan",
|
||||||
"version": "1.10.33",
|
"version": "1.10.34",
|
||||||
"version_normalized": "1.10.33.0",
|
"version_normalized": "1.10.34.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/phpstan/phpstan.git",
|
"url": "https://github.com/phpstan/phpstan.git",
|
||||||
"reference": "03b1cf9f814ba0863c4e9affea49a4d1ed9a2ed1"
|
"reference": "7f806b6f1403e6914c778140e2ba07c293cb4901"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/03b1cf9f814ba0863c4e9affea49a4d1ed9a2ed1",
|
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/7f806b6f1403e6914c778140e2ba07c293cb4901",
|
||||||
"reference": "03b1cf9f814ba0863c4e9affea49a4d1ed9a2ed1",
|
"reference": "7f806b6f1403e6914c778140e2ba07c293cb4901",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -1198,7 +1198,7 @@
|
|||||||
"conflict": {
|
"conflict": {
|
||||||
"phpstan/phpstan-shim": "*"
|
"phpstan/phpstan-shim": "*"
|
||||||
},
|
},
|
||||||
"time": "2023-09-04T12:20:53+00:00",
|
"time": "2023-09-13T09:49:47+00:00",
|
||||||
"bin": [
|
"bin": [
|
||||||
"phpstan",
|
"phpstan",
|
||||||
"phpstan.phar"
|
"phpstan.phar"
|
||||||
|
|||||||
6
vendor/composer/installed.php
vendored
6
vendor/composer/installed.php
vendored
@@ -191,9 +191,9 @@
|
|||||||
'dev_requirement' => true,
|
'dev_requirement' => true,
|
||||||
),
|
),
|
||||||
'phpstan/phpstan' => array(
|
'phpstan/phpstan' => array(
|
||||||
'pretty_version' => '1.10.33',
|
'pretty_version' => '1.10.34',
|
||||||
'version' => '1.10.33.0',
|
'version' => '1.10.34.0',
|
||||||
'reference' => '03b1cf9f814ba0863c4e9affea49a4d1ed9a2ed1',
|
'reference' => '7f806b6f1403e6914c778140e2ba07c293cb4901',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../phpstan/phpstan',
|
'install_path' => __DIR__ . '/../phpstan/phpstan',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
|
|||||||
BIN
vendor/phpstan/phpstan/phpstan.phar
vendored
BIN
vendor/phpstan/phpstan/phpstan.phar
vendored
Binary file not shown.
26
vendor/phpstan/phpstan/phpstan.phar.asc
vendored
26
vendor/phpstan/phpstan/phpstan.phar.asc
vendored
@@ -1,16 +1,16 @@
|
|||||||
-----BEGIN PGP SIGNATURE-----
|
-----BEGIN PGP SIGNATURE-----
|
||||||
|
|
||||||
iQIzBAABCgAdFiEEynwsejDI6OEnSoR2UcZzBf/C5cAFAmT1y40ACgkQUcZzBf/C
|
iQIzBAABCgAdFiEEynwsejDI6OEnSoR2UcZzBf/C5cAFAmUBhZwACgkQUcZzBf/C
|
||||||
5cDm6Q//VupQizxW3TICxhwzMDz05+nI8d72mn5vd94Niat90L1wPVHSZ9eBQSs3
|
5cDAIA/+JOxOdWCg6b1+/Bs4Opm7cmILJzh3Rw1366MzXFHJhe2n7exemzTE3X2E
|
||||||
xMGVKJufB/3tQp6rviYk0aFnTFsKYkgwQYSDk1P9D7VrcJdpB461P3FT4MGsRk8E
|
0HTjVVWoE0MpTt6knBgb+dulXTGm+yzJNIRLnCJFhsSdwUcxNAZMPozliZszGMcC
|
||||||
SSo55EuMGpiVvgoKbiPXeYV76yEpSMpelbKDNTm7iglLFVQKAnTv17aQv/UdBoYk
|
HhGC1Ya7RU5d9WEg/lCAKRjNgSeY8VTRRfa49m6TQPQwGinXBNpH6q665feziUX5
|
||||||
t/dOS0ovoWmjkj9837EA5o2FAkhA5njlpvRs1l5Jt/tZsZtJTcDjPYfP5kIGbOwp
|
NB+rBMaWUDKp6GelPVrezEfME+SMfT66hW31n5m5paTwT+khk2Cenub5xXBUyXtz
|
||||||
V6xKYW7JYht+O0si3GxGmWGOE4VbOHLpUDpLMmVu53njjeGAIkPgX53TqBRbAbVL
|
saxSayOShlUPN8kZKOjS/L/FPnOApGwcKxkX2kMK0qDs8YQFYHibNgnyhrEOBRD1
|
||||||
FjpDSZYC08lE4WblqXZEP6aKqVqthQ4LcGfyZDvuWDgPGHf86cTvfHQvtqRY45kU
|
UV9kBiU1+LUuxDcya8f0qo/gk6QN7Y/ywnIY3kTkqTYchCAAO+osu1amLYlInBSu
|
||||||
GhFDz6IfVlwBrfpc4hKfbhF6Q3Txm8ZSSfiVHim8JFjCqO+jn4qmaXGaOqbNUfv9
|
r0LtQQ8+/llQ/bP0XS6cC6247J1fxO9xYMMmKVBfJrul3Wi6ETRI5WIdEQTSc2Z+
|
||||||
fLgg7Bbnu1tZdMv6JJP5Kmk0x5wp4m2vFxDd6NGfm7uz9182/LtXOjqQ0MuGfL+j
|
rE00JY2X/vxJijUyGZ88+QDX3z7vGyaQJZiXq1XyjmBYw6w8UlxhGZcGGDIbTsb7
|
||||||
Dw53dl+WdUpr4Xk1m1GkYwDF9zLIwBB7dEghz6c4nbiGvh31MUk6N+4N2eGkjtWW
|
lACLR/t4hgtE69QXW+L4P2ngU0agk5XXojg/+r+CnCWD/TdKcvs1WTn4TyuMZOLa
|
||||||
B1PPORcpxxXSlhtftCwsJVxRFodQu9cmI0qmw4EUEipFrkFuT7a1rNF48NFyfRMh
|
2XF3h9/H0XMfE5LPlNJmb4YRjYjcNvPQwmGI4dmUMCJuTpjHUnpFXfswu4xgsaYV
|
||||||
PcB/UcUHMCL7owhfQEEuPvqIPJS4saesCdFeJAM0MKuXB1nNGTQ=
|
xq756DVfrRyG9PyXFfJZ66P7jt5+wisrVsWh/X3nX69P0ruwwss=
|
||||||
=HpaR
|
=aOCq
|
||||||
-----END PGP SIGNATURE-----
|
-----END PGP SIGNATURE-----
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ print "NU: " . ml::fromValue(100)->name . "<br>";
|
|||||||
print "NU: " . ml::fromValue(1000)->name . "<br>";
|
print "NU: " . ml::fromValue(1000)->name . "<br>";
|
||||||
|
|
||||||
$em->setErrorMsg('123', 'error', 'msg this is bad, not logged');
|
$em->setErrorMsg('123', 'error', 'msg this is bad, not logged');
|
||||||
|
$em->setErrorMsg('123', 'error', 'msg this is bad, not logged', 'target-id', 'other-style');
|
||||||
$em->setErrorMsg('123', 'error', 'msg this is bad, logged', log_error:true);
|
$em->setErrorMsg('123', 'error', 'msg this is bad, logged', log_error:true);
|
||||||
$em->setErrorMsg('1000', 'info', 'This is good');
|
$em->setErrorMsg('1000', 'info', 'This is good');
|
||||||
$em->setErrorMsg('9999', 'abort', 'BAD: This is critical (abort)');
|
$em->setErrorMsg('9999', 'abort', 'BAD: This is critical (abort)');
|
||||||
|
|||||||
6
www/admin/edit_base_page_test.php
Normal file
6
www/admin/edit_base_page_test.php
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
// empty file for add and remove test
|
||||||
|
|
||||||
|
// __END__
|
||||||
|
|
||||||
@@ -35,6 +35,8 @@ class EditBase
|
|||||||
private \CoreLibs\Output\Form\Generate $form;
|
private \CoreLibs\Output\Form\Generate $form;
|
||||||
/** @var \CoreLibs\Logging\Logging */
|
/** @var \CoreLibs\Logging\Logging */
|
||||||
public \CoreLibs\Logging\Logging $log;
|
public \CoreLibs\Logging\Logging $log;
|
||||||
|
/** @var \CoreLibs\Language\L10n */
|
||||||
|
public \CoreLibs\Language\L10n $l;
|
||||||
/** @var \CoreLibs\ACL\Login */
|
/** @var \CoreLibs\ACL\Login */
|
||||||
public \CoreLibs\ACL\Login $login;
|
public \CoreLibs\ACL\Login $login;
|
||||||
|
|
||||||
@@ -57,6 +59,7 @@ class EditBase
|
|||||||
) {
|
) {
|
||||||
$this->log = $log;
|
$this->log = $log;
|
||||||
$this->login = $login;
|
$this->login = $login;
|
||||||
|
$this->l = $l10n;
|
||||||
// smarty template engine (extended Translation version)
|
// smarty template engine (extended Translation version)
|
||||||
$this->smarty = new \CoreLibs\Template\SmartyExtend(
|
$this->smarty = new \CoreLibs\Template\SmartyExtend(
|
||||||
$l10n,
|
$l10n,
|
||||||
@@ -77,7 +80,7 @@ class EditBase
|
|||||||
echo "I am sorry, but this page cannot be viewed by a mobile phone";
|
echo "I am sorry, but this page cannot be viewed by a mobile phone";
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
// $this->form->log->debug('POST', $this->form->log->prAr($_POST));
|
// $this->log->debug('POST', $this->log->prAr($_POST));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -179,7 +182,7 @@ class EditBase
|
|||||||
} // while read data ...
|
} // while read data ...
|
||||||
|
|
||||||
// html title
|
// html title
|
||||||
$this->HEADER['HTML_TITLE'] = $this->form->l->__('Edit Order');
|
$this->HEADER['HTML_TITLE'] = $this->l->__('Edit Order');
|
||||||
|
|
||||||
$messages = [];
|
$messages = [];
|
||||||
$error = $_POST['error'] ?? 0;
|
$error = $_POST['error'] ?? 0;
|
||||||
@@ -632,7 +635,7 @@ class EditBase
|
|||||||
'editAdmin_' . $this->smarty->lang
|
'editAdmin_' . $this->smarty->lang
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->form->log->debug('DEBUGEND', '==================================== [Form END]');
|
$this->log->debug('DEBUGEND', '==================================== [Form END]');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -198,7 +198,7 @@ class ArrayIO extends \CoreLibs\DB\IO
|
|||||||
public function dbCheckPkSet(): bool
|
public function dbCheckPkSet(): bool
|
||||||
{
|
{
|
||||||
// if pk_id is set, overrule ...
|
// if pk_id is set, overrule ...
|
||||||
if ($this->pk_id) {
|
if (!empty($this->pk_id)) {
|
||||||
$this->table_array[$this->pk_name]['value'] = $this->pk_id;
|
$this->table_array[$this->pk_name]['value'] = $this->pk_id;
|
||||||
}
|
}
|
||||||
// if not set ... produce error
|
// if not set ... produce error
|
||||||
|
|||||||
@@ -3232,7 +3232,7 @@ class IO
|
|||||||
*
|
*
|
||||||
* @param array<mixed> $write_array list of elements to write
|
* @param array<mixed> $write_array list of elements to write
|
||||||
* @param array<mixed> $not_write_array list of elements not to write
|
* @param array<mixed> $not_write_array list of elements not to write
|
||||||
* @param int $primary_key id key to decide if we write insert or update
|
* @param int|null $primary_key id key to decide if we write insert or update
|
||||||
* @param string $table name for the target table
|
* @param string $table name for the target table
|
||||||
* @param array<mixed> $data data array to override _POST data
|
* @param array<mixed> $data data array to override _POST data
|
||||||
* @return int|false primary key
|
* @return int|false primary key
|
||||||
@@ -3240,7 +3240,7 @@ class IO
|
|||||||
public function dbWriteData(
|
public function dbWriteData(
|
||||||
array $write_array,
|
array $write_array,
|
||||||
array $not_write_array,
|
array $not_write_array,
|
||||||
int $primary_key,
|
?int $primary_key,
|
||||||
string $table,
|
string $table,
|
||||||
array $data = []
|
array $data = []
|
||||||
): int|false {
|
): int|false {
|
||||||
@@ -3260,19 +3260,19 @@ class IO
|
|||||||
* PARAM INFO: $primary key
|
* PARAM INFO: $primary key
|
||||||
* this can be a plain string/int and will be internal transformed into the array form
|
* this can be a plain string/int and will be internal transformed into the array form
|
||||||
* or it takes the array form of array [row => column, value => pk value]
|
* or it takes the array form of array [row => column, value => pk value]
|
||||||
* @param array<mixed> $write_array list of elements to write
|
* @param array<mixed> $write_array list of elements to write
|
||||||
* @param int|string|array<mixed> $primary_key primary key string or array set
|
* @param null|int|string|array<mixed> $primary_key primary key string or array set
|
||||||
* @param string $table name for the target table
|
* @param string $table name for the target table
|
||||||
* @param array<mixed> $not_write_array list of elements not to write (optional)
|
* @param array<mixed> $not_write_array list of elements not to write (optional)
|
||||||
* @param array<mixed> $not_write_update_array list of elements not
|
* @param array<mixed> $not_write_update_array list of elements not
|
||||||
* to write during update (optional)
|
* to write during update (optional)
|
||||||
* @param array<mixed> $data optional array with data
|
* @param array<mixed> $data optional array with data
|
||||||
* if not _POST vars are used
|
* if not _POST vars are used
|
||||||
* @return int|false primary key
|
* @return int|false primary key
|
||||||
*/
|
*/
|
||||||
public function dbWriteDataExt(
|
public function dbWriteDataExt(
|
||||||
array $write_array,
|
array $write_array,
|
||||||
int|string|array $primary_key,
|
null|int|string|array $primary_key,
|
||||||
string $table,
|
string $table,
|
||||||
array $not_write_array = [],
|
array $not_write_array = [],
|
||||||
array $not_write_update_array = [],
|
array $not_write_update_array = [],
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ use CoreLibs\Logging\Logger\MessageLevel;
|
|||||||
|
|
||||||
class ErrorMessage
|
class ErrorMessage
|
||||||
{
|
{
|
||||||
/** @var array<int,array{id:string,level:string,str:string,target:string,highlight:string[]}> */
|
/** @var array<int,array{id:string,level:string,str:string,target:string,target_style:string,highlight:string[]}> */
|
||||||
private array $error_str = [];
|
private array $error_str = [];
|
||||||
/** @var \CoreLibs\Logging\Logging $log */
|
/** @var \CoreLibs\Logging\Logging $log */
|
||||||
public \CoreLibs\Logging\Logging $log;
|
public \CoreLibs\Logging\Logging $log;
|
||||||
@@ -42,6 +42,7 @@ class ErrorMessage
|
|||||||
* error_id: internal Error ID (should be unique)
|
* error_id: internal Error ID (should be unique)
|
||||||
* level: error level, can only be ok, info, warn, error, abort, crash
|
* level: error level, can only be ok, info, warn, error, abort, crash
|
||||||
* ok and info are positive response: success
|
* ok and info are positive response: success
|
||||||
|
* notice: a debug message for information only
|
||||||
* warn: success, but there might be some things that are not 100% ok
|
* warn: success, but there might be some things that are not 100% ok
|
||||||
* error: input error or error in executing request
|
* error: input error or error in executing request
|
||||||
* abort: an internal error happened as mandatory information that normally is
|
* abort: an internal error happened as mandatory information that normally is
|
||||||
@@ -52,23 +53,28 @@ class ErrorMessage
|
|||||||
* not set: unkown, will be logged as "emergency"
|
* not set: unkown, will be logged as "emergency"
|
||||||
* target/highlight: id target name for frontend where to attach this message
|
* target/highlight: id target name for frontend where to attach this message
|
||||||
* highlight is a list of other target points to highlight
|
* highlight is a list of other target points to highlight
|
||||||
|
* for highlight targets css names are $level without a prefix and should be
|
||||||
|
* nested in the target element "input .error { ... }"
|
||||||
|
* target_style: if not set uses 'error-' $level as css style. applies to targets or main only
|
||||||
*
|
*
|
||||||
* @param string $error_id Any internal error ID for this error
|
* @param string $error_id Any internal error ID for this error
|
||||||
* @param string $level Error level in ok/info/warn/error
|
* @param string $level Error level in ok/info/warn/error
|
||||||
* @param string $str Error message (out)
|
* @param string $str Error message (out)
|
||||||
* @param string $target alternate attachment point for this error message
|
* @param string $target alternate attachment point for this error message
|
||||||
* @param array<string> $highlight Any additional error data as error OR
|
* @param string $target_style Alternate color style for the error message
|
||||||
* highlight points for field highlights
|
* @param array<string> $highlight Any additional error data as error OR
|
||||||
* @param string|null $message If abort/crash, non localized $str
|
* highlight points for field highlights
|
||||||
* @param array<mixed> $context Additionl info for abort/crash messages
|
* @param string|null $message If abort/crash, non localized $str
|
||||||
* @param bool|null $log_error [=null] log level 'error' to error, if null use global,
|
* @param array<mixed> $context Additionl info for abort/crash messages
|
||||||
* else set for this call only
|
* @param bool|null $log_error [=null] log level 'error' to error, if null use global,
|
||||||
|
* else set for this call only
|
||||||
*/
|
*/
|
||||||
public function setErrorMsg(
|
public function setErrorMsg(
|
||||||
string $error_id,
|
string $error_id,
|
||||||
string $level,
|
string $level,
|
||||||
string $str,
|
string $str,
|
||||||
string $target = '',
|
string $target = '',
|
||||||
|
string $target_style = '',
|
||||||
array $highlight = [],
|
array $highlight = [],
|
||||||
?string $message = null,
|
?string $message = null,
|
||||||
array $context = [],
|
array $context = [],
|
||||||
@@ -88,10 +94,17 @@ class ErrorMessage
|
|||||||
'level' => $level,
|
'level' => $level,
|
||||||
'str' => $str,
|
'str' => $str,
|
||||||
'target' => $target,
|
'target' => $target,
|
||||||
|
'target_style' => $target_style,
|
||||||
'highlight' => $highlight,
|
'highlight' => $highlight,
|
||||||
];
|
];
|
||||||
// write to log for abort/crash
|
// write to log for abort/crash
|
||||||
switch ($level) {
|
switch ($level) {
|
||||||
|
case 'notice':
|
||||||
|
$this->log->notice($message ?? $str, array_merge([
|
||||||
|
'id' => $error_id,
|
||||||
|
'level' => $original_level,
|
||||||
|
], $context));
|
||||||
|
break;
|
||||||
case 'error':
|
case 'error':
|
||||||
if ($log_error) {
|
if ($log_error) {
|
||||||
$this->log->error($message ?? $str, array_merge([
|
$this->log->error($message ?? $str, array_merge([
|
||||||
@@ -126,28 +139,40 @@ class ErrorMessage
|
|||||||
* Note, the parameter order is different and does not need an error id
|
* Note, the parameter order is different and does not need an error id
|
||||||
* This is for backend alerts
|
* This is for backend alerts
|
||||||
*
|
*
|
||||||
* @param string $level error level (ok/warn/info/error)
|
* @param string $level error level (ok/warn/info/error)
|
||||||
* @param string $str error string
|
* @param string $str error string
|
||||||
* @param string|null $error_id optional error id for precise error lookup
|
* @param string|null $error_id optional error id for precise error lookup
|
||||||
* @param string $target Alternate id name for output target on frontend
|
* @param string $target Alternate id name for output target on frontend
|
||||||
* @param array<string> $highlight Any additional error data as error OR
|
* @param string $target_style Alternate color style for the error message
|
||||||
* highlight points for field highlights
|
* @param array<string> $highlight Any additional error data as error OR
|
||||||
* @param string|null $message If abort/crash, non localized $str
|
* highlight points for field highlights
|
||||||
* @param array<mixed> $context Additionl info for abort/crash messages
|
* @param string|null $message If abort/crash, non localized $str
|
||||||
* @param bool|null $log_error [=null] log level 'error' to error, if null use global,
|
* @param array<mixed> $context Additionl info for abort/crash messages
|
||||||
* else set for this call only
|
* @param bool|null $log_error [=null] log level 'error' to error, if null use global,
|
||||||
|
* else set for this call only
|
||||||
*/
|
*/
|
||||||
public function setMessage(
|
public function setMessage(
|
||||||
string $level,
|
string $level,
|
||||||
string $str,
|
string $str,
|
||||||
?string $error_id = null,
|
?string $error_id = null,
|
||||||
string $target = '',
|
string $target = '',
|
||||||
|
string $target_style = '',
|
||||||
array $highlight = [],
|
array $highlight = [],
|
||||||
?string $message = null,
|
?string $message = null,
|
||||||
array $context = [],
|
array $context = [],
|
||||||
?bool $log_error = null,
|
?bool $log_error = null,
|
||||||
): void {
|
): void {
|
||||||
$this->setErrorMsg($error_id ?? '', $level, $str, $target, $highlight, $message, $context, $log_error);
|
$this->setErrorMsg(
|
||||||
|
$error_id ?? '',
|
||||||
|
$level,
|
||||||
|
$str,
|
||||||
|
$target,
|
||||||
|
$target_style,
|
||||||
|
$highlight,
|
||||||
|
$message,
|
||||||
|
$context,
|
||||||
|
$log_error
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// *********************************************************************
|
// *********************************************************************
|
||||||
@@ -178,7 +203,7 @@ class ErrorMessage
|
|||||||
* Gets the LAST entry in the array list.
|
* Gets the LAST entry in the array list.
|
||||||
* If nothing found returns empty array set
|
* If nothing found returns empty array set
|
||||||
*
|
*
|
||||||
* @return array{id:string,level:string,str:string,target:string,highlight:string[]} Error block
|
* @return array{id:string,level:string,str:string,target:string,target:string,highlight:string[]} Error block
|
||||||
*/
|
*/
|
||||||
public function getLastErrorMsg(): array
|
public function getLastErrorMsg(): array
|
||||||
{
|
{
|
||||||
@@ -187,6 +212,7 @@ class ErrorMessage
|
|||||||
'str' => '',
|
'str' => '',
|
||||||
'id' => '',
|
'id' => '',
|
||||||
'target' => '',
|
'target' => '',
|
||||||
|
'target_string' => '',
|
||||||
'highlight' => [],
|
'highlight' => [],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ enum MessageLevel: int
|
|||||||
{
|
{
|
||||||
case ok = 100;
|
case ok = 100;
|
||||||
case info = 200;
|
case info = 200;
|
||||||
|
case notice = 250;
|
||||||
case warn = 300;
|
case warn = 300;
|
||||||
case error = 400;
|
case error = 400;
|
||||||
case abort = 500;
|
case abort = 500;
|
||||||
@@ -30,6 +31,7 @@ enum MessageLevel: int
|
|||||||
return match (strtolower($name)) {
|
return match (strtolower($name)) {
|
||||||
'ok' => self::ok,
|
'ok' => self::ok,
|
||||||
'info' => self::info,
|
'info' => self::info,
|
||||||
|
'notice' => self::notice,
|
||||||
'warn', 'warning' => self::warn,
|
'warn', 'warning' => self::warn,
|
||||||
'error' => self::error,
|
'error' => self::error,
|
||||||
'abort' => self::abort,
|
'abort' => self::abort,
|
||||||
|
|||||||
40
www/lib/CoreLibs/Output/Form/TableArrays/EditOrder.php
Normal file
40
www/lib/CoreLibs/Output/Form/TableArrays/EditOrder.php
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace CoreLibs\Output\Form\TableArrays;
|
||||||
|
|
||||||
|
class EditOrder implements Interface\TableArraysInterface
|
||||||
|
{
|
||||||
|
/** @var \CoreLibs\Output\Form\Generate */
|
||||||
|
private \CoreLibs\Output\Form\Generate $form;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* constructor
|
||||||
|
* @param \CoreLibs\Output\Form\Generate $form base form class
|
||||||
|
*/
|
||||||
|
public function __construct(\CoreLibs\Output\Form\Generate $form)
|
||||||
|
{
|
||||||
|
$this->form = $form;
|
||||||
|
$this->form->log->debug('CLASS LOAD', __NAMESPACE__ . __CLASS__);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* NOTE: this is a dummy array to just init the Form\Generate class and is not used for anything else
|
||||||
|
*
|
||||||
|
* @return array<mixed>
|
||||||
|
*/
|
||||||
|
public function setTableArray(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'table_array' => [
|
||||||
|
'-'
|
||||||
|
],
|
||||||
|
'table_name' => '-',
|
||||||
|
'load_query' => '',
|
||||||
|
'show_fields' => [],
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// __END__
|
||||||
1
www/vendor/composer/autoload_classmap.php
vendored
1
www/vendor/composer/autoload_classmap.php
vendored
@@ -68,6 +68,7 @@ return array(
|
|||||||
'CoreLibs\\Output\\Form\\TableArrays\\EditGroups' => $baseDir . '/lib/CoreLibs/Output/Form/TableArrays/EditGroups.php',
|
'CoreLibs\\Output\\Form\\TableArrays\\EditGroups' => $baseDir . '/lib/CoreLibs/Output/Form/TableArrays/EditGroups.php',
|
||||||
'CoreLibs\\Output\\Form\\TableArrays\\EditLanguages' => $baseDir . '/lib/CoreLibs/Output/Form/TableArrays/EditLanguages.php',
|
'CoreLibs\\Output\\Form\\TableArrays\\EditLanguages' => $baseDir . '/lib/CoreLibs/Output/Form/TableArrays/EditLanguages.php',
|
||||||
'CoreLibs\\Output\\Form\\TableArrays\\EditMenuGroup' => $baseDir . '/lib/CoreLibs/Output/Form/TableArrays/EditMenuGroup.php',
|
'CoreLibs\\Output\\Form\\TableArrays\\EditMenuGroup' => $baseDir . '/lib/CoreLibs/Output/Form/TableArrays/EditMenuGroup.php',
|
||||||
|
'CoreLibs\\Output\\Form\\TableArrays\\EditOrder' => $baseDir . '/lib/CoreLibs/Output/Form/TableArrays/EditOrder.php',
|
||||||
'CoreLibs\\Output\\Form\\TableArrays\\EditPages' => $baseDir . '/lib/CoreLibs/Output/Form/TableArrays/EditPages.php',
|
'CoreLibs\\Output\\Form\\TableArrays\\EditPages' => $baseDir . '/lib/CoreLibs/Output/Form/TableArrays/EditPages.php',
|
||||||
'CoreLibs\\Output\\Form\\TableArrays\\EditSchemas' => $baseDir . '/lib/CoreLibs/Output/Form/TableArrays/EditSchemas.php',
|
'CoreLibs\\Output\\Form\\TableArrays\\EditSchemas' => $baseDir . '/lib/CoreLibs/Output/Form/TableArrays/EditSchemas.php',
|
||||||
'CoreLibs\\Output\\Form\\TableArrays\\EditUsers' => $baseDir . '/lib/CoreLibs/Output/Form/TableArrays/EditUsers.php',
|
'CoreLibs\\Output\\Form\\TableArrays\\EditUsers' => $baseDir . '/lib/CoreLibs/Output/Form/TableArrays/EditUsers.php',
|
||||||
|
|||||||
1
www/vendor/composer/autoload_static.php
vendored
1
www/vendor/composer/autoload_static.php
vendored
@@ -119,6 +119,7 @@ class ComposerStaticInit10fe8fe2ec4017b8644d2b64bcf398b9
|
|||||||
'CoreLibs\\Output\\Form\\TableArrays\\EditGroups' => __DIR__ . '/../..' . '/lib/CoreLibs/Output/Form/TableArrays/EditGroups.php',
|
'CoreLibs\\Output\\Form\\TableArrays\\EditGroups' => __DIR__ . '/../..' . '/lib/CoreLibs/Output/Form/TableArrays/EditGroups.php',
|
||||||
'CoreLibs\\Output\\Form\\TableArrays\\EditLanguages' => __DIR__ . '/../..' . '/lib/CoreLibs/Output/Form/TableArrays/EditLanguages.php',
|
'CoreLibs\\Output\\Form\\TableArrays\\EditLanguages' => __DIR__ . '/../..' . '/lib/CoreLibs/Output/Form/TableArrays/EditLanguages.php',
|
||||||
'CoreLibs\\Output\\Form\\TableArrays\\EditMenuGroup' => __DIR__ . '/../..' . '/lib/CoreLibs/Output/Form/TableArrays/EditMenuGroup.php',
|
'CoreLibs\\Output\\Form\\TableArrays\\EditMenuGroup' => __DIR__ . '/../..' . '/lib/CoreLibs/Output/Form/TableArrays/EditMenuGroup.php',
|
||||||
|
'CoreLibs\\Output\\Form\\TableArrays\\EditOrder' => __DIR__ . '/../..' . '/lib/CoreLibs/Output/Form/TableArrays/EditOrder.php',
|
||||||
'CoreLibs\\Output\\Form\\TableArrays\\EditPages' => __DIR__ . '/../..' . '/lib/CoreLibs/Output/Form/TableArrays/EditPages.php',
|
'CoreLibs\\Output\\Form\\TableArrays\\EditPages' => __DIR__ . '/../..' . '/lib/CoreLibs/Output/Form/TableArrays/EditPages.php',
|
||||||
'CoreLibs\\Output\\Form\\TableArrays\\EditSchemas' => __DIR__ . '/../..' . '/lib/CoreLibs/Output/Form/TableArrays/EditSchemas.php',
|
'CoreLibs\\Output\\Form\\TableArrays\\EditSchemas' => __DIR__ . '/../..' . '/lib/CoreLibs/Output/Form/TableArrays/EditSchemas.php',
|
||||||
'CoreLibs\\Output\\Form\\TableArrays\\EditUsers' => __DIR__ . '/../..' . '/lib/CoreLibs/Output/Form/TableArrays/EditUsers.php',
|
'CoreLibs\\Output\\Form\\TableArrays\\EditUsers' => __DIR__ . '/../..' . '/lib/CoreLibs/Output/Form/TableArrays/EditUsers.php',
|
||||||
|
|||||||
Reference in New Issue
Block a user