PHPackages                             mistralys/application-utils - 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. mistralys/application-utils

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

mistralys/application-utils
===========================

Drop-in utilities for PHP applications.

3.2.0(4mo ago)7140.5k↓14.7%1[1 issues](https://github.com/Mistralys/application-utils/issues)11MITPHPPHP &gt;=7.4CI failing

Since Oct 22Pushed 4mo ago4 watchersCompare

[ Source](https://github.com/Mistralys/application-utils)[ Packagist](https://packagist.org/packages/mistralys/application-utils)[ RSS](/packages/mistralys-application-utils/feed)WikiDiscussions main Synced today

READMEChangelog (10)Dependencies (6)Versions (92)Used By (11)

Application Utilities
=====================

[](#application-utilities)

Drop-in static PHP utility classes for common tasks, from file system related operations and variable conversions to image manipulation.

Composition
-----------

[](#composition)

This package is an aggregation of several separate libraries upon which the application utilities are built. Depending on the features you need, you may not need to install this package in its entirety.

The following libraries are included in this package:

- [AppUtils Core](https://github.com/Mistralys/application-utils-core): The minimum core classes used by all libraries.
- [AppUtils Image](https://github.com/Mistralys/application-utils-image): Image manipulation classes using the GD library.
- [AppUtils Collections](https://github.com/Mistralys/application-utils-collections): Enum and item collection classes.
- [AppUtils Result Handling](https://github.com/Mistralys/application-utils-result-handling): Classes for collecting operation results.
- [AppLocalize](https://github.com/Mistralys/application-localization): (Optional) Localization library and translation UI.

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

[](#requirements)

- PHP v7.4+
- Extensions:
    - MBString
    - CURL
    - Json
    - GD
    - Zip
    - Dom
    - SimpleXML

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

[](#installation)

Simply require the package with Composer:

```
composer require mistralys/application-utils

```

Also see the [Packagist](https://packagist.org/packages/mistralys/application-utils) page.

### Translation support

[](#translation-support)

To enable localization of any translatable strings in the package, require the [Application Localization](https://github.com/Mistralys/application-localization) package as well. German and French translations are included, and the integrated interface allows adding additional translations.

Other translation solutions are not supported.

```
composer require mistralys/application-localization

```

> Note: The `StringBuilder` helper's translation methods depend on the package being installed.

Quickstart
----------

[](#quickstart)

The package is meant to simplify day to day development tasks, from common file system related access to converting data types. It uses exception-based error handling, so there is no need for checking PHP function return values for `false`.

There is no central factory for accessing the helpers. Instead, each static helper class has its own factory methods and acts as hub for all related tasks.

For example, all file related tasks live in the `FileHelper` class.

```
use AppUtils\FileHelper;

// Replacement for file_get_contents
$content = FileHelper::readContents('path/to/file');
```

Likewise, conversion methods live in the `ConvertHelper` class.

```
use AppUtils\ConvertHelper;

$bool = ConvertHelper::string2bool('yes');
```

The helpers overview below can give you an idea of what is available.

Overview of helpers
-------------------

[](#overview-of-helpers)

This overview is an excerpt of the available utility classes in the package. It shows only the main functionality - classes like the ConvertHelper for example have many static methods not shown here.

- [BaseException](https://github.com/Mistralys/application-utils/wiki/BaseException): Exception class with extended functionality.
- [BoolValue](https://github.com/Mistralys/application-utils/wiki/BoolValue): Object oriented boolean values with one-way "sticky" values.
- [ConvertHelper](https://github.com/Mistralys/application-utils/wiki/ConvertHelper): Converting dates, strings, transliterating and more.
    - ByteConverter: Convert byte values to kilobytes, megabytes...
    - ControlCharacters: Detecting and stripping control characters from strings.
    - DateInterval: Wrapper around the native DateInterval to fix common pitfalls.
    - DurationConverter: Convert time durations to human-readable formats.
    - EOL: Detect the newline style used in a string or file.
    - HiddenConverter: Converts hidden characters to readable for debugging.
    - IntervalConverter: Convert date intervals to human-readable formats.
    - QueryParser: Parse query formatted strings without the native limitations.
    - SizeNotation: Convert size strings (2 MB) to byte values.
    - TabsNormalizer: Allows intelligently left-adjusting indented text.
    - [ThrowableInfo](https://github.com/Mistralys/application-utils/wiki/ThrowableInfo): Exception analysis tool for debugging, and persisting them to storage.
    - [URLFinder](https://github.com/Mistralys/application-utils/wiki/URLFinder): Allows detecting URLs in a string.
    - WordWrapper: Intelligently wrap text to a specific length.
- [ClassHelper](https://github.com/Mistralys/application-utils/wiki/ClassHelper): Static analysis-friendly class loading methods and Composer `ClassLoader` access.
- CSVHelper: Read and generate CSV files.
- Highlighter: Syntax highlighting using GeSHi, as well as some custom variants.
- JSHelper: generate JavaScript statements from PHP with automatic PHP &gt; JS conversion of variables.
- [FileHelper](https://github.com/Mistralys/application-utils/wiki/FileHelper): File system utility methods and file finder.
    - [FileFinder](https://github.com/Mistralys/application-utils/wiki/FileFinder): Fetching file lists by filters, recursive or not.
    - PHPClassInfo: Fetch basic class info from PHP files without reflection.
    - MimeTypes: List of commonly used mime types.
    - [PathsReducer](https://github.com/Mistralys/application-utils/wiki/PathsReducer): Reduce a list of absolute paths to a common root.
- HTMLHelper: Common HTML utility methods.
    - [HTMLTag](https://github.com/Mistralys/application-utils/wiki/HTMLTag): Object-Oriented HTML tag generation.
    - AttributeCollection: Collection class for attributes (HTML or other).
- ImageHelper: Image manipulation using native GD functions with alpha support.
    - [RGBAColor](https://github.com/Mistralys/application-utils/wiki/RGBAColor): Color container class with alpha channel support.
- [IniHelper](https://github.com/Mistralys/application-utils/wiki/IniHelper): INI file reader and editor.
- [Microtime](https://github.com/Mistralys/application-utils/wiki/Microtime): `DateTime` class with microseconds support and friendly methods interface.
- [NamedClosure](https://github.com/Mistralys/application-utils/wiki/NamedClosure): Wrapper for closures with the possibility to add a description.
- [NumberInfo](https://github.com/Mistralys/application-utils/wiki/NumberInfo): Access and modify numbers with or without units.
- [OperationResult](https://github.com/Mistralys/application-utils/wiki/OperationResult): Drop-in class to store the status of the result of any operation.
- [OutputBuffering](https://github.com/Mistralys/application-utils/wiki/OutputBuffering): Output buffering wrapper with exception error management.
- PaginationHelper: Calculates all required numbers for a pagination widget.
- RegexHelper: Collection of typical validation Regexes.
- [Request](https://github.com/Mistralys/application-utils/wiki/Request): Validate, filter and access request variables.
    - URLComparer: Compare URLs, including query parameters.
    - RequestHelper: Build raw requests from scratch with multipart support.
    - AcceptHeaders: Allows parsing the `Accept:` header.
- [StringBuilder](https://github.com/Mistralys/application-utils/wiki/StringBuilder): Easily concatenate strings, with formatting helpers, in a chainable interface.
- SVNHelper: working with a local SVN repository. Update, commit, etc.
- Traits and Interfaces: Plug-in traits for common tasks, with matching interfaces.
    - [Classable](https://github.com/Mistralys/application-utils/wiki/Classable): For elements that can have classes, like HTML elements.
    - [Optionable](https://github.com/Mistralys/application-utils/wiki/Optionable): For elements which allow setting options, with strong typing.
    - Stringable: For elements with the `__toString()` method.
- Transliteration: Simple transliteration to ASCII for any names.
- [URLInfo](https://github.com/Mistralys/application-utils/wiki/URLInfo): An object-oriented parse\_url with fixes for a number of pitfalls.
    - Highlighter: Highlights URLs with integrated CSS.
    - Normalizer: Normalizes a URL, including query parameter sorting.
- [VariableInfo](https://github.com/Mistralys/application-utils/wiki/VariableInfo): Information on any PHP variable types with string conversion.
- XMLHelper: Simplifies working with some XML libraries like DOM or SimpleXML.
    - HTMLLoader: Easy loading of HTML fragments or whole documents.
    - DOMErrors: LibXML parsing errors made easy with OO interface.
    - LibXML: Constants for all LibXML validation errors.
    - SimpleXML: Wrapper for SimpleXML with a number of utility methods.
    - Converter: Convert XML/HTML to arrays and json.
- ZIPHelper: Abstracts working with the ZIPArchive class.

Documentation
-------------

[](#documentation)

Documentation for the helper classes is ongoing in the [Application Utils Wiki](https://github.com/Mistralys/application-utils/wiki).

Origin
------

[](#origin)

These classes are still in use in a number of legacy applications. They were originally scattered over all of these applications, with their code diverging over time. This repository aims to consolidate them all into a single package to make it easier to maintain them.

As the legacy applications are still being maintained, this package is actively maintained and being modernized.

###  Health Score

55

—

FairBetter than 97% of packages

Maintenance73

Regular maintenance activity

Popularity38

Limited adoption so far

Community22

Small or concentrated contributor base

Maturity74

Established project with proven stability

 Bus Factor1

Top contributor holds 99% 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 ~26 days

Recently: every ~82 days

Total

89

Last Release

131d ago

Major Versions

1.9.1 → 2.0.02022-06-08

2.5.0 → 3.0.0-alpha12023-10-13

PHP version history (2 changes)1.4.0PHP &gt;=7.3

2.0.0PHP &gt;=7.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8895528?v=4)[Mistralys](/maintainers/Mistralys)[@Mistralys](https://github.com/Mistralys)

---

Top Contributors

[![Mistralys](https://avatars.githubusercontent.com/u/8895528?v=4)](https://github.com/Mistralys "Mistralys (1134 commits)")[![emre-ionos](https://avatars.githubusercontent.com/u/79832842?v=4)](https://github.com/emre-ionos "emre-ionos (12 commits)")

---

Tags

conversionfile-systemhelpers-librarylibraryphputilities-library

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/mistralys-application-utils/health.svg)

```
[![Health](https://phpackages.com/badges/mistralys-application-utils/health.svg)](https://phpackages.com/packages/mistralys-application-utils)
```

PHPackages © 2026

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