Repository navigation
Internals Awt_src Functions Awt_getDomain
Framework Internals · Subsystem overview · Developer guide
Source: awt_src/functions/awt_getDomain.fun.php · Snapshot 8411f4287706.
Global helpers register autoloading and exception handlers or construct the application base URL from the request and settings.
use setting\Config;function getDomainName(): ?stringReturn expressions (including local callbacks): $scheme . "://" . $host . Config::getConfig("AWT", "hostname path")->getValue().
Function implementation
function getDomainName(): ?string
{
$scheme = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ? 'https' : 'http';
$host = $_SERVER['HTTP_HOST'];
return $scheme . "://" . $host . Config::getConfig("AWT", "hostname path")->getValue();
}The script below is executed by its caller. Constants, registered callbacks, global assignments, guards, included files and their order are preserved here. Unlike class methods, entry-point execution can start the CLI loop, route a request, emit output, or terminate the process.
<?php
use setting\Config;
/**
* Function getDomainName
* @return string|null Returns a base domain name without requested URI.
*/
function getDomainName(): ?string
{
$scheme = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ? 'https' : 'http';
$host = $_SERVER['HTTP_HOST'];
return $scheme . "://" . $host . Config::getConfig("AWT", "hostname path")->getValue();
}AWT Framework Wiki · Home · Installation Guide · Developer Guide · Framework Internals
Philosophy · Architecture · Known discrepancies · Verification
Installation Guide
Developer Guide
- Learning sequence
- First package
- Package structure
- Lifecycle
- Runtimes
- Events and objects
- Routing and controllers
- Views and resources
- Database and models
- Storage and caching
- Configuration and CLI
- Responses and errors
- Extension points
Framework Internals
- Architecture
- Bootstrap
- Packages
- Runtime
- Events and context
- Objects
- HTTP routing and controllers
- Rendering
- Blade integration
- Database
- Models
- Storage and caching
- Settings
- CLI
- Identity and sessions
- Responses
- Errors
- Complete source inventory
Documentation notes