PHPackages                             fofx/helper - 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. fofx/helper

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

fofx/helper
===========

Helper functions.

v1.2.5(5mo ago)043↓75%4MITPHPPHP ^8.0

Since Sep 17Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/fofxtools/Helper)[ Packagist](https://packagist.org/packages/fofx/helper)[ RSS](/packages/fofx-helper/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (5)Versions (27)Used By (4)

PHP Helper Functions Library
============================

[](#php-helper-functions-library)

This is a library of PHP Helper functions.

The main class is `Tracker`, which allows you to create code sections to track script times. It can also track changes in memory, and bandwidth.

The Tracker class uses a Singleton pattern to ensure a single global instance.

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

[](#installation)

To include this package in your project, run the following command in your project's root directory:

```
composer require fofx/helper
```

The default configuration file path `config/helper.config.php`.

Docs
----

[](#docs)

- For a detailed overview of the project structure and components, please see [docs/project-structure.md](docs/project-structure.md).
- For detailed usage examples of the `Tracker` class, please see [docs/Tracker.usage.md](docs/Tracker.usage.md).
- For detailed documentation about the `ReflectionUtils` class and its methods, please see [docs/ReflectionUtils.usage.md](docs/ReflectionUtils.usage.md).

Tracker Usage
-------------

[](#tracker-usage)

Below is a basic example from the `public/index.php` file:

```
require_once __DIR__ . "/../vendor/autoload.php";

use FOfX\Helper;
use FOfX\Helper\Tracker;

$tracker = Tracker::getInstance();
Helper\get_diagnostics();

// Create three code sections
$sections = array('1', '2', '3');
foreach ($sections as $i) {
    Tracker::scriptTimer("Section" . $i, "start");
    Helper\rand_sleep(.1);
    Tracker::scriptTimer("Section" . $i, "end");
}

// Print the section timer information arrays
Tracker::trackerEnd();
```

AutoStart
---------

[](#autostart)

Alternatively, in `config/helper.config.php` you can set `autoStartTracker` to `true`. This will auto-start the Tracker global Singleton.

Since this can cause problems in testing environments, this will only work if `is_phpunit_environment()` returns `false`.

If `autoStartTracker` is enabled, you do not need to do `$tracker = Tracker::getInstance();`. The global Singleton will be initialized automatically during autoloading.

Testing and Development
-----------------------

[](#testing-and-development)

To run the PHPUnit test suite through composer:

```
composer test
```

To use PHPStan for static analysis:

```
composer phpstan
```

To run PHPStan on the `tests` folder:

```
composer phpstan tests
```

To use PHP-CS-Fixer for code style:

```
composer cs-fix
```

### PHPUnit Notes

[](#phpunit-notes)

Some tests require a web server. You can either use PHP's built-in server:

```
php -S localhost:8000 -t public/
```

Or use Laragon (Windows), Apache, Nginx, etc.

**Note:**

`get_windows_memory_info()` (in `src/memory.php`) uses `shell_exec()` to call PowerShell. This can cause font glitches in legacy CMD (conhost.exe).

If you run PHPUnit through legacy CMD, it may switch fonts. Use Terminal for PHPUnit instead.

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance73

Regular maintenance activity

Popularity8

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity55

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 ~18 days

Recently: every ~53 days

Total

26

Last Release

151d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b70d3faff89e2b6642ccb6f5282a03c1fa6260bf991c14d9c4abf7822c8181c6?d=identicon)[fofx](/maintainers/fofx)

---

Top Contributors

[![fofxtools](https://avatars.githubusercontent.com/u/177870764?v=4)](https://github.com/fofxtools "fofxtools (25 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/fofx-helper/health.svg)

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

###  Alternatives

[magarrent/laravel-url-shortener

Simpler Url Shortener for Laravel

557.4k](/packages/magarrent-laravel-url-shortener)

PHPackages © 2026

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