mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-14 15:38:40 +00:00
visual fixes and alignments
This commit is contained in:
parent
b66feafa7e
commit
49133a58f6
|
|
@ -29,8 +29,6 @@ use phpOMS\Stdlib\Base\Enum;
|
||||||
abstract class GroupStatus extends Enum
|
abstract class GroupStatus extends Enum
|
||||||
{
|
{
|
||||||
/* public */ const ACTIVE = 1;
|
/* public */ const ACTIVE = 1;
|
||||||
|
|
||||||
/* public */ const INACTIVE = 2;
|
/* public */ const INACTIVE = 2;
|
||||||
|
|
||||||
/* public */ const HIDDEN = 4;
|
/* public */ const HIDDEN = 4;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1164,6 +1164,7 @@ class DataMapperAbstract implements DataMapperInterface
|
||||||
public static function update($obj, int $relations = RelationType::ALL) : int
|
public static function update($obj, int $relations = RelationType::ALL) : int
|
||||||
{
|
{
|
||||||
self::extend(__CLASS__);
|
self::extend(__CLASS__);
|
||||||
|
|
||||||
$reflectionClass = new \ReflectionClass(get_class($obj));
|
$reflectionClass = new \ReflectionClass(get_class($obj));
|
||||||
$objId = self::getObjectId($obj, $reflectionClass);
|
$objId = self::getObjectId($obj, $reflectionClass);
|
||||||
$update = true;
|
$update = true;
|
||||||
|
|
@ -1373,6 +1374,7 @@ class DataMapperAbstract implements DataMapperInterface
|
||||||
public static function delete($obj, int $relations = RelationType::REFERENCE)
|
public static function delete($obj, int $relations = RelationType::REFERENCE)
|
||||||
{
|
{
|
||||||
self::extend(__CLASS__);
|
self::extend(__CLASS__);
|
||||||
|
|
||||||
$reflectionClass = new \ReflectionClass(get_class($obj));
|
$reflectionClass = new \ReflectionClass(get_class($obj));
|
||||||
$objId = self::getObjectId($obj, $reflectionClass);
|
$objId = self::getObjectId($obj, $reflectionClass);
|
||||||
|
|
||||||
|
|
@ -1523,6 +1525,7 @@ class DataMapperAbstract implements DataMapperInterface
|
||||||
/** @var DataMapperAbstract $mapper */
|
/** @var DataMapperAbstract $mapper */
|
||||||
$mapper = static::$hasMany[$member]['mapper'];
|
$mapper = static::$hasMany[$member]['mapper'];
|
||||||
$values = array_diff($values, array_keys(self::$initObjects[$mapper] ?? []));
|
$values = array_diff($values, array_keys(self::$initObjects[$mapper] ?? []));
|
||||||
|
|
||||||
if(empty($values)) {
|
if(empty($values)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -111,10 +111,10 @@ class Header extends HeaderAbstract
|
||||||
*/
|
*/
|
||||||
private function isSecurityHeader(string $key) : bool
|
private function isSecurityHeader(string $key) : bool
|
||||||
{
|
{
|
||||||
return $key === 'content-security-policy' ||
|
return $key === 'content-security-policy'
|
||||||
$key === 'x-xss-protection' ||
|
|| $key === 'x-xss-protection'
|
||||||
$key === 'x-content-type-options' ||
|
|| $key === 'x-content-type-options'
|
||||||
$key === 'x-frame-options';
|
|| $key === 'x-frame-options';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -330,6 +330,7 @@ class Request extends RequestAbstract
|
||||||
if (!isset($this->os)) {
|
if (!isset($this->os)) {
|
||||||
$arr = OSType::getConstants();
|
$arr = OSType::getConstants();
|
||||||
$http_request_type = strtolower($_SERVER['HTTP_USER_AGENT']);
|
$http_request_type = strtolower($_SERVER['HTTP_USER_AGENT']);
|
||||||
|
|
||||||
foreach ($arr as $key => $val) {
|
foreach ($arr as $key => $val) {
|
||||||
if (stripos($http_request_type, $val)) {
|
if (stripos($http_request_type, $val)) {
|
||||||
$this->os = $val;
|
$this->os = $val;
|
||||||
|
|
|
||||||
|
|
@ -29,112 +29,58 @@ use phpOMS\Stdlib\Base\Enum;
|
||||||
abstract class RequestStatus extends Enum
|
abstract class RequestStatus extends Enum
|
||||||
{
|
{
|
||||||
/* public */ const R_100 = 'Continue';
|
/* public */ const R_100 = 'Continue';
|
||||||
|
|
||||||
/* public */ const R_101 = 'Switching Protocols';
|
/* public */ const R_101 = 'Switching Protocols';
|
||||||
|
|
||||||
/* public */ const R_102 = 'Processing';
|
/* public */ const R_102 = 'Processing';
|
||||||
|
|
||||||
/* public */ const R_200 = 'OK';
|
/* public */ const R_200 = 'OK';
|
||||||
|
|
||||||
/* public */ const R_201 = 'Created';
|
/* public */ const R_201 = 'Created';
|
||||||
|
|
||||||
/* public */ const R_202 = 'Accepted';
|
/* public */ const R_202 = 'Accepted';
|
||||||
|
|
||||||
/* public */ const R_203 = 'Non-Authoritative Information';
|
/* public */ const R_203 = 'Non-Authoritative Information';
|
||||||
|
|
||||||
/* public */ const R_204 = 'No Content';
|
/* public */ const R_204 = 'No Content';
|
||||||
|
|
||||||
/* public */ const R_205 = 'Reset Content';
|
/* public */ const R_205 = 'Reset Content';
|
||||||
|
|
||||||
/* public */ const R_206 = 'Partial Content';
|
/* public */ const R_206 = 'Partial Content';
|
||||||
|
|
||||||
/* public */ const R_207 = 'Multi-Status';
|
/* public */ const R_207 = 'Multi-Status';
|
||||||
|
|
||||||
/* public */ const R_300 = 'Multiple Choices';
|
/* public */ const R_300 = 'Multiple Choices';
|
||||||
|
|
||||||
/* public */ const R_301 = 'Moved Permanently';
|
/* public */ const R_301 = 'Moved Permanently';
|
||||||
|
|
||||||
/* public */ const R_302 = 'Found';
|
/* public */ const R_302 = 'Found';
|
||||||
|
|
||||||
/* public */ const R_303 = 'See Other';
|
/* public */ const R_303 = 'See Other';
|
||||||
|
|
||||||
/* public */ const R_304 = 'Not Modified';
|
/* public */ const R_304 = 'Not Modified';
|
||||||
|
|
||||||
/* public */ const R_305 = 'Use Proxy';
|
/* public */ const R_305 = 'Use Proxy';
|
||||||
|
|
||||||
/* public */ const R_306 = 'Switch Proxy';
|
/* public */ const R_306 = 'Switch Proxy';
|
||||||
|
|
||||||
/* public */ const R_307 = 'Temporary Redirect';
|
/* public */ const R_307 = 'Temporary Redirect';
|
||||||
|
|
||||||
/* public */ const R_400 = 'Bad Request';
|
/* public */ const R_400 = 'Bad Request';
|
||||||
|
|
||||||
/* public */ const R_401 = 'Unauthorized';
|
/* public */ const R_401 = 'Unauthorized';
|
||||||
|
|
||||||
/* public */ const R_402 = 'Payment Required';
|
/* public */ const R_402 = 'Payment Required';
|
||||||
|
|
||||||
/* public */ const R_403 = 'Forbidden';
|
/* public */ const R_403 = 'Forbidden';
|
||||||
|
|
||||||
/* public */ const R_404 = 'Not Found';
|
/* public */ const R_404 = 'Not Found';
|
||||||
|
|
||||||
/* public */ const R_405 = 'Method Not Allowed';
|
/* public */ const R_405 = 'Method Not Allowed';
|
||||||
|
|
||||||
/* public */ const R_406 = 'Not Acceptable';
|
/* public */ const R_406 = 'Not Acceptable';
|
||||||
|
|
||||||
/* public */ const R_407 = 'Proxy Authentication Required';
|
/* public */ const R_407 = 'Proxy Authentication Required';
|
||||||
|
|
||||||
/* public */ const R_408 = 'Request Timeout';
|
/* public */ const R_408 = 'Request Timeout';
|
||||||
|
|
||||||
/* public */ const R_409 = 'Conflict';
|
/* public */ const R_409 = 'Conflict';
|
||||||
|
|
||||||
/* public */ const R_410 = 'Gone';
|
/* public */ const R_410 = 'Gone';
|
||||||
|
|
||||||
/* public */ const R_411 = 'Length Required';
|
/* public */ const R_411 = 'Length Required';
|
||||||
|
|
||||||
/* public */ const R_412 = 'Precondition Failed';
|
/* public */ const R_412 = 'Precondition Failed';
|
||||||
|
|
||||||
/* public */ const R_413 = 'Request Entity Too Large';
|
/* public */ const R_413 = 'Request Entity Too Large';
|
||||||
|
|
||||||
/* public */ const R_414 = 'Request-URI Too Long';
|
/* public */ const R_414 = 'Request-URI Too Long';
|
||||||
|
|
||||||
/* public */ const R_415 = 'Unsupported Media Type';
|
/* public */ const R_415 = 'Unsupported Media Type';
|
||||||
|
|
||||||
/* public */ const R_416 = 'Requested Range Not Satisfiable';
|
/* public */ const R_416 = 'Requested Range Not Satisfiable';
|
||||||
|
|
||||||
/* public */ const R_417 = 'Expectation Failed';
|
/* public */ const R_417 = 'Expectation Failed';
|
||||||
|
|
||||||
/* public */ const R_418 = 'I\'m a teapot';
|
/* public */ const R_418 = 'I\'m a teapot';
|
||||||
|
|
||||||
/* public */ const R_422 = 'Unprocessable Entity';
|
/* public */ const R_422 = 'Unprocessable Entity';
|
||||||
|
|
||||||
/* public */ const R_423 = 'Locked';
|
/* public */ const R_423 = 'Locked';
|
||||||
|
|
||||||
/* public */ const R_424 = 'Failed Dependency';
|
/* public */ const R_424 = 'Failed Dependency';
|
||||||
|
|
||||||
/* public */ const R_425 = 'Unordered Collection';
|
/* public */ const R_425 = 'Unordered Collection';
|
||||||
|
|
||||||
/* public */ const R_426 = 'Upgrade Required';
|
/* public */ const R_426 = 'Upgrade Required';
|
||||||
|
|
||||||
/* public */ const R_449 = 'Retry With';
|
/* public */ const R_449 = 'Retry With';
|
||||||
|
|
||||||
/* public */ const R_450 = 'Blocked by Windows Parental Controls';
|
/* public */ const R_450 = 'Blocked by Windows Parental Controls';
|
||||||
|
|
||||||
/* public */ const R_500 = 'Internal Server Error';
|
/* public */ const R_500 = 'Internal Server Error';
|
||||||
|
|
||||||
/* public */ const R_501 = 'Not Implemented';
|
/* public */ const R_501 = 'Not Implemented';
|
||||||
|
|
||||||
/* public */ const R_502 = 'Bad Gateway';
|
/* public */ const R_502 = 'Bad Gateway';
|
||||||
|
|
||||||
/* public */ const R_503 = 'Service Unavailable';
|
/* public */ const R_503 = 'Service Unavailable';
|
||||||
|
|
||||||
/* public */ const R_504 = 'Gateway Timeout';
|
/* public */ const R_504 = 'Gateway Timeout';
|
||||||
|
|
||||||
/* public */ const R_505 = 'HTTP Version Not Supported';
|
/* public */ const R_505 = 'HTTP Version Not Supported';
|
||||||
|
|
||||||
/* public */ const R_506 = 'Variant Also Negotiates';
|
/* public */ const R_506 = 'Variant Also Negotiates';
|
||||||
|
|
||||||
/* public */ const R_507 = 'Insufficient Storage';
|
/* public */ const R_507 = 'Insufficient Storage';
|
||||||
|
|
||||||
/* public */ const R_509 = 'Bandwidth Limit Exceeded';
|
/* public */ const R_509 = 'Bandwidth Limit Exceeded';
|
||||||
|
|
||||||
/* public */ const R_510 = 'Not Extended';
|
/* public */ const R_510 = 'Not Extended';
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,112 +28,58 @@ use phpOMS\Stdlib\Base\Enum;
|
||||||
abstract class RequestStatusCode extends Enum
|
abstract class RequestStatusCode extends Enum
|
||||||
{
|
{
|
||||||
/* public */ const R_100 = 100;
|
/* public */ const R_100 = 100;
|
||||||
|
|
||||||
/* public */ const R_101 = 101;
|
/* public */ const R_101 = 101;
|
||||||
|
|
||||||
/* public */ const R_102 = 102;
|
/* public */ const R_102 = 102;
|
||||||
|
|
||||||
/* public */ const R_200 = 200;
|
/* public */ const R_200 = 200;
|
||||||
|
|
||||||
/* public */ const R_201 = 201;
|
/* public */ const R_201 = 201;
|
||||||
|
|
||||||
/* public */ const R_202 = 202;
|
/* public */ const R_202 = 202;
|
||||||
|
|
||||||
/* public */ const R_203 = 203;
|
/* public */ const R_203 = 203;
|
||||||
|
|
||||||
/* public */ const R_204 = 204;
|
/* public */ const R_204 = 204;
|
||||||
|
|
||||||
/* public */ const R_205 = 205;
|
/* public */ const R_205 = 205;
|
||||||
|
|
||||||
/* public */ const R_206 = 206;
|
/* public */ const R_206 = 206;
|
||||||
|
|
||||||
/* public */ const R_207 = 207;
|
/* public */ const R_207 = 207;
|
||||||
|
|
||||||
/* public */ const R_300 = 300;
|
/* public */ const R_300 = 300;
|
||||||
|
|
||||||
/* public */ const R_301 = 301;
|
/* public */ const R_301 = 301;
|
||||||
|
|
||||||
/* public */ const R_302 = 302;
|
/* public */ const R_302 = 302;
|
||||||
|
|
||||||
/* public */ const R_303 = 303;
|
/* public */ const R_303 = 303;
|
||||||
|
|
||||||
/* public */ const R_304 = 304;
|
/* public */ const R_304 = 304;
|
||||||
|
|
||||||
/* public */ const R_305 = 305;
|
/* public */ const R_305 = 305;
|
||||||
|
|
||||||
/* public */ const R_306 = 306;
|
/* public */ const R_306 = 306;
|
||||||
|
|
||||||
/* public */ const R_307 = 307;
|
/* public */ const R_307 = 307;
|
||||||
|
|
||||||
/* public */ const R_400 = 400;
|
/* public */ const R_400 = 400;
|
||||||
|
|
||||||
/* public */ const R_401 = 401;
|
/* public */ const R_401 = 401;
|
||||||
|
|
||||||
/* public */ const R_402 = 402;
|
/* public */ const R_402 = 402;
|
||||||
|
|
||||||
/* public */ const R_403 = 403;
|
/* public */ const R_403 = 403;
|
||||||
|
|
||||||
/* public */ const R_404 = 404;
|
/* public */ const R_404 = 404;
|
||||||
|
|
||||||
/* public */ const R_405 = 405;
|
/* public */ const R_405 = 405;
|
||||||
|
|
||||||
/* public */ const R_406 = 406;
|
/* public */ const R_406 = 406;
|
||||||
|
|
||||||
/* public */ const R_407 = 407;
|
/* public */ const R_407 = 407;
|
||||||
|
|
||||||
/* public */ const R_408 = 408;
|
/* public */ const R_408 = 408;
|
||||||
|
|
||||||
/* public */ const R_409 = 409;
|
/* public */ const R_409 = 409;
|
||||||
|
|
||||||
/* public */ const R_410 = 410;
|
/* public */ const R_410 = 410;
|
||||||
|
|
||||||
/* public */ const R_411 = 411;
|
/* public */ const R_411 = 411;
|
||||||
|
|
||||||
/* public */ const R_412 = 412;
|
/* public */ const R_412 = 412;
|
||||||
|
|
||||||
/* public */ const R_413 = 413;
|
/* public */ const R_413 = 413;
|
||||||
|
|
||||||
/* public */ const R_414 = 414;
|
/* public */ const R_414 = 414;
|
||||||
|
|
||||||
/* public */ const R_415 = 415;
|
/* public */ const R_415 = 415;
|
||||||
|
|
||||||
/* public */ const R_416 = 416;
|
/* public */ const R_416 = 416;
|
||||||
|
|
||||||
/* public */ const R_417 = 417;
|
/* public */ const R_417 = 417;
|
||||||
|
|
||||||
/* public */ const R_418 = 418;
|
/* public */ const R_418 = 418;
|
||||||
|
|
||||||
/* public */ const R_422 = 422;
|
/* public */ const R_422 = 422;
|
||||||
|
|
||||||
/* public */ const R_423 = 423;
|
/* public */ const R_423 = 423;
|
||||||
|
|
||||||
/* public */ const R_424 = 424;
|
/* public */ const R_424 = 424;
|
||||||
|
|
||||||
/* public */ const R_425 = 425;
|
/* public */ const R_425 = 425;
|
||||||
|
|
||||||
/* public */ const R_426 = 426;
|
/* public */ const R_426 = 426;
|
||||||
|
|
||||||
/* public */ const R_449 = 449;
|
/* public */ const R_449 = 449;
|
||||||
|
|
||||||
/* public */ const R_450 = 450;
|
/* public */ const R_450 = 450;
|
||||||
|
|
||||||
/* public */ const R_500 = 500;
|
/* public */ const R_500 = 500;
|
||||||
|
|
||||||
/* public */ const R_501 = 501;
|
/* public */ const R_501 = 501;
|
||||||
|
|
||||||
/* public */ const R_502 = 502;
|
/* public */ const R_502 = 502;
|
||||||
|
|
||||||
/* public */ const R_503 = 503;
|
/* public */ const R_503 = 503;
|
||||||
|
|
||||||
/* public */ const R_504 = 504;
|
/* public */ const R_504 = 504;
|
||||||
|
|
||||||
/* public */ const R_505 = 505;
|
/* public */ const R_505 = 505;
|
||||||
|
|
||||||
/* public */ const R_506 = 506;
|
/* public */ const R_506 = 506;
|
||||||
|
|
||||||
/* public */ const R_507 = 507;
|
/* public */ const R_507 = 507;
|
||||||
|
|
||||||
/* public */ const R_509 = 509;
|
/* public */ const R_509 = 509;
|
||||||
|
|
||||||
/* public */ const R_510 = 510;
|
/* public */ const R_510 = 510;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -117,8 +117,8 @@ class ModuleManager
|
||||||
public function getRoutedModules(Request $request) : array
|
public function getRoutedModules(Request $request) : array
|
||||||
{
|
{
|
||||||
$files = $this->getUriLoad($request);
|
$files = $this->getUriLoad($request);
|
||||||
|
|
||||||
$modules = [];
|
$modules = [];
|
||||||
|
|
||||||
if (isset($files[4])) {
|
if (isset($files[4])) {
|
||||||
foreach ($files[4] as $module) {
|
foreach ($files[4] as $module) {
|
||||||
$modules[] = $module['module_load_file'];
|
$modules[] = $module['module_load_file'];
|
||||||
|
|
@ -147,6 +147,7 @@ class ModuleManager
|
||||||
|
|
||||||
$i = 1;
|
$i = 1;
|
||||||
$c = count($uriHash);
|
$c = count($uriHash);
|
||||||
|
|
||||||
for ($k = 0; $k < $c; $k++) {
|
for ($k = 0; $k < $c; $k++) {
|
||||||
$uriPdo .= ':pid' . $i . ',';
|
$uriPdo .= ':pid' . $i . ',';
|
||||||
$i++;
|
$i++;
|
||||||
|
|
|
||||||
|
|
@ -294,6 +294,7 @@ class ArrayUtils
|
||||||
// see collection collapse as alternative?!
|
// see collection collapse as alternative?!
|
||||||
$flat = [];
|
$flat = [];
|
||||||
$stack = array_values($array);
|
$stack = array_values($array);
|
||||||
|
|
||||||
while (!empty($stack)) {
|
while (!empty($stack)) {
|
||||||
$value = array_shift($stack);
|
$value = array_shift($stack);
|
||||||
|
|
||||||
|
|
@ -322,7 +323,6 @@ class ArrayUtils
|
||||||
{
|
{
|
||||||
$count = $count === 0 ? count($array) : $start + $count;
|
$count = $count === 0 ? count($array) : $start + $count;
|
||||||
$sum = 0;
|
$sum = 0;
|
||||||
|
|
||||||
$array = array_values($array);
|
$array = array_values($array);
|
||||||
|
|
||||||
for ($i = $start; $i <= $count - 1; $i++) {
|
for ($i = $start; $i <= $count - 1; $i++) {
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,9 @@ class Permutation
|
||||||
$newArr = $toPermute;
|
$newArr = $toPermute;
|
||||||
$newres = $result;
|
$newres = $result;
|
||||||
$newres[] = $val;
|
$newres[] = $val;
|
||||||
|
|
||||||
unset($newArr[$key]);
|
unset($newArr[$key]);
|
||||||
|
|
||||||
$permutations = array_merge($permutations, self::permut($newArr, $newres));
|
$permutations = array_merge($permutations, self::permut($newArr, $newres));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -346,6 +346,15 @@ class StringUtils
|
||||||
return $count;
|
return $count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Calculate string entropy
|
||||||
|
*
|
||||||
|
* @param string $string String to analyze.
|
||||||
|
*
|
||||||
|
* @return float
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
public static function getEntropy(string $value) : float
|
public static function getEntropy(string $value) : float
|
||||||
{
|
{
|
||||||
$entroy = 0.0;
|
$entroy = 0.0;
|
||||||
|
|
@ -360,6 +369,15 @@ class StringUtils
|
||||||
return $entroy;
|
return $entroy;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Count chars of utf-8 string.
|
||||||
|
*
|
||||||
|
* @param string $string String to count chars.
|
||||||
|
*
|
||||||
|
* @return int
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
public static function mb_count_chars(string $input) {
|
public static function mb_count_chars(string $input) {
|
||||||
$l = mb_strlen($input, 'UTF-8');
|
$l = mb_strlen($input, 'UTF-8');
|
||||||
$unique = [];
|
$unique = [];
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user