detect_base_url()

public function detect_base_url(): string

Description

Auto-detects the application's base URL by examining the server protocol, host, and script path. Used during initial setup to suggest a likely base URL for the application.

The method takes no user input and makes a best-effort determination based on the current server environment. The detected URL should always be verified by the user before being saved.

Parameters

This method takes no parameters.

Return Value

TypeDescription
stringThe detected base URL with trailing forward slash (e.g., http://localhost/myapp/).