PHPackages                             coderstephen/environ - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. coderstephen/environ

AbandonedArchivedLibrary[Utility &amp; Helpers](/categories/utility)

coderstephen/environ
====================

Simple package for getting environment and platform information

v0.1.1(10y ago)316MITPHPPHP &gt;=5.4

Since Jul 27Pushed 10y ago1 watchersCompare

[ Source](https://github.com/sagebind/environ)[ Packagist](https://packagist.org/packages/coderstephen/environ)[ RSS](/packages/coderstephen-environ/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

Environ
=======

[](#environ)

[![Version](https://camo.githubusercontent.com/1ff22002cad8d456378e1598e96593d94188367554c6adbb5b1221087e2b51f2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636f6465727374657068656e2f656e7669726f6e2e737667)](https://packagist.org/packages/coderstephen/environ)[![License](https://camo.githubusercontent.com/55912f1f4709502893e4c59a0f9d5f561a90e1574a4cf4d33d7e4b1630862916/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f636f6465727374657068656e2f656e7669726f6e2e737667)](https://packagist.org/packages/coderstephen/environ)[![Downloads](https://camo.githubusercontent.com/b8d15815c877496a8e1f53f073803ccad276e0cdfbbea749bcffc950502bde4c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636f6465727374657068656e2f656e7669726f6e2e737667)](https://packagist.org/packages/coderstephen/environ)

A simple package for discovering information about an execution environment and platform. Generic name, generic purpose.

Note that this package is a work-in-progress. See [Contributing](#contributing) below if you want to help out.

Overview
--------

[](#overview)

The purpose of this package is to provide a simple interface for discovering information about a execution environment, like what operating system is installed, number of processors, or what PHP interpreter is being used. I created this because there wasn't something that already existed for PHP.

Installation
------------

[](#installation)

Install with [Composer](http://getcomposer.org), obviously:

```
$ composer require coderstephen/environ
```

Usage
-----

[](#usage)

Extremely simple usage; there are a few stateless classes that provide static methods for querying the system. Below is a very simple example:

```
use Environ\Platform;

printf("CPU architecture: %s\n", Platform::getArch());
printf("Number of CPU cores: %d\n", Platform::getCpuCount());
printf("Operating system: %s\n", Platform::getOSName());
printf("Linux distro: %s\n", Platform::linuxDistribution());
```

You can also test some of the results environ gives for your current environment with a provided script:

```
$ vendor/bin/environ-info

-- Platform --
Machine name         : myboss-laptop
Operating system     : Linux
OS release           : 3.19.0-23-generic
OS version           : #24-Ubuntu SMP Tue Jul 7 18:52:55 UTC 2015
CPU architecture     : x86_64
64-bit               : yes
Number of processors : 8

-- Linux distribution --
name                 : ubuntu
release              : 15.04
codename             : vivid
pretty_name          : Ubuntu 15.04

-- Runtime --
Interpreter binary   : /usr/bin/php5
Version              : 5.6.4-4ubuntu6.2
64-bit               : yes
Thread safe          : no
HHVM                 : no
JPHP                 : no
Server module        : no
```

Reference
---------

[](#reference)

You can view a very detailed reference online [here](http://coderstephen.github.io/environ/api).

Contributing
------------

[](#contributing)

Want to contribute? The best way to contribute is to test the code on a wide array of systems with varying setups and to verify the results are as expected. If they aren't, just [create a new issue](https://github.com/coderstephen/environ/issues/new) here on GitHub and we will fix it. If you are adventurous, feel free to fork, patch &amp; submit a pull request that fixes the issue as well.

Where to get help
-----------------

[](#where-to-get-help)

Need help? Just [send me an email](mailto:me@stephencoakley.com) with your questions. Be sure to add "environ" to the message subject line so I know how I can help you out.

License
-------

[](#license)

This library is licensed under the MIT license. See the [LICENSE](LICENSE) file for details.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

3948d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/83a82932c24c29b0e68201a359462dcd87f37b20976f1c48e827fd903ffa2284?d=identicon)[sagebind](/maintainers/sagebind)

---

Top Contributors

[![sagebind](https://avatars.githubusercontent.com/u/2192863?v=4)](https://github.com/sagebind "sagebind (45 commits)")

### Embed Badge

![Health badge](/badges/coderstephen-environ/health.svg)

```
[![Health](https://phpackages.com/badges/coderstephen-environ/health.svg)](https://phpackages.com/packages/coderstephen-environ)
```

###  Alternatives

[jxlwqq/env-manager

Env Manager for Laravel-admin

3719.9k](/packages/jxlwqq-env-manager)[kornrunner/solidity

Pure PHP implementation of Solidity

1940.5k11](/packages/kornrunner-solidity)[rainlab/editable-plugin

Editable plugin for October CMS

174.8k](/packages/rainlab-editable-plugin)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
