wheregroup / platform-detect
Platform detection for PHP
Installs: 7 634
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 0
Requires
- php: >=5.3
Requires (Dev)
- phpunit/phpunit: ~4.8|~5.0
This package is auto-updated.
Last update: 2024-11-20 21:05:26 UTC
README
Detect / distinguish operating system platform in PHP.
Unlinke a simple directory separator test, can tell the difference between Mac OS X, BSD and Linux, and recognizes Cygwin as Windows, not as a generic unix. See consts definitions for possible detection outcomes.
Can also detect legacy 32 bit platforms.
php > $platform = \WhereGroup\PlatformDetect\Platform::guess();
php > echo $platform->getOrder() . "\n";
NIX
php > echo $platform->getFamily() . "\n";
LINUX
php > echo $platform->getBitness() . "\n";
64