Skip to content

feat: remove serveDirectory() — use serveFromDisk() for production#20

Merged
developersharif merged 1 commit intomainfrom
web-widget
Apr 4, 2026
Merged

feat: remove serveDirectory() — use serveFromDisk() for production#20
developersharif merged 1 commit intomainfrom
web-widget

Conversation

@developersharif
Copy link
Copy Markdown
Owner

Drop the PHP built-in web server approach (serveDirectory) that caused firewall prompts and port conflicts on consumer PCs. serveFromDisk() is the correct production method — no ports, no extra processes, uses native platform URI schemes (phpgui:// on Linux, virtual host on Windows, loadFileURL on macOS).

Drop the PHP built-in web server approach (serveDirectory) that caused
firewall prompts and port conflicts on consumer PCs. serveFromDisk() is
the correct production method — no ports, no extra processes, uses native
platform URI schemes (phpgui:// on Linux, virtual host on Windows,
loadFileURL on macOS).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@developersharif developersharif merged commit a9a8997 into main Apr 4, 2026
6 checks passed
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request removes the functionality to serve a directory via PHP's built-in web server from the WebView class, including the serveDirectory and getServerPort methods. Feedback indicates that these removals constitute a breaking change to the public API and will lead to fatal errors in the test suite, as existing tests still reference the deleted methods.

* @param string $path Path to the directory containing index.html
* @param int $port Port to use (0 = auto-pick a free port)
*/
public function serveDirectory(string $path, int $port = 0): void
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Removing the public method serveDirectory() and its associated getter getServerPort() is a breaking change for the public API. More importantly, this removal will cause fatal errors in the test suite, as tests/webview/FrontendServingTest.php (specifically the suite starting at line 469) still references both methods. Please ensure the tests are updated or removed to reflect the new API before merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant