utopia-php / system
A simple library for obtaining information about the host's system.
Requires
- php: >=8.0.0
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
- dev-main
- 0.11.0
- 0.10.6
- 0.10.5
- 0.10.4
- 0.10.3
- 0.10.2
- 0.10.1
- 0.10.0
- 0.9.0
- 0.8.0
- 0.7.2
- 0.7.1
- 0.7.0
- 0.6.0
- 0.5.0
- 0.4.0
- 0.3.0
- 0.2.0
- 0.1.0
- dev-backup/main-local-2026-05-14-9f916180
- dev-feat/cpu-lmits
- dev-feat/condition-return-types
- dev-fix-implicit-nullable
- dev-eldadfux-patch-1
- dev-refactor-pipelines
- dev-fix-arch-check
- dev-feat-add-new-arch
- dev-feat-cpu-usage
This package is auto-updated.
Last update: 2026-09-07 09:57:21 UTC
README
Important
This repository is a read-only mirror of the utopia-php monorepo. Development happens in packages/system — please open issues and pull requests there.
Utopia System library is a simple and lite library to obtain information about the host's system, and provides an easy way to detect on which CPU architecture your code is running. This library is aiming to be as simple and easy to learn and use. This library is maintained by the Appwrite team.
Although this library is part of the Utopia Framework project it is dependency free and can be used as standalone with any other PHP project or framework.
Getting started
Install using Composer:
composer require utopia-php/system
Init in your application:
<?php require_once __DIR__ . '/../../vendor/autoload.php'; use Utopia\System\System; echo System::getOS(); // prints "Linux" for example echo System::getHostname(); // Your hostname echo System::getArch(); // x86_64 echo System::getEnv('MY_ENV_VAR'); // test echo System::isArm(); // bool echo System::isPPC(); // bool echo System::isX86(); // bool
System requirements
Utopia Framework requires PHP 8.0 or later. We recommend using the latest PHP version whenever possible.
Supported methods
System::getMemory() returns the effective memory capacity in MiB, rounded down.
On Linux, it reads cgroup v2 memory.max or cgroup v1 memory.limit_in_bytes
from the standard container mounts under /sys/fs/cgroup, capped at host RAM.
It falls back to getMemoryTotal() when a limit is missing, unreadable, or unlimited.
On macOS, it returns host RAM. Other operating systems throw an exception.
getMemoryTotal() continues to return host RAM.
getCPUCores |
getCPUUsage |
getMemoryTotal |
getMemoryFree |
getDiskTotal |
getDiskFree |
getIOUsage |
getNetworkUsage |
|
|---|---|---|---|---|---|---|---|---|
| Windows | ✅ | ✅ | ✅ | |||||
| MacOS | ✅ | ✅ | ✅ | ✅ | ✅ | |||
| Linux | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
Authors
Eldad Fux
Torsten Dittmann
Copyright and license
The MIT License (MIT) http://www.opensource.org/licenses/mit-license.php