PHP Classes


Recommend this page to a friend!
  Classes of Caleb   PHP Common Class Library   Download  
Role: Documentation
Content type: text/markdown
Description: Documentation
Class: PHP Common Class Library
Set of classes that provides common functionality
Author: By
Last change: Improve wording.
Add more information to readme.
Add number formatter.
Date: 3 years ago
Size: 5,980 bytes


Class file image Download

v1: PHP >= 5.4.0 v2: PHP >= 7.2.0 License: GPL v2

Common Classes Package.

The common classes package is intended to provide some of the classes that I originally wrote for common use by CIDRAM, phpMussel, etc as a separate, redistributable package, available to be readily integrated and used with other projects and packages via Composer.

All classes in the common classes package use the namespace Maikuolan\Common.

The common classes package currently contains the following classes: - Cache: A simple, unified cache handler used by CIDRAM and phpMussel for their caching needs. Currently, it supports APCu, Memcached, Redis, PDO, and flatfile caching. - ComplexStringHandler: The complex string handler class provides an easy way to iterate over the parts of a given string, identified by a given pattern, in order to execute a given closure to those parts of the given string, or to the glue that separates those parts. - DelayedIO: Provides an easy, simple solution for when needing to read and update a number of files, but delay rewriting the files for a while. - Demojibakefier: Intended to normalise the character encoding of a given string to a preferred character encoding when the given string's byte sequences don't match the expectations of the preferred character encoding. Useful in cases where a block of data might conceivably be composed of several different unspecified, unknown encodings. - L10N: Used by CIDRAM and phpMussel to handle L10N data, the L10N class reads in an array of L10N strings and provides some safe and simple methods for manipulating and returning those strings when needed, and for handling cardinal plurals, where integers and fractions are concerned alike, based upon the pluralisation rules specified by the L10N from a range of various pluralisation rules available, to be able to suit the needs of most known languages. - NumberFormatter: Used by CIDRAM and phpMussel to format numbers generated by their front-end pages, the class provides a more controllable, customisable mechanism for number formatting than PHP's internal number_format() function. - YAML: Used by CIDRAM and phpMussel to handle YAML data, the YAML class is a simple YAML handler intended to adequately serve the needs of the packages and projects where it is implemented. Note however, that isn't a complete YAML solution, instead supporting the YAML specification only to the bare minimum required by those packages and projects known to implement it, and I therefore can't guarantee that it'll necessarily be an ideal solution for other packages and projects, whose exact requirements I mightn't be familiar with.

How to install:

The recommended way to install it is by using Composer:

composer require maikuolan/common

You can, however, download the classes you need from this repository manually, if you want to do so.

After you've downloaded the package, or any needed classes, PSR-4 autoloading is preferred way to access the classes (particularly if you're using a large number of different, unrelated classes). If you're installing the package via Composer, all you have to do is require_once 'vendor/autoload.php'; and everything will be taken care of. Alternatively, if you're installing the package or its classes manually (or without Composer), or if you don't want to use a PSR-4 autoloader, you can simply require or include any needed classes into your projects by using an include or require statement in your code, to point to the needed classes in any PHP code that needs them.

How to use:

Other information:


Provided using the GNU General Public License version 2.0 (GPLv2).

For support:

Please use the issues page of this repository.

For contributors:

[\[\] Want to help?](

Current major version development status:

?Stage reached? ?Major version? | v1 | v2 | v3 ---|---|---|--- Pre-Alpha<em><br />- Exploring early concepts/ideas. No code written/available yet.</em> | ? | ? Alpha<em><br />- Branched, but unstable. Not production-ready (high risk if used).</em> | ? | ? Beta<em><br />- Branched, but unstable. Not production-ready (low risk if used).</em> | ? | ? Stable<em><br />- First production-ready version has been tagged/released.</em> | ? | ? Mature<em><br />- Multiple stable versions/releases exist.</em> | ? | ? Locked<em><br />- Still maintained, but new features won't be implemented anymore.</em> | EoL/Dead<em><br />- Not maintained anymore. If possible, stop using, and update ASAP.</em> |

Last Updated: 26 August 2019 (2019.08.26).