From 861fcf389011d6afd554b9f73e350142e41e0ac0 Mon Sep 17 00:00:00 2001 From: Saw-jan Date: Fri, 13 Feb 2026 14:11:39 +0545 Subject: [PATCH 1/2] fix: do not analyze server files Signed-off-by: Saw-jan --- .gitignore | 3 +++ bootstrap.php | 19 ++++++------------- psalm.xml | 1 + 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/.gitignore b/.gitignore index a4b5fff19..4288a84f9 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,6 @@ compose.override.yaml !dev/.env dev/apps dev/certs + +# server files +server/ \ No newline at end of file diff --git a/bootstrap.php b/bootstrap.php index a4e90b847..f58ac3f5c 100644 --- a/bootstrap.php +++ b/bootstrap.php @@ -9,26 +9,19 @@ use Composer\Autoload\ClassLoader; include_once __DIR__.'/vendor/autoload.php'; -if (getenv('SERVER_PATH')) { - $serverPath = getenv('SERVER_PATH'); -} elseif (file_exists(__DIR__ . '/server')) { - $serverPath = __DIR__ . '/server'; -} else { - $serverPath = __DIR__ . '/../..'; +$serverPath = __DIR__ . '/server'; + +if (!file_exists($serverPath)) { + throw new RuntimeException('Server path not found: ' . $serverPath); } + include_once $serverPath.'/3rdparty/autoload.php'; require_once $serverPath. '/lib/base.php'; $classLoader = new ClassLoader(); -$classLoader->addPsr4("OCA\\OpenProject\\", __DIR__ . '/lib', true); -$classLoader->addPsr4("OCA\\OpenProject\\Service\\", __DIR__ . '/lib/Service', true); -$classLoader->addPsr4("OCA\\OpenProject\\Settings\\", __DIR__ . '/lib/Settings', true); $classLoader->addPsr4("OCP\\", $serverPath . '/lib/public', true); $classLoader->addPsr4("OC\\", $serverPath . '/lib/private', true); -$classLoader->addPsr4("OCA\\Files\\Event\\", $serverPath . '/apps/files/lib/Event', true); -$classLoader->addPsr4("OCA\\OpenProject\\AppInfo\\", __DIR__ . '/lib/AppInfo', true); -$classLoader->addPsr4("OCA\\OpenProject\\Controller\\", __DIR__ . '/lib/Controller', true); -$classLoader->addPsr4("OCA\\OpenProject\\Exception\\", __DIR__ . '/lib/Exception', true); +$classLoader->addPsr4("OCA\\Files\\", $serverPath . '/apps/files/lib', true); $classLoader->register(); set_include_path(get_include_path() . PATH_SEPARATOR . '/usr/share/php'); diff --git a/psalm.xml b/psalm.xml index 7e50d7561..5e6d4075f 100644 --- a/psalm.xml +++ b/psalm.xml @@ -20,6 +20,7 @@ + From 5540bbccad2bfbab9959c51d8c4d432f8fcf98ff Mon Sep 17 00:00:00 2001 From: Saw-jan Date: Fri, 13 Feb 2026 14:34:16 +0545 Subject: [PATCH 2/2] fix: add fallback server path Signed-off-by: Saw-jan --- .github/workflows/shared_workflow.yml | 2 +- bootstrap.php | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/shared_workflow.yml b/.github/workflows/shared_workflow.yml index 901d0ffa9..030f0f54a 100644 --- a/.github/workflows/shared_workflow.yml +++ b/.github/workflows/shared_workflow.yml @@ -229,7 +229,7 @@ jobs: make psalm make phpcs || ( echo 'Please run `make phpcs-fix` to format your code' && exit 1 ) - - name: Copy dependent apps + - name: Setup dependent apps run: | composer install --no-dev --no-interaction --prefer-dist --optimize-autoloader --working-dir=../activity cp -r ../activity server/apps diff --git a/bootstrap.php b/bootstrap.php index f58ac3f5c..e26ec3bcb 100644 --- a/bootstrap.php +++ b/bootstrap.php @@ -11,7 +11,10 @@ include_once __DIR__.'/vendor/autoload.php'; $serverPath = __DIR__ . '/server'; -if (!file_exists($serverPath)) { +if (!file_exists($serverPath . '/lib/base.php')) { + $serverPath = __DIR__ . '/../..'; +} +if (!file_exists($serverPath . '/lib/base.php')) { throw new RuntimeException('Server path not found: ' . $serverPath); } @@ -19,6 +22,7 @@ require_once $serverPath. '/lib/base.php'; $classLoader = new ClassLoader(); +$classLoader->addPsr4("OCA\\OpenProject\\", __DIR__ . '/lib', true); $classLoader->addPsr4("OCP\\", $serverPath . '/lib/public', true); $classLoader->addPsr4("OC\\", $serverPath . '/lib/private', true); $classLoader->addPsr4("OCA\\Files\\", $serverPath . '/apps/files/lib', true);