PHPackages                             marklogic/mlphp - 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. marklogic/mlphp

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

marklogic/mlphp
===============

PHP Client for MarkLogic

v0.0.2(10y ago)97035[8 issues](https://github.com/marklogic/mlphp/issues)[1 PRs](https://github.com/marklogic/mlphp/pulls)1Apache-2.0HTMLPHP &gt;=5.3.0

Since Dec 1Pushed 8y ago11 watchersCompare

[ Source](https://github.com/marklogic/mlphp)[ Packagist](https://packagist.org/packages/marklogic/mlphp)[ Docs](http://github.com/marklogic/mlphp)[ RSS](/packages/marklogic-mlphp/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (4)Versions (4)Used By (1)

MLPHP
=====

[](#mlphp)

PHP API for MarkLogic
---------------------

[](#php-api-for-marklogic)

MLPHP is a PHP API for MarkLogic that makes it easy to store documents, manage document metadata, and create sophisticated search queries on a web server running PHP (version 5.4 or greater). The PHP classes communicate with the MarkLogic via the [MarkLogic REST API](http://developer.marklogic.com/learn/rest).

After installing MLPHP (see below), you can load documents into MarkLogic with just a couple lines of PHP code:

```
use MarkLogic\MLPHP;

$document = new MLPHP\Document($client);
$document->setContentFile('myfile.xml')->write('/myfile.xml');

```

Searching is just as easy:

```
use MarkLogic\MLPHP;

$search = new MLPHP\Search($client);
$results = $search->retrieve('cat');

```

More details are available in the examples described below.

Dependencies
------------

[](#dependencies)

- [MarkLogic 7 or later](http://developer.marklogic.com/products). Download the server, start it, and request a free [Developer or Express license](http://developer.marklogic.com/licensing) directly from the Admin UI on port 8001.
- PHP 5.4-or-later-enabled web server (e.g., Apache running PHP) with the following extension libraries (typically available by default)
    - DOM
    - cURL
    - XSL
- [MLPHP](https://github.com/marklogic/mlphp)
- [Composer](http://getcomposer.org).

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

[](#installation)

To add MLPHP to your project, simply add MLPHP as a Composer requirement in composer.json:

```
{
    "require": {
        "marklogic/mlphp" : "dev-master"
    }
}

```

And then, depending on how you installed Composer, run

```
% composer install

```

or

```
% php composer.phar install

```

API Documentation
-----------------

[](#api-documentation)

API docs are available [online](http://marklogic.github.io/mlphp). A copy is also provided inside the MLPHP repo under `api/docs`.

License
-------

[](#license)

MLPHP is licensed under the Apache License, Version 2.0 (see LICENSE.txt).

Status
------

[](#status)

MLPHP is in early-stage development, but ready for use. The API is subject to change.

Examples
--------

[](#examples)

MLPHP examples are being revised.

Development
-----------

[](#development)

### Building

[](#building)

```
% git clone git@github.com:marklogic/mlphp mlphp
% cd mlphp
% composer install

```

### To generate a clean set of new API docs from source

[](#to-generate-a-clean-set-of-new-api-docs-from-source)

1. Update master branch

    ```
     % cd $PATH_TO_MLPHP/mlphp/api/docs
     % git rm -rf *
     % cd $PATH_TO_MLPHP/mlphp/
     % vendor/bin/phpdoc mlphp.ini
     % cd $PATH_TO_MLPHP/mlphp/api/docs
     % git add .
     % git commit -a -m "New docs"
     % git push origin master

    ```
2. Update gh-pages copy (Technique borrowed from )

    ```
     % cd $PATH_TO_MLPHP/mlphp/api

    ```

    If this is the first time,

    ```
     % git clone -b gh-pages \
         --single-branch git@github.com:marklogic/mlphp docs-ghpages

    ```

    Then...

    ```
     % cd $PATH_TO_MLPHP/mlphp/api/docs-ghpages
     % git rm -rf [a-z]*
     % cd $PATH_TO_MLPHP/mlphp
     % vendor/bin/phpdoc mlphp-ghpages.ini
     % cd PATH_TO_MLPHP/mlphp/api/docs-ghpages
     % git add .
     % git commit -a -m "New docs"
     % git push origin gh-pages

    ```

### Unit tests

[](#unit-tests)

Unit tests can be found under `tests`. To run,

1. Edit `phpunit-config.php` and set configuration variables specific to your MarkLogic setup.
2. Run the tests:

    ```
     % vendor/bin/phpunit tests

    ```

MLPHP uses [PHPUnit](https://phpunit.de) for testing. See the tests [README.md](https://github.com/marklogic/mlphp/blob/dev/tests/README.md) for more.

### Contributing

[](#contributing)

You can request a new feature by submitting an issue to the project's \[GitHub Issue Tracker\] ().

Please submit [pull requests](https://help.github.com/articles/using-pull-requests/) to the `develop` branch.

Copyright
---------

[](#copyright)

Copyright 2002-2015 MarkLogic Corporation. All Rights Reserved.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance2

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

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

###  Release Activity

Cadence

Every ~22 days

Total

2

Last Release

3790d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/515b00d4d9f2266a5cd0a5415604a53d5cc304c2adeae059e1d06062fcf9d3c9?d=identicon)[wooldridge](/maintainers/wooldridge)

![](https://www.gravatar.com/avatar/95de58585966c09e848dd98438d76293623ff4fe4a3dff1f6307e81bc1645b4c?d=identicon)[eedeebee](/maintainers/eedeebee)

---

Top Contributors

[![wooldridge](https://avatars.githubusercontent.com/u/477757?v=4)](https://github.com/wooldridge "wooldridge (314 commits)")[![eedeebee](https://avatars.githubusercontent.com/u/178357?v=4)](https://github.com/eedeebee "eedeebee (58 commits)")

---

Tags

marklogicphpsearchdatabasenosqlmarklogic

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/marklogic-mlphp/health.svg)

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

###  Alternatives

[cycle/database

DBAL, schema introspection, migration and pagination

64690.9k31](/packages/cycle-database)[cubettech/lacassa

Cassandra based query builder for laravel.

358.5k](/packages/cubettech-lacassa)[soosyze/queryflatfile

The Queryflatfile is PHP library for simple database not SQL

181.0k1](/packages/soosyze-queryflatfile)

PHPackages © 2026

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