PHPackages                             ibmi/mapepire - 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. [Database &amp; ORM](/categories/database)
4. /
5. ibmi/mapepire

ActiveLibrary[Database &amp; ORM](/categories/database)

ibmi/mapepire
=============

mapepire-php is a PHP client for the Mapepire database access layer for Db2 on IBM i.

212[1 issues](https://github.com/Mapepire-IBMi/mapepire-php/issues)[2 PRs](https://github.com/Mapepire-IBMi/mapepire-php/pulls)PHP

Since Aug 28Pushed 6mo ago4 watchersCompare

[ Source](https://github.com/Mapepire-IBMi/mapepire-php)[ Packagist](https://packagist.org/packages/ibmi/mapepire)[ RSS](/packages/ibmi-mapepire/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

mapepire-php
============

[](#mapepire-php)

`mapepire-php` is a PHP client for the [Mapepire](https://github.com/Mapepire-IBMi) database access layer for Db2 on IBM i.

⚠️ (WIP!) This Project is a work in progress, more features are coming
----------------------------------------------------------------------

[](#️-wip-this-project-is-a-work-in-progress-more-features-are-coming)

Summary
-------

[](#summary)

`mapepire-php` currently consists of two classes:

- `DaemonServer`
    - a structure for initializing an SQLJob
- `SQLJob`
    - the basic client which can connect, send a JSON request to the `mapepire-server`, and receive a response

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

[](#installation)

### From the repository

[](#from-the-repository)

- Clone the repository and use PHP Composer to do `composer install` to download the component packages.
- In your code `require_once('vendor/autoload.php');` will pull in the component packages along with `mapepire-php` classes.

### From Composer

[](#from-composer)

- To be implemented

Usage
=====

[](#usage)

Connecting to the Server
------------------------

[](#connecting-to-the-server)

There are four ways to instance 'SQLJob' and then connect:

1. Passing in an associative array containing authentication information
2. Passing in a `DaemonServer` object containing the authenication information
3. Passining in the path to a `.ini` file listing the authenication information
4. Create an empty instance and call `SQLJob::connect()` with one of the above passed in

### Connecting with an associate array

[](#connecting-with-an-associate-array)

The simplest and quickest way to connect to a server is to instance an `SQLJob` with a associative array as input: *Note: it is not recommended to set 'ignoreUnauthorized' to true in a live environment. See section on authentication information.*

```
require_once('vendor/autoload.php');

use Mapepire\SQLJob;

$creds = [
  'host' => "SERVER",
  'user' => "USER",
  'password' => "PASSWORD",
  'ignoreUnauthorized' => true,
];

$connection = new SQLJob($creds);

```

### Connecting with a DaemonServer object

[](#connecting-with-a-daemonserver-object)

A `DaemonServer` object can also be created in a similar fashion and passed in:

```
require_once('vendor/autoload.php');

use Mapepire\SQLJob;
use Mapepire\DaemonServer;

$ds = new DaemonServer(
    host: "SERVER",
    user: "USER",
    password: "PASSWORD",
    ignoreUnauthorized: true
);

$connection = newSQLJob($ds);

```

### Connecting with a `.ini` file

[](#connecting-with-a-ini-file)

A path to a `.ini` file can be passed into `SQLJob` while creating an instance:

Mapepire.ini:

```
[mapepire]
SERVER="SERVER"
USER="USER"
PASSWORD="PASSWORD"
IGNOREUNAUTHORIZED="TRUE"

```

PHP:

```
require_once('vendor/autoload.php');

use Mapepire\SQLJob;

$connection = new SQLJob("/path/to/file/Mapepire.ini");

```

Optionally, you may specify a particular section of a `.ini` file by passing a second argument:

PHP:

```
require_once('vendor/autoload.php');

use Mapepire\SQLJob;

$connection = new SQLJob("/path/to/file/Mapepire.ini", "mapepire");

```

### Connecting with `.connect()`

[](#connecting-with-connect)

A connection can also be made after instancing `SQLJob`, for example with a DaemonServer object:

```
require_once('vendor/autoload.php');

use Mapepire\SQLJob;
use Mapepire\DaemonServer;

$ds = new DaemonServer(
    host: "SERVER",
    user: "USER",
    password: "PASSWORD",
    ignoreUnauthorized: true
);

$connection = newSQLJob();

$connection->connect($ds);

```

Authentication Information
--------------------------

[](#authentication-information)

Regardless of connection method, the client performs authentication with information stored in a DaemonServer instance. The following may be passed for a connection:

1. host (required) - the host name of the server
2. username (required) - the user profile connecting to the server
3. password (required) - the password of the user profile
4. port (optional) - the server port, defaults to 8076
5. ignoreUnauthorized (optional) - a boolean value determining whether to ignore if a user in unauthorized, defaults to false
6. ca (optional) - the path to a certificate determining that a user is authorized. If (5) is false, this is required.

Getting a response
------------------

[](#getting-a-response)

The response comes in the form of a [`phrity/websocket`](https://github.com/sirn-se/websocket-php) `\WebSocket\Message\Text` object.

Use the `\WebSocket\Message\Text` instance method `getContent()` to get the JSON message content.

You may further more use any other `\WebSocket\Message\Text` instance method on the response to examine the response and help debug your code.

Querying the Server
-------------------

[](#querying-the-server)

This will be coming.

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

[](#documentation)

PHP Composer command `composer doc` will use phpDocumentor to generate the API documentation.

Tests
-----

[](#tests)

PHP Composer command `composer test` will run the test cases. Currently, the test cases are limited to instancing the classes. (WIP)

Asynchronous support
--------------------

[](#asynchronous-support)

This will be coming.

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance36

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity19

Early-stage or recently created project

 Bus Factor1

Top contributor holds 71.4% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/1086900f03ade918f2e8086a8b1ee9592a385cf5e829d4c48d45e1ca6c0a3f0d?d=identicon)[ibmi](/maintainers/ibmi)

---

Top Contributors

[![jbh](https://avatars.githubusercontent.com/u/5510679?v=4)](https://github.com/jbh "jbh (10 commits)")[![jwoehr](https://avatars.githubusercontent.com/u/4604036?v=4)](https://github.com/jwoehr "jwoehr (2 commits)")[![ThePrez](https://avatars.githubusercontent.com/u/17914061?v=4)](https://github.com/ThePrez "ThePrez (2 commits)")

### Embed Badge

![Health badge](/badges/ibmi-mapepire/health.svg)

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

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k115.1M102](/packages/jdorn-sql-formatter)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.4k](/packages/illuminate-database)[mongodb/mongodb

MongoDB driver library

1.6k64.0M546](/packages/mongodb-mongodb)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

90340.3M211](/packages/ramsey-uuid-doctrine)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)

PHPackages © 2026

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