From 36e5ee58303c6320fe832c1750844cad9fa9254e Mon Sep 17 00:00:00 2001 From: Yvo Brevoort Date: Mon, 5 Oct 2026 12:02:23 +0200 Subject: [PATCH 1/9] update php in CI; drop 8.1 and 8.2, add 8.4 update versions for pdsinterop packages pin sweetrdf to 1.15.0 as versions 1.16 to 1.19 have a breaking change --- .github/workflows/php.yml | 6 ++---- composer.json | 6 +++--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 9fb4410..c5158e7 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -76,9 +76,8 @@ jobs: fail-fast: false matrix: php: - - '8.1' # from 2021-11 to 2023-11 (2025-12) - - '8.2' # from 2022-12 to 2024-12 (2026-12) - '8.3' # from 2023-11 to 2025-12 (2027-12) + - '8.4' steps: - uses: actions/checkout@v4 - uses: shivammathur/setup-php@v2 @@ -138,9 +137,8 @@ jobs: fail-fast: false matrix: php: - - '8.1' # from 2021-11 to 2023-11 (2025-12) - - '8.2' # from 2022-12 to 2024-12 (2026-12) - '8.3' # from 2023-11 to 2025-12 (2027-12) + - '8.4' steps: - uses: actions/checkout@v4 - uses: docker://pipelinecomponents/php-codesniffer diff --git a/composer.json b/composer.json index b185bbb..2db3339 100644 --- a/composer.json +++ b/composer.json @@ -15,10 +15,10 @@ } ], "require": { - "pdsinterop/solid-auth": "v0.14.2", - "pdsinterop/solid-crud": "v0.8.5", + "pdsinterop/solid-auth": "v0.15", + "pdsinterop/solid-crud": "v0.9", "phpmailer/phpmailer": "^6.10", - "sweetrdf/easyrdf": "~1.15.0", + "sweetrdf/easyrdf": ">=1.15.0 <1.16.0", "phpseclib/bcmath_compat": "^2.0", "phrity/websocket": "^3.5" }, From b6dedab3f821cc576a13f5fdb29396c8948ef931 Mon Sep 17 00:00:00 2001 From: Yvo Brevoort Date: Tue, 6 Oct 2026 15:01:52 +0200 Subject: [PATCH 2/9] add EOL time --- .github/workflows/php.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index c5158e7..27b30b4 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -77,7 +77,7 @@ jobs: matrix: php: - '8.3' # from 2023-11 to 2025-12 (2027-12) - - '8.4' + - '8.4' # from 2024-11 to 2026-12 (2028-12) steps: - uses: actions/checkout@v4 - uses: shivammathur/setup-php@v2 @@ -138,7 +138,7 @@ jobs: matrix: php: - '8.3' # from 2023-11 to 2025-12 (2027-12) - - '8.4' + - '8.4' # from 2024-11 to 2026-12 (2028-12) steps: - uses: actions/checkout@v4 - uses: docker://pipelinecomponents/php-codesniffer From 28869e86da9f23a08077a3f691b9f58a5c4d191c Mon Sep 17 00:00:00 2001 From: Yvo Brevoort Date: Tue, 6 Oct 2026 15:08:21 +0200 Subject: [PATCH 3/9] typofix --- lib/User.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/User.php b/lib/User.php index 34ae5fe..2fcc1fa 100644 --- a/lib/User.php +++ b/lib/User.php @@ -99,7 +99,7 @@ public static function validatePasswordStrength($password) $entropy = PasswordValidator::getEntropy($password, BANNED_PASSWORDS); $minimumEntropy = MINIMUM_PASSWORD_ENTROPY; if ($entropy < $minimumEntropy) { - error_log("Entered pasword does not satisfy minimum entropy"); + error_log("Entered password does not satisfy minimum entropy"); return false; } return true; From fafcc05fbcd1c017d5abc50d082c72135d507360 Mon Sep 17 00:00:00 2001 From: Yvo Brevoort Date: Tue, 6 Oct 2026 15:10:43 +0200 Subject: [PATCH 4/9] update adapter for flysystem 3 --- lib/ProfileServer.php | 2 +- lib/StorageServer.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ProfileServer.php b/lib/ProfileServer.php index 7630524..ea44384 100644 --- a/lib/ProfileServer.php +++ b/lib/ProfileServer.php @@ -18,7 +18,7 @@ public static function getFileSystem() $profilePath = implode("/", str_split($profileId, 4)); } // The internal adapter - $adapter = new \League\Flysystem\Adapter\Local( + $adapter = new \League\Flysystem\Local\LocalFilesystemAdapter( // Determine root directory PROFILEBASE . $profilePath ); diff --git a/lib/StorageServer.php b/lib/StorageServer.php index 40aa5ae..2c1d281 100644 --- a/lib/StorageServer.php +++ b/lib/StorageServer.php @@ -114,7 +114,7 @@ public static function getFileSystem() } // The internal adapter - $adapter = new \League\Flysystem\Adapter\Local( + $adapter = new \League\Flysystem\Local\LocalFilesystemAdapter( // Determine root directory STORAGEBASE . "$storagePath/" ); From a74bcd753810d43baf7f305fb2490da64e0b7390 Mon Sep 17 00:00:00 2001 From: Yvo Brevoort Date: Tue, 6 Oct 2026 15:29:57 +0200 Subject: [PATCH 5/9] get/pass rdfAdapter --- lib/ProfileServer.php | 11 +++++----- lib/Routes/SolidStorage.php | 7 ++++--- lib/Routes/SolidUserProfile.php | 7 ++++--- lib/StorageServer.php | 32 ++++++++++++++--------------- tests/phpunit/StorageServerTest.php | 3 ++- 5 files changed, 32 insertions(+), 28 deletions(-) diff --git a/lib/ProfileServer.php b/lib/ProfileServer.php index ea44384..c6dc1f0 100644 --- a/lib/ProfileServer.php +++ b/lib/ProfileServer.php @@ -8,7 +8,7 @@ class ProfileServer extends Server { - public static function getFileSystem() + public static function getRdfAdapter() { $profileId = self::getProfileId(); @@ -17,6 +17,7 @@ public static function getFileSystem() } else { $profilePath = implode("/", str_split($profileId, 4)); } + // The internal adapter $adapter = new \League\Flysystem\Local\LocalFilesystemAdapter( // Determine root directory @@ -29,12 +30,12 @@ public static function getFileSystem() $serverUri = Util::getServerUri(); // Create the RDF Adapter - $rdfAdapter = new \Pdsinterop\Rdf\Flysystem\Adapter\Rdf($adapter, $graph, $formats, $serverUri); + return new \Pdsinterop\Rdf\Flysystem\Adapter\Rdf($adapter, $graph, $formats, $serverUri); + } + public static function getFileSystem($rdfAdapter) + { $filesystem = new \League\Flysystem\Filesystem($rdfAdapter); - $filesystem->addPlugin(new \Pdsinterop\Rdf\Flysystem\Plugin\AsMime($formats)); - $plugin = new \Pdsinterop\Rdf\Flysystem\Plugin\ReadRdf($graph); - $filesystem->addPlugin($plugin); return $filesystem; } diff --git a/lib/Routes/SolidStorage.php b/lib/Routes/SolidStorage.php index 8f942a8..7146817 100644 --- a/lib/Routes/SolidStorage.php +++ b/lib/Routes/SolidStorage.php @@ -21,7 +21,8 @@ public static function respondToStorage() try { StorageServer::initializeStorage(); - $filesystem = StorageServer::getFileSystem(); + $rdfAdapter = StorageServer::getRdfAdapter(); + $filesystem = StorageServer::getFileSystem($rdfAdapter); } catch (\Exception $e) { $response = new Response(); $response = $response->withStatus(404, "Not found"); @@ -29,11 +30,11 @@ public static function respondToStorage() exit(); } - $resourceServer = new ResourceServer($filesystem, new Response(), null); + $resourceServer = new ResourceServer($filesystem, $rdfAdapter, new Response(), null); $solidNotifications = new SolidNotifications(); $resourceServer->setNotifications($solidNotifications); - $wac = new WAC($filesystem); + $wac = new WAC($filesystem, $rdfAdapter); $baseUrl = Util::getServerBaseUrl(); $resourceServer->setBaseUrl($baseUrl); diff --git a/lib/Routes/SolidUserProfile.php b/lib/Routes/SolidUserProfile.php index d900458..8c14efa 100644 --- a/lib/Routes/SolidUserProfile.php +++ b/lib/Routes/SolidUserProfile.php @@ -20,13 +20,14 @@ public static function respondToProfile() $rawRequest = $requestFactory->fromGlobals($_SERVER, $_GET, $_POST, $_COOKIE, $_FILES); ProfileServer::initializeProfile(); - $filesystem = ProfileServer::getFileSystem(); + $rdfAdapter = ProfileServer::getRdfAdapter(); + $filesystem = ProfileServer::getFileSystem($rdfAdapter); - $resourceServer = new ResourceServer($filesystem, new Response(), null); + $resourceServer = new ResourceServer($filesystem, $rdfAdapter, new Response(), null); $solidNotifications = new SolidNotifications(); $resourceServer->setNotifications($solidNotifications); - $wac = new WAC($filesystem); + $wac = new WAC($filesystem, $rdfAdapter); $baseUrl = Util::getServerBaseUrl(); $resourceServer->setBaseUrl($baseUrl); diff --git a/lib/StorageServer.php b/lib/StorageServer.php index 2c1d281..614791b 100644 --- a/lib/StorageServer.php +++ b/lib/StorageServer.php @@ -101,8 +101,8 @@ public static function getOwnerWebId() return false; } - public static function getFileSystem() - { + public static function getRdfAdapter() + { $storageId = self::getStorageId(); if (!self::storageIdExists($storageId)) { throw new \Exception("Storage does not exist"); @@ -113,24 +113,24 @@ public static function getFileSystem() $storagePath = implode("/", str_split($storageId, 4)); } - // The internal adapter - $adapter = new \League\Flysystem\Local\LocalFilesystemAdapter( - // Determine root directory - STORAGEBASE . "$storagePath/" - ); + // The internal adapter + $adapter = new \League\Flysystem\Local\LocalFilesystemAdapter( + // Determine root directory + STORAGEBASE . "$storagePath/" + ); - $graph = new \EasyRdf\Graph(); - // Create Formats objects - $formats = new \Pdsinterop\Rdf\Formats(); - $serverUri = Util::getServerUri(); + $graph = new \EasyRdf\Graph(); + // Create Formats objects + $formats = new \Pdsinterop\Rdf\Formats(); + $serverUri = Util::getServerUri(); - // Create the RDF Adapter - $rdfAdapter = new \Pdsinterop\Rdf\Flysystem\Adapter\Rdf($adapter, $graph, $formats, $serverUri); + // Create the RDF Adapter + return new \Pdsinterop\Rdf\Flysystem\Adapter\Rdf($adapter, $graph, $formats, $serverUri); + } + public static function getFileSystem($rdfAdapter) + { $filesystem = new \League\Flysystem\Filesystem($rdfAdapter); - $filesystem->addPlugin(new \Pdsinterop\Rdf\Flysystem\Plugin\AsMime($formats)); - $plugin = new \Pdsinterop\Rdf\Flysystem\Plugin\ReadRdf($graph); - $filesystem->addPlugin($plugin); return $filesystem; } diff --git a/tests/phpunit/StorageServerTest.php b/tests/phpunit/StorageServerTest.php index c1c7fc7..22a057f 100644 --- a/tests/phpunit/StorageServerTest.php +++ b/tests/phpunit/StorageServerTest.php @@ -66,7 +66,8 @@ protected function setUp(): void public function testGetFileSystem() { - $filesystem = StorageServer::getFileSystem(); + $rdfAdapter = StorageServer::getRdfAdapter(); + $filesystem = StorageServer::getFileSystem($rdfAdapter); $this->assertInstanceOf('\League\Flysystem\Filesystem', $filesystem); } From 47e8bf1a339a42fb5a56192b0a5197cfc1ec75e9 Mon Sep 17 00:00:00 2001 From: Yvo Brevoort Date: Tue, 6 Oct 2026 15:33:05 +0200 Subject: [PATCH 6/9] whitespace --- lib/StorageServer.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/StorageServer.php b/lib/StorageServer.php index 614791b..d6eecfb 100644 --- a/lib/StorageServer.php +++ b/lib/StorageServer.php @@ -119,14 +119,14 @@ public static function getRdfAdapter() STORAGEBASE . "$storagePath/" ); - $graph = new \EasyRdf\Graph(); - // Create Formats objects - $formats = new \Pdsinterop\Rdf\Formats(); - $serverUri = Util::getServerUri(); - - // Create the RDF Adapter - return new \Pdsinterop\Rdf\Flysystem\Adapter\Rdf($adapter, $graph, $formats, $serverUri); - } + $graph = new \EasyRdf\Graph(); + // Create Formats objects + $formats = new \Pdsinterop\Rdf\Formats(); + $serverUri = Util::getServerUri(); + + // Create the RDF Adapter + return new \Pdsinterop\Rdf\Flysystem\Adapter\Rdf($adapter, $graph, $formats, $serverUri); + } public static function getFileSystem($rdfAdapter) { From d9ef3dc14cf6155d1197712d9c84c7a42e140d68 Mon Sep 17 00:00:00 2001 From: Yvo Brevoort Date: Tue, 6 Oct 2026 15:38:30 +0200 Subject: [PATCH 7/9] whitespace --- lib/StorageServer.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/StorageServer.php b/lib/StorageServer.php index d6eecfb..8a17997 100644 --- a/lib/StorageServer.php +++ b/lib/StorageServer.php @@ -101,8 +101,8 @@ public static function getOwnerWebId() return false; } - public static function getRdfAdapter() - { + public static function getRdfAdapter() + { $storageId = self::getStorageId(); if (!self::storageIdExists($storageId)) { throw new \Exception("Storage does not exist"); @@ -113,11 +113,11 @@ public static function getRdfAdapter() $storagePath = implode("/", str_split($storageId, 4)); } - // The internal adapter - $adapter = new \League\Flysystem\Local\LocalFilesystemAdapter( - // Determine root directory - STORAGEBASE . "$storagePath/" - ); + // The internal adapter + $adapter = new \League\Flysystem\Local\LocalFilesystemAdapter( + // Determine root directory + STORAGEBASE . "$storagePath/" + ); $graph = new \EasyRdf\Graph(); // Create Formats objects From 229e9cbef82d0091c7ebd25ba8c8acb1b44daf4f Mon Sep 17 00:00:00 2001 From: Yvo Brevoort Date: Tue, 6 Oct 2026 15:49:04 +0200 Subject: [PATCH 8/9] pass rdfAdapter --- lib/ProfileServer.php | 3 ++- lib/StorageServer.php | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/ProfileServer.php b/lib/ProfileServer.php index c6dc1f0..82141ca 100644 --- a/lib/ProfileServer.php +++ b/lib/ProfileServer.php @@ -94,7 +94,8 @@ public static function initializeProfile() $user = self::getOwner(); if ($user) { - $filesystem = self::getFilesystem(); + $rdfAdapter = self::getRdfAdapter(); + $filesystem = self::getFilesystem($rdfAdapter); if (!$filesystem->has("/.acl")) { $defaultAcl = self::generateDefaultAcl(); $filesystem->write("/.acl", $defaultAcl); diff --git a/lib/StorageServer.php b/lib/StorageServer.php index 8a17997..f576784 100644 --- a/lib/StorageServer.php +++ b/lib/StorageServer.php @@ -174,7 +174,8 @@ private static function getStorageId() public static function initializeStorage() { - $filesystem = self::getFilesystem(); + $rdfAdapter = self::getRdfAdapter(); + $filesystem = self::getFilesystem($rdfAdapter); if (!$filesystem->has("/.acl")) { $defaultAcl = self::generateDefaultAcl(); $filesystem->write("/.acl", $defaultAcl); From 9ef880927414f78d7f42b84503b81160e5fcf0b5 Mon Sep 17 00:00:00 2001 From: Yvo Brevoort Date: Tue, 6 Oct 2026 18:06:50 +0200 Subject: [PATCH 9/9] add mimeDetector --- lib/ProfileServer.php | 17 ++++++++++++++++- lib/StorageServer.php | 18 +++++++++++++++++- 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/lib/ProfileServer.php b/lib/ProfileServer.php index 82141ca..955d914 100644 --- a/lib/ProfileServer.php +++ b/lib/ProfileServer.php @@ -8,6 +8,20 @@ class ProfileServer extends Server { + public function getMimeDetector() + { + $extensionMap = new \League\MimeTypeDetection\OverridingExtensionToMimeTypeMap( + new \League\MimeTypeDetection\GeneratedExtensionToMimeTypeMap(), + [ + 'acl' => 'text/turtle', + ], + ); + + $mimeTypeDetector = new \League\MimeTypeDetection\FinfoMimeTypeDetector( + customExtensionMap: $extensionMap, + ); + } + public static function getRdfAdapter() { $profileId = self::getProfileId(); @@ -21,7 +35,8 @@ public static function getRdfAdapter() // The internal adapter $adapter = new \League\Flysystem\Local\LocalFilesystemAdapter( // Determine root directory - PROFILEBASE . $profilePath + PROFILEBASE . $profilePath, + self::getMimeDetector() ); $graph = new \EasyRdf\Graph(); diff --git a/lib/StorageServer.php b/lib/StorageServer.php index f576784..1f54022 100644 --- a/lib/StorageServer.php +++ b/lib/StorageServer.php @@ -7,6 +7,7 @@ use Pdsinterop\PhpSolid\Util; use Pdsinterop\PhpSolid\Db; + class StorageServer extends Server { public static function getStorage($storageId) @@ -101,6 +102,20 @@ public static function getOwnerWebId() return false; } + public function getMimeDetector() + { + $extensionMap = new \League\MimeTypeDetection\OverridingExtensionToMimeTypeMap( + new \League\MimeTypeDetection\GeneratedExtensionToMimeTypeMap(), + [ + 'acl' => 'text/turtle', + ], + ); + + $mimeTypeDetector = new \League\MimeTypeDetection\FinfoMimeTypeDetector( + customExtensionMap: $extensionMap, + ); + } + public static function getRdfAdapter() { $storageId = self::getStorageId(); @@ -116,7 +131,8 @@ public static function getRdfAdapter() // The internal adapter $adapter = new \League\Flysystem\Local\LocalFilesystemAdapter( // Determine root directory - STORAGEBASE . "$storagePath/" + STORAGEBASE . "$storagePath/", + self::getMimeDetector() ); $graph = new \EasyRdf\Graph();