From 3335fb129e8b6ec3e3cea0912824b4fdfec3d43d Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sun, 1 Oct 2023 20:41:26 +0000 Subject: [PATCH] fix setup and phpstan autoloader --- Config/phpstan_autoloader.php | 7 +++++-- Helper/Scripts/serverInstall.sh | 2 +- Inspection/Php/tests.sh | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Config/phpstan_autoloader.php b/Config/phpstan_autoloader.php index 1591239..8f3a133 100755 --- a/Config/phpstan_autoloader.php +++ b/Config/phpstan_autoloader.php @@ -39,6 +39,7 @@ function module_autoloader($class) { } } + // github and normal foreach ($paths as $path) { if (($file = \realpath($path . $class2 . '.php'))) { include_once $file; @@ -55,7 +56,7 @@ function module_autoloader($class) { } } - + // own server foreach ($paths as $path) { if (($file = \realpath($path . 'oms-' . $class2 . '.php'))) { include_once $file; @@ -72,7 +73,9 @@ function module_autoloader($class) { } } - $class = \str_replace('Modules/', '/', $class); + $paths[] = __DIR__ . '/../../src/Karaka/'; + + $class = \ltrim(\str_replace('Modules/', '/', $class), '/'); foreach ($paths as $path) { if (\is_file($file = $path . $class . '.php')) { include_once $file; diff --git a/Helper/Scripts/serverInstall.sh b/Helper/Scripts/serverInstall.sh index 5ddaa29..ddfb41f 100644 --- a/Helper/Scripts/serverInstall.sh +++ b/Helper/Scripts/serverInstall.sh @@ -10,7 +10,7 @@ export PROMPT_COMMAND='echo "$(date "+%Y-%m-%d.%H:%M:%S") $(pwd) $(history 1)" > apt-get update apt-get upgrade -apt-get install git git-lfs snapd ufw software-properties-common composer +apt-get install git git-lfs snapd ufw software-properties-common composer nodejs npm # Security diff --git a/Inspection/Php/tests.sh b/Inspection/Php/tests.sh index 9e27e42..ef8a996 100755 --- a/Inspection/Php/tests.sh +++ b/Inspection/Php/tests.sh @@ -12,7 +12,7 @@ echo "#################################################" echo "Start php static inspection" echo "#################################################" -php -d memory_limit=4G ${TOOLS_PATH}/vendor/bin/phpstan analyse --no-progress -l 9 -c ${BUILD_PATH}/Config/phpstan.neon ${INSPECTION_PATH} || true +php -dmemory_limit=4G ${TOOLS_PATH}/vendor/bin/phpstan analyse --error-format=prettyJson --no-progress -l 9 -c ${BUILD_PATH}/Config/phpstan.neon ${INSPECTION_PATH} > ${OUTPUT_PATH}/phpstan.json || true # Cli debugging # php -dzend_extension=xdebug.so -dxdebug.mode=debug -dxdebug.profiler_enable=1 \ No newline at end of file