Repository navigation
Internals Bootstrap Boot
Framework Internals · Subsystem overview · Developer guide
Source: bootstrap/boot.php · Snapshot 8411f4287706.
Bootstrap scripts wire globals, constants and collaborators in a defined order. These files are executable entry points rather than a reusable class API.
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
require_once CONFIG . 'awt_db.php';
require_once CONFIG . 'awt_config.php';
if (DB_TYPE === '') {
if (PHP_SAPI !== 'cli') {
exit('Framework is not installed. Run "php awt" in your terminal, then enter "install" and follow the instructions.');
}
require_once FUNCTIONS . 'awt_autoLoader.fun.php';
require_once __DIR__ . '/cli/handler.php';
return;
}
require_once FUNCTIONS . 'awt_autoLoader.fun.php';
require_once FUNCTIONS . "awt_getDomain.fun.php";
require_once FUNCTIONS . 'ErrorHandler.fun.php';
global $defaultRouters;
global $settings;
global $eventDispatcher;
$eventDispatcher = new \event\EventDispatcher();
global $shared;
global $loader;
global $routerManager;
spl_autoload_register();
$settings = require __DIR__ . '/settings/settings.php';
$defaultRouters = require __DIR__ . '/routes/default.php';
$routerManager = require __DIR__ . '/routes/manager.php';
$eventDispatcher = require __DIR__ . '/event/dispatcher.php';
define("HOSTNAME", getDomainName());
$shared["AWT"]["Settings"] = $settings;
if(defined("DEV")) {
require_once __DIR__ . '/dev.php';
}
global $cliHandler;
if (PHP_SAPI === 'cli') $cliHandler = new \cli\CLIHandler();
$loader = require __DIR__ . '/packages/loader.php';
$routerManager = require __DIR__ . '/routes/router.php';
if(PHP_SAPI === 'cli')
require_once __DIR__ . '/cli/handler.php';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