Prefly is Atomic's environment preflight checker.
Engine\Atomic\Core\Prefly validates:
- PHP version
>= 8.1.0 - required extensions:
jsonsessionmbstringfileinfopdopdo_mysqlcurl
Prefly itself does not perform filesystem checks.
Available methods:
check_environment(): arrayall_checks_passed(): boolis_php_version_compatible(string $required): boolis_extension_loaded(string $ext): boolis_function_available(string $function): boolis_class_available(string $class): bool
Example result structure:
[
'php_version' => [
'required' => '8.1.0',
'current' => '8.3.6',
'status' => true,
],
'extensions' => [
'json' => ['required' => true, 'status' => true],
'pdo_mysql' => ['required' => true, 'status' => true],
],
]App::prefly() wraps Prefly and adds the actual startup behavior.
When environment checks fail:
- in CLI mode:
- prints a
System Errorblock - lists the missing requirements
- exits with code
1
- prints a
- in web mode:
- returns HTTP
500 - prints a simple error page
- shows the detailed missing requirements only when
DEBUG_MODEis truthy - exits immediately
- returns HTTP
For non-CLI requests only, App::prefly() also checks:
storage/exists and is writablestorage/logs/exists and is writable
If either check fails:
- HTTP status
503is returned - a service-unavailable page is shown
- when
DEBUG_MODEis truthy, the page includes suggestedchownandchmodcommands
- The required extension list is aligned with current Composer
ext-*requirements. Preflydoes not cover every optional subsystem dependency. For example,Cryptostill requires the Sodium extension separately.- Use
App::prefly()early in application boot so startup fails before partial initialization.