PHPackages                             nadirlc/utilities-framework - 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. [Templating &amp; Views](/categories/templating)
4. /
5. nadirlc/utilities-framework

AbandonedLibrary[Templating &amp; Views](/categories/templating)

nadirlc/utilities-framework
===========================

Set of Php classes providing utility functions

v1.0.0(7y ago)12GPL-3.0-or-laterPHPPHP ^7.2

Since Mar 20Pushed 7y agoCompare

[ Source](https://github.com/pakjiddat/utilities-framework)[ Packagist](https://packagist.org/packages/nadirlc/utilities-framework)[ Docs](https://www.pakjiddat.pk/articles/view/257/utilities-framework)[ RSS](/packages/nadirlc-utilities-framework/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (2)Used By (0)

[![Utilities Framework](https://camo.githubusercontent.com/71e2b158d1a6c4500e2d743098862f4e07fb06bf0675ae053b7d10b7e3e5aac9/68747470733a2f2f7777772e70616b6a69646461742e706b2f70616b6a69646461742f75692f696d616765732f636f64652d656469746f722e706e67)](https://camo.githubusercontent.com/71e2b158d1a6c4500e2d743098862f4e07fb06bf0675ae053b7d10b7e3e5aac9/68747470733a2f2f7777772e70616b6a69646461742e706b2f70616b6a69646461742f75692f696d616765732f636f64652d656469746f722e706e67)

### Introduction

[](#introduction)

The Utilities Framework is a set of Php libraries that provide functions such as error handling, logding, emailing, fetching web pages, script profiling, database abstraction, encryption, template engine and more. It requires Php 7.2 and above. The libraries are easy to use and can be used with custom applications and Php Frameworks

The Utilities Framework code is fully commented and compliant with the [PSR-2](https://www.php-fig.org/psr/psr-2/) coding guidelines.

### Features

[](#features)

The Utilities Framework has the following features:

1. ##### Database Management

    [](#database-management)

    It provides functions for working with Databases. It consists of a Query Builder, Database Cache Manager and Database Log Manager. It also provides a Database MetaQuery Runner and Database Transaction Manager, based on [PDO](http://php.net/manual/en/book.pdo.php)
2. ##### Method Validation

    [](#method-validation)

    This allows validating method parameter values against information in the method's Doc Block comments. This feature is provided by the [Comment Manager](/articles/view/254/comment-manager) package.
3. ##### Error Management

    [](#error-management)

    It allows application errors to be displayed using html template files. The template files can be easily customized. Default template files are provided for displaying formatted error messages for the browser and the command line
4. ##### File and Folder Management

    [](#file-and-folder-management)

    It provides functions for fetching url contents, checking if network connection works, searching for files with a folder and copying folder contents recursively
5. ##### Email Handling

    [](#email-handling)

    It provides functions for sending email in plain text format and html format with file attachments. It is based on the [Pear Mail](https://pear.php.net/package/Mail/) library and hence supports sending email using SMTP server, Php mail function and Sendmail library
6. ##### Log Management

    [](#log-management)

    It provides functions for saving and updating log data to database. It uses the PDO library for saving data and hence allows log data to be saved to all the databases that are supported by PDO
7. ##### Template Engine

    [](#template-engine)

    It provides a template engine that allows separating the html layout code from the data. It also allows templates to be built recursively. This means that a template can consist of one or more templates, which can contain more templates. This allows complex website layouts to be divided in to simple layout files that are automatically combined by the template engine
8. ##### Encryption

    [](#encryption)

    It provides function for encrypting and decrypting data using the new [LibSodium library](http://php.net/manual/en/book.sodium.php), which is part of Php &gt;=7.2
9. ##### String Utilities

    [](#string-utilities)

    It provides functions for exporting data to RSS format, converting relative urls to absolute, checking if string is valid JSON, HTML or Base64 encoded and more
10. ##### Profiler

    [](#profiler)

    It allows the memory usage and execution time to be measured between function calls
11. ##### Cache Manager

    [](#cache-manager)

    It allows data to be stored in a cache. It supports memory cache and database cache
12. ##### Authentication

    [](#authentication)

    It provides functions for authenticating users using http digest authentication

The following screenshot shows the error message displayed by the error handler component:

[![Error Handler Component](https://camo.githubusercontent.com/18f97e8a931b8f34e5b0d738ff96cf95e7c1de243ad39ca75b80508e1dd791e4/68747470733a2f2f7777772e70616b6a69646461742e706b2f70616b6a69646461742f75692f696d616765732f6572726f722d6d6573736167652e706e67)](https://camo.githubusercontent.com/18f97e8a931b8f34e5b0d738ff96cf95e7c1de243ad39ca75b80508e1dd791e4/68747470733a2f2f7777772e70616b6a69646461742e706b2f70616b6a69646461742f75692f696d616765732f6572726f722d6d6573736167652e706e67)

The following screenshot shows the MySQL query log displayed by the error handler component as part of the error:

[![MySQL Query Log](https://camo.githubusercontent.com/d04edea46e3882c1c847bfd3c96d7b10d2bcfc9ee57881d5746a878ecabeadfd/68747470733a2f2f7777772e70616b6a69646461742e706b2f70616b6a69646461742f75692f696d616765732f6d7973716c2d71756572792d6c6f672e706e67)](https://camo.githubusercontent.com/d04edea46e3882c1c847bfd3c96d7b10d2bcfc9ee57881d5746a878ecabeadfd/68747470733a2f2f7777772e70616b6a69646461742e706b2f70616b6a69646461742f75692f696d616765732f6d7973716c2d71756572792d6c6f672e706e67)

### Installation

[](#installation)

1. ##### Install using composer:

    [](#install-using-composer)

    Run the command: **composer require nadirlc/utilities-framework**

    **OR**
2. ##### Download from the [Utilities Framework GitHub Repository](https://github.com/nadirlc/utilities-framework)

    [](#download-from-the-utilities-framework-github-repository)

    Run the command: **git clone **

### Usage

[](#usage)

All components of the Utilities Framework can be accessed using factory functions. To use a feature, we need to first create an object of the relavant component. For example: **UtilitiesFramework::Factory("email", $parameters);**. To send an email the following code can be used:

```

/* The Email class requires Mail and Mail_Mime pear package */
include_once ("Mail.php");
include_once ("Mail/mime.php");

/* Change the from and to emails to your email address */
$from_email       = "nadir@dev.pakjiddat.pk";
$to_email         = "nadir@dev.pakjiddat.pk";
/** The parameters for the email object */
$parameters       = array("params" => "", "backend" => "mail");
/* The Email class object is fetched */
$email            = UtilitiesFramework::Factory("email", $parameters);
/** The email is sent */
$is_sent          = $email->SendEmail($from_email, $to_email, "Utilitiesframework Test",
                        "test html content",
                        null,
                        array("file-path")
                    );
/** If the email was sent, then information message is shown */
if ($is_sent) echo "Email was successfully sent";
else echo "Email could not be sent";

```

### Examples

[](#examples)

The **/examples** folder contains example usage for each component

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

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

2613d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/30418eda85a77af01f3f4ec162aa40f95a5f182fb6e70db2c8af8c0812d840ed?d=identicon)[pakjiddat](/maintainers/pakjiddat)

---

Tags

database-abstractiondocbloc-parseremail-senderlog-managertemplate-engineutility-classesdatabase abstractionlog managertemplate engineemail senderutility-classesdocbloc-parser

### Embed Badge

![Health badge](/badges/nadirlc-utilities-framework/health.svg)

```
[![Health](https://phpackages.com/badges/nadirlc-utilities-framework/health.svg)](https://phpackages.com/packages/nadirlc-utilities-framework)
```

###  Alternatives

[phptal/phptal

PHPTAL is a templating engine for PHP5 that implements Zope Page Templates syntax

179421.6k19](/packages/phptal-phptal)[foil/foil

PHP template engine for native PHP templates

170111.2k7](/packages/foil-foil)[proai/laravel-handlebars

A Laravel wrapper for LightnCandy for using the Handlebars (and Mustache) template engine.

38204.7k](/packages/proai-laravel-handlebars)[talesoft/tale-pug

A clean, lightweight and easy-to-use templating engine for PHP based on Pug, formerly Jade

319.4k3](/packages/talesoft-tale-pug)[wanze/template-engine-factory

Provides ProcessWire integration for various template engines such as Twig.

2612.0k4](/packages/wanze-template-engine-factory)[leitsch/kirby-blade

Enable Laravel Blade Template Engine for Kirby 4 and Kirby 5

219.2k](/packages/leitsch-kirby-blade)

PHPackages © 2026

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