This API provides information about the Operating System for which the application was initialized.
You can access the subsystem using Application::$os
property.
$app = new Boson\Application(); $app->os; // Access to OS Info API
#OS Family
To get information about the OS family, use the family
property:
$app = new Boson\Application(); echo $app->os->family; // // Expected output: // // Windows //
More detailed information about OS families is available on the OS Info Component documentation page.
#Common Info
To get information about the OS name and version, use the name
and version
properties.
You also have access to optional (may contain null
) information about
the OS edition and codename.
$app = new Boson\Application(); echo $app->os->name . "\n"; echo $app->os->version . "\n"; echo ($app->os->edition ?? '~') . "\n"; echo ($app->os->codename ?? '~') . "\n"; // // Expected output: // // Windows 11 Pro // 10.0.26100 // Professional // 24H2 //
More detailed information about OS is available on the OS Info Component documentation page.