From 8008c98f5f103edd81af53ca80e380d37c090b25 Mon Sep 17 00:00:00 2001 From: dconco <118613296+dconco@users.noreply.github.com> Date: Wed, 24 Dec 2025 08:28:55 +0100 Subject: [PATCH 1/8] Update AssetLinkManager.php --- app/core/Helper/AssetLinkManager.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/core/Helper/AssetLinkManager.php b/app/core/Helper/AssetLinkManager.php index 53356c5..2884964 100644 --- a/app/core/Helper/AssetLinkManager.php +++ b/app/core/Helper/AssetLinkManager.php @@ -70,7 +70,7 @@ public static function generateCssLink(string $componentRoute, int $stylesheetIn * @param string $type The type of the script * @return string The generated JS link */ - public static function generateJsLink(string $componentRoute, int $scriptIndex, ?string $name = null, string $type): string + public static function generateJsLink(string $componentRoute, int $scriptIndex, ?string $name = null, string $type = 'text/javascript'): string { $mappings = Session::get(self::ASSET_MAPPINGS_KEY, []); From e8d60ed8065774e8c7b77ffd80a0b0aca2380306 Mon Sep 17 00:00:00 2001 From: dconco <118613296+dconco@users.noreply.github.com> Date: Wed, 24 Dec 2025 14:56:56 +0100 Subject: [PATCH 2/8] Added Unix socket support implementation CurlHttpClient.php --- app/core/Client/CurlHttpClient.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/app/core/Client/CurlHttpClient.php b/app/core/Client/CurlHttpClient.php index dd5ec7c..5f65695 100644 --- a/app/core/Client/CurlHttpClient.php +++ b/app/core/Client/CurlHttpClient.php @@ -52,7 +52,12 @@ public function request(string $url, string $method, array $headers, ?string $bo curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, (int) $connectTimeout); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, $options['verify_ssl'] ?? false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, ($options['verify_ssl'] ?? false) ? 2 : 0); - + + // --- Handle Unix Socket --- + if (isset($options['unix_socket_path']) { + curl_setopt($ch, CURLOPT_UNIX_SOCKET_PATH, $options['unix_socket_path']); + } + if (isset($options['cert_path'])) { curl_setopt($ch, CURLOPT_CAINFO, $options['cert_path']); } @@ -148,7 +153,12 @@ public function prepareAsync(string $url, string $method, array $headers, ?strin curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, (int) $connectTimeout); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, $options['verify_ssl'] ?? false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, ($options['verify_ssl'] ?? false) ? 2 : 0); - + + // --- Handle Unix Socket --- + if (isset($options['unix_socket_path']) { + curl_setopt($ch, CURLOPT_UNIX_SOCKET_PATH, $options['unix_socket_path']); + } + if (isset($options['cert_path'])) { curl_setopt($ch, CURLOPT_CAINFO, $options['cert_path']); } From 2f5aefe8b8736af64d46eced39f5d23985817fff Mon Sep 17 00:00:00 2001 From: dconco <118613296+dconco@users.noreply.github.com> Date: Wed, 24 Dec 2025 14:59:40 +0100 Subject: [PATCH 3/8] Added Unix socket support in PendingRequest.php --- app/core/Client/PendingRequest.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/core/Client/PendingRequest.php b/app/core/Client/PendingRequest.php index 33c43b7..09429e3 100644 --- a/app/core/Client/PendingRequest.php +++ b/app/core/Client/PendingRequest.php @@ -121,6 +121,12 @@ public function connectTimeout(int $seconds): PendingRequest return $this; } + public function unixSocketPath(string $path): PendingRequest + { + $this->options['unix_socket_path'] = $path; + return $this; + } + /** * Set custom options for the request. * From c5d8b7e3e533daa4bd622d7f87203e5ea924c702 Mon Sep 17 00:00:00 2001 From: dconco <118613296+dconco@users.noreply.github.com> Date: Wed, 24 Dec 2025 15:10:21 +0100 Subject: [PATCH 4/8] Update CurlHttpClient.php --- app/core/Client/CurlHttpClient.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/core/Client/CurlHttpClient.php b/app/core/Client/CurlHttpClient.php index 5f65695..40fc274 100644 --- a/app/core/Client/CurlHttpClient.php +++ b/app/core/Client/CurlHttpClient.php @@ -54,7 +54,7 @@ public function request(string $url, string $method, array $headers, ?string $bo curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, ($options['verify_ssl'] ?? false) ? 2 : 0); // --- Handle Unix Socket --- - if (isset($options['unix_socket_path']) { + if (isset($options['unix_socket_path'])) { curl_setopt($ch, CURLOPT_UNIX_SOCKET_PATH, $options['unix_socket_path']); } @@ -155,7 +155,7 @@ public function prepareAsync(string $url, string $method, array $headers, ?strin curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, ($options['verify_ssl'] ?? false) ? 2 : 0); // --- Handle Unix Socket --- - if (isset($options['unix_socket_path']) { + if (isset($options['unix_socket_path'])) { curl_setopt($ch, CURLOPT_UNIX_SOCKET_PATH, $options['unix_socket_path']); } From dda6150ed81b33402c82c1eb6baf4877d63a1aee Mon Sep 17 00:00:00 2001 From: "onipededavid208@gmail.com" Date: Fri, 2 Jan 2026 19:23:25 +0100 Subject: [PATCH 5/8] Fix cURL options for SSL verification and update documentation link --- app/core/Client/CurlHttpClient.php | 12 ++++++------ app/core/Helper/StateManager.php | 7 +++++-- docs/references/index.md | 2 +- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/app/core/Client/CurlHttpClient.php b/app/core/Client/CurlHttpClient.php index a1e502b..a800172 100644 --- a/app/core/Client/CurlHttpClient.php +++ b/app/core/Client/CurlHttpClient.php @@ -191,13 +191,13 @@ public function prepareAsync(string $url, string $method, array $headers, ?strin curl_setopt($ch, CURLOPT_TIMEOUT_MS, (int)($timeout * 1000)); } else { // Use seconds for timeouts >= 1 - curl_setopt($ch, CURLOPT_TIMEOUT, (int)$timeout); + curl_setopt($ch, CURLOPT_TIMEOUT, (int) $timeout); } - + $connectTimeout = $options['connect_timeout'] ?? 10; curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, (int) $connectTimeout); - curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, $options['verify_ssl'] ?? false); - curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, ($options['verify_ssl'] ?? false) ? 2 : 0); + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, $options['verify_ssl'] ?? true); + curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, ($options['verify_ssl'] ?? true) ? 2 : 0); // --- Handle Unix Socket --- if (isset($options['unix_socket_path'])) { @@ -207,11 +207,11 @@ public function prepareAsync(string $url, string $method, array $headers, ?strin if (isset($options['cert_path'])) { curl_setopt($ch, CURLOPT_CAINFO, $options['cert_path']); } - + if (isset($options['user_agent'])) { curl_setopt($ch, CURLOPT_USERAGENT, $options['user_agent']); } - + // Build headers array for cURL $curlHeaders = []; foreach ($headers as $key => $value) { diff --git a/app/core/Helper/StateManager.php b/app/core/Helper/StateManager.php index f4d496c..26eb680 100644 --- a/app/core/Helper/StateManager.php +++ b/app/core/Helper/StateManager.php @@ -68,13 +68,16 @@ public function __construct(string $stateKey, $default) * @param mixed $value Optional value to be processed when the object is invoked. * @return mixed The result of the invocation, depending on the implementation. */ - public function __invoke($value = UNDEFINED_STATE_VARIABLE) + public function __invoke() { $sessionData = SessionHandler::get(STATE_HANDLE); - if ($value === UNDEFINED_STATE_VARIABLE) { + // If no argument was passed, return the current state value. + if (\func_num_args() === 0) { return $sessionData[$this->stateKey] ?? $this->value; } + // An argument was explicitly provided (even if it is falsy); treat it as the new state value. + $value = func_get_arg(0); $this->lastState = $this->value ?? Validate::validate($value); $this->value = $value; diff --git a/docs/references/index.md b/docs/references/index.md index 8406bc6..678b880 100644 --- a/docs/references/index.md +++ b/docs/references/index.md @@ -40,7 +40,7 @@ Learn how the `@dconco/phpspa` package bootstraps navigation, state sync, and client helpers. - [:octicons-arrow-right-24: Open guide](https://phpspa-client.vercel.app) + [:octicons-arrow-right-24: Open guide](https://phpspa-client.up.railway.app) From f88c0f93877c708875781521938879f92424ecc5 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Fri, 2 Jan 2026 18:23:58 +0000 Subject: [PATCH 6/8] Update LoC badge [skip ci] --- badge/loc.svg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/badge/loc.svg b/badge/loc.svg index 45a4ec7..d767eae 100644 --- a/badge/loc.svg +++ b/badge/loc.svg @@ -12,8 +12,8 @@ Lines of Code Lines of Code - 16,124 - 16,124 + 16,127 + 16,127 \ No newline at end of file From aad842f9446eec41edc8e4d653f62bf81cf19872 Mon Sep 17 00:00:00 2001 From: dconco <118613296+dconco@users.noreply.github.com> Date: Fri, 2 Jan 2026 19:43:15 +0100 Subject: [PATCH 7/8] Revise CHANGELOG for version updates and stability Updated versioning and installation instructions in CHANGELOG.md. --- CHANGELOG.md | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3af7bf1..d016483 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,10 @@ # CHANGELOG -## v2.0.5 (unreleased) +## v2.0.5 (Current) (Stable) **Installation:** ```bash -composer require dconco/phpspa:v2.0.5.x-dev +composer require dconco/phpspa:v2.0.5 ``` ### What's Added @@ -102,11 +102,16 @@ $app -## v2.0.4 (Current) (Stable) +## v2.0.4 > [!IMPORTANT] > This version requires **PHP 8.4 or higher** +**Installation:** +```bash +composer require dconco/phpspa:v2.0.4 +``` + ### **Client-Side Hooks** ⚛️ - **`useEffect()`** - Manage side effects and cleanups in your component scripts with dependency tracking @@ -259,6 +264,11 @@ $app->prefix('/api', function (Router $router) { ## v2.0.3 +**Installation:** +```bash +composer require dconco/phpspa:v2.0.3 +``` + ### ✨ New Features #### **Native C++ Compression Engine** ⚡ From 97c422d474928b272f005660ced457b692004fb5 Mon Sep 17 00:00:00 2001 From: dconco <118613296+dconco@users.noreply.github.com> Date: Fri, 2 Jan 2026 19:44:20 +0100 Subject: [PATCH 8/8] Fix documentation link in CHANGELOG.md Updated documentation link for component meta reference. --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d016483..773a62f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -54,7 +54,7 @@ new Component(...) ->meta(property: 'og:title', content: 'PhpSPA Design System'); ``` -**Documentation:** [references/component-meta](https://phpspa.readthedocs.io/en/latest/references/component-meta) +**Documentation:** [references/component-meta](https://phpspa.tech/references/component-meta) #### **`useCallback()`**