PHPackages                             hat/environment - 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. [Testing &amp; Quality](/categories/testing)
4. /
5. hat/environment

ActiveLibrary[Testing &amp; Quality](/categories/testing)

hat/environment
===============

The lib allows to check your environment easy and allows to test and build your environment in one action

v0.1(13y ago)34.9k2MITPHPPHP &gt;=5.3.2

Since Apr 15Pushed 12y ago3 watchersCompare

[ Source](https://github.com/slavahatnuke/environment)[ Packagist](https://packagist.org/packages/hat/environment)[ Docs](https://github.com/slavahatnuke/environment)[ RSS](/packages/hat-environment/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (1)Used By (0)

Hat Environment
===============

[](#hat-environment)

The lib allows to check your environment easy and allows to test and build your environment in one action

`bin/environment`

```
    slava$ bin/environment

    [SKIP]      --default
    [SKIP]      --dev

    [OK]        environment.ini

```

```

    [OK]        --default

    [SKIP]      ubuntu
    [OK]        osx

    [FAIL]      php version

                    definition : php version

                    properties :
                      command : php -v
                      version : 5.4.0

                    options :
                      name : php version
                      class : Hat\Environment\Tester\CommandVersion

                    result :
                      command : php -v
                      version : 5.4.0
                      regex : /(\d+\.\d+\.\d+)/
                      output : PHP 5.3.18 (cli) (built: Nov 24 2012 14:53:21)Copyright (c) 1997-2012 The PHP Gr...

    [OK]        nodejs installed
    [FAIL]      nodejs version

                    definition : nodejs version

                    properties :
                      command : node -v
                      version : 0.8.16

                    options :
                      name : nodejs version
                      class : Hat\Environment\Tester\CommandVersion
                      depends : nodejs installed

                    result :
                      command : node -v
                      version : 0.8.16
                      regex : /(\d+\.\d+\.\d+)/
                      output : v0.8.14

    [OK]        mysql installed
    [OK]        mysql version
    [OK]        beanstalk installed
    [OK]        beanstalk version
    [OK]        less installed
    [OK]        less version
    [OK]        mongo installed
    [OK]        mongo version
    [OK]        phpunit installed
    [OK]        phpunit version
    [FAIL]      beanstalk is working

                    definition : beanstalk is working

                    properties :
                      process : beanstalkd

                    options :
                      name : beanstalk is working
                      class : Hat\Environment\Tester\Process
                      depends : beanstalk installed

                    result :
                      process : beanstalkd
                      command : ps -ef
                      output :   UID   PID  PPID   C STIME   TTY           TIME CMD    0     1     0   0 10:15A...

    [FAIL]      mysql is working

                    definition : mysql is working

                    properties :
                      process : mysqld

                    options :
                      name : mysql is working
                      class : Hat\Environment\Tester\Process
                      depends : mysql installed

                    result :
                      process : mysqld
                      command : ps -ef
                      output :   UID   PID  PPID   C STIME   TTY           TIME CMD    0     1     0   0 10:15A...

    [FAIL]      mongodb is working

                    definition : mongodb is working

                    properties :
                      process : mongod

                    options :
                      name : mongodb is working
                      class : Hat\Environment\Tester\Process

                    result :
                      process : mongod
                      command : ps -ef
                      output :   UID   PID  PPID   C STIME   TTY           TIME CMD    0     1     0   0 10:15A...

    [OK]        http server is working
    [OK]        PHP PDO extension
    [OK]        PHP MB extension
    [FAIL]      PHP.ini short_open_tag is empty

                    definition : PHP.ini short_open_tag is empty

                    properties :
                      option : short_open_tag
                      expected : 0

                    options :
                      name : PHP.ini short_open_tag is empty
                      class : Hat\Environment\Tester\PhpIni

                    result :
                      option : short_open_tag
                      expected : 0
                      output :

    [OK]        PHP.ini date.timezone is not empty
    [FAIL]      app cache is writable

                    definition : app cache is writable

                    properties :
                      path : app/cache

                    options :
                      name : app cache is writable
                      class : Hat\Environment\Tester\IsWritable

                    result :
                      path : app/cache

    [OK]        ebadmin cache is writable
    [OK]        app logs is writable
    [OK]        ebadmin logs is writable

    [FAIL]      osx

    [FAIL]      --default
    [SKIP]      --dev

    [FAIL]      environment.ini

```

Install via Composer
====================

[](#install-via-composer)

`curl -s https://getcomposer.org/installer | php`

`subl composer.json`

```

    {
        "require": {
            "hat/environment": "dev-master"
        }
    }

```

`php composer.phar install`

you can test default profile

`environment.ini` should be in the root of your project you can see example `vendor/hat/environment/environment.ini`

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 85.1% 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

Unknown

Total

1

Last Release

4781d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/302592?v=4)[slava hatnuke](/maintainers/slavahatnuke)[@slavahatnuke](https://github.com/slavahatnuke)

---

Top Contributors

[![slavahatnuke](https://avatars.githubusercontent.com/u/302592?v=4)](https://github.com/slavahatnuke "slavahatnuke (148 commits)")[![66Ton99](https://avatars.githubusercontent.com/u/383739?v=4)](https://github.com/66Ton99 "66Ton99 (25 commits)")[![makasim](https://avatars.githubusercontent.com/u/143206?v=4)](https://github.com/makasim "makasim (1 commits)")

---

Tags

testingtestenvironmentenvsystembuildbuildingos

### Embed Badge

![Health badge](/badges/hat-environment/health.svg)

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

###  Alternatives

[mockery/mockery

Mockery is a simple yet flexible PHP mock object framework

10.7k497.0M23.6k](/packages/mockery-mockery)[php-mock/php-mock

PHP-Mock can mock built-in PHP functions (e.g. time()). PHP-Mock relies on PHP's namespace fallback policy. No further extension is needed.

36918.1M98](/packages/php-mock-php-mock)[brain/monkey

Mocking utility for PHP functions and WordPress plugin API

33812.5M350](/packages/brain-monkey)[ta-tikoma/phpunit-architecture-test

Methods for testing application architecture

10745.9M13](/packages/ta-tikoma-phpunit-architecture-test)[php-mock/php-mock-phpunit

Mock built-in PHP functions (e.g. time()) with PHPUnit. This package relies on PHP's namespace fallback policy. No further extension is needed.

1718.2M399](/packages/php-mock-php-mock-phpunit)[fr3d/swagger-assertions

Test your API requests and responses against your swagger definition

138850.9k5](/packages/fr3d-swagger-assertions)

PHPackages © 2026

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