PHPackages                             morvren-achronos/useful - 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. morvren-achronos/useful

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

morvren-achronos/useful
=======================

Useful is a PHP non-framework. It's a collection use utility classes. Take what you want, leave the rest.

v0.3.0.1(16y ago)057Apache-2.0PHPPHP ^5.0 || ^7.0CI failing

Since May 21Pushed 6y ago1 watchersCompare

[ Source](https://github.com/morvren-achronos/php-useful)[ Packagist](https://packagist.org/packages/morvren-achronos/useful)[ Docs](https://github.com/morvren-achronos/php-useful)[ RSS](/packages/morvren-achronos-useful/feed)WikiDiscussions master Synced yesterday

READMEChangelog (9)Dependencies (2)Versions (12)Used By (0)

useful
======

[](#useful)

Useful is a PHP library collection with a focus on simplicity. Take what you want, ignore the rest.

Goals:

*Utility*

Useful provides convenience that is not easily found anywhere else.

It solves common challenges that are not well addressed by the PHP language, common frameworks or popular libraries.

*Simplicity*

Useful can be used quickly without lots of reading and training.

Class hierarchy is flat. Each class does one thing. All classes are immediately useful to application developers.

*Easy integration*

Useful does not *require* you to do anything in one particular way.

It has few dependencies, and dependencies are clearly marked. Every class stands on its own and can be used on its own.

Requirements
------------

[](#requirements)

PHP 5 &gt;= 5.4 or PHP 7; or PHP 5 &gt;= 5.0 with special handling (see *No namespaces* below).

Most classes should work anywhere that PHP does. Exceptions are clearly marked.

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

[](#installation)

### Composer

[](#composer)

Useful supports Composer. If you do too, great, install Useful using it and go.

Example:

### Manual

[](#manual)

You can clone from Github, or just copy in the files.

Clone from Github:

```
git clone https://github.com/morvren-achronos/php-useful.git WHEREVER_YOU_PUT_VENDOR_CODE/useful
```

You can even paste in a single class; Useful classes have no interdependencies, so if you only want one just take it and use it.

Usage
-----

[](#usage)

### Composer autoload

[](#composer-autoload)

If you use Composer then Useful code will autoload automatically. All classes are in the `\Useful` namespace.

Example:

```
// Create a Useful Date object
$oDate = \Useful\Date::create('1999-12-31');
```

### Include Useful's autoloader

[](#include-usefuls-autoloader)

```
// Load Useful autoloader directly
require_once('WHEREVER_YOU_PUT_VENDOR_CODE/useful/src/autoloader.php');

// Create a Useful Date object
$oDate = \Useful\Date::create('1999-12-31');
```

It's a simple PSR-4 autoloader for the `\Useful` namespace.

### No namespaces: Legacy loader

[](#no-namespaces-legacy-loader)

Useful supports PHP 5 back to (in theory) 5.0 via its "legacy loading" system.

Note, the test suite requires PHP 7. Author has used parts of Useful on PHP 5.1. Your mileage may vary.

#### PHP 5.1-compatible SPL autoloader

[](#php-51-compatible-spl-autoloader)

```
// Load Useful legacy autoloader
require_once('WHEREVER_YOU_PUT_VENDOR_CODE/useful/src/legacy_autoloader.php');

// Create a Useful Date object
$oDate = Useful_Date::create('1999-12-31');
```

The legacy autoloader uses a classname prefix (`Useful_Foo`) instead of namespace (`\Useful\Foo`).

#### PHP 5.0 loader

[](#php-50-loader)

PHP 5.0 does not have `spl_autoload_register()`. That's ok. The legacy loader can be used to load a class directly without namespace.

```
// Load Useful_Legacy_Loader class
require_once('WHEREVER_YOU_PUT_VENDOR_CODE/useful/src/Useful_Legacy/Loader.php');
Useful_Legacy_Loader::registerNamespace(
	'\Useful',
	'WHEREVER_YOU_PUT_VENDOR_CODE/useful/src/Useful',
	'WRITABLE_TEMP_DIRECTORY_FOR_CODE_CACHING/'
);

function __autoload($sClass)
{
	// Try Useful legacy loader, it will return FALSE if not handled.
	// You could also just call this method directly for each class you want, without an autoloader.
	if (Useful_Legacy_Loader::loadClass($sClass)) {
		return;
	}

	// ... whatever else you need to autoload
}

// Create a Useful Date object
$oDate = Useful_Date::create('1999-12-31');
```

Tests
-----

[](#tests)

Uses PHPUnit. Test coverage is \[2019-04\] @TODO very incomplete for some classes.

###  Health Score

25

—

LowBetter than 36% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

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

Recently: every ~594 days

Total

10

Last Release

3509d ago

PHP version history (2 changes)v0.3.0.1PHP ^5.0 || ^7.0

0.1.0PHP ^5.4 || ^7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/1e9f5997784ac8e5dce9966735394508fee2d01eb27c9d3dc3c19cc8353c8db2?d=identicon)[morvren-achronos](/maintainers/morvren-achronos)

---

Top Contributors

[![achronos0](https://avatars.githubusercontent.com/u/18621556?v=4)](https://github.com/achronos0 "achronos0 (24 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/morvren-achronos-useful/health.svg)

```
[![Health](https://phpackages.com/badges/morvren-achronos-useful/health.svg)](https://phpackages.com/packages/morvren-achronos-useful)
```

###  Alternatives

[symfony/lock

Creates and manages locks, a mechanism to provide exclusive access to a shared resource

514135.1M626](/packages/symfony-lock)[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.6k38.2k](/packages/matomo-matomo)[phpro/soap-client

A general purpose SoapClient library

8895.9M52](/packages/phpro-soap-client)[ecotone/ecotone

Enterprise architecture layer for Laravel and Symfony — CQRS, Event Sourcing, Durable Workflows (Sagas, Orchestrators), Projections, and Outbox messaging via PHP attributes.

562565.8k42](/packages/ecotone-ecotone)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

751284.3k37](/packages/civicrm-civicrm-core)[illuminate/broadcasting

The Illuminate Broadcasting package.

7126.9M203](/packages/illuminate-broadcasting)

PHPackages © 2026

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