2017 © Pedro Peláez
 

library mlphp

PHP Client for MarkLogic

image

marklogic/mlphp

PHP Client for MarkLogic

  • Wednesday, February 7, 2018
  • by eedeebee
  • Repository
  • 12 Watchers
  • 9 Stars
  • 424 Installations
  • HTML
  • 1 Dependents
  • 0 Suggesters
  • 5 Forks
  • 7 Open issues
  • 4 Versions
  • 1 % Grown

The README.md

MLPHP

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., (*1)

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

use MarkLogic\MLPHP;

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

Searching is just as easy:, (*3)

use MarkLogic\MLPHP;

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

More details are available in the examples described below., (*4)

Dependencies

  • MarkLogic 7 or later. Download the server, start it, and request a free Developer or Express license 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
  • Composer.

Installation

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

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

And then, depending on how you installed Composer, run, (*6)

% composer install

or, (*7)

% php composer.phar install

API Documentation

API docs are available online. A copy is also provided inside the MLPHP repo under api/docs., (*8)

License

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

Status

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

Examples

MLPHP examples are being revised., (*11)

Development

Building

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

To generate a clean set of new API docs from source

  1. Update master branch, (*12)

    % 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 https://gist.github.com/825950), (*13)

    % cd $PATH_TO_MLPHP/mlphp/api

    If this is the first time,, (*14)

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

    Then..., (*15)

    % 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 can be found under tests. To run,, (*16)

  1. Edit phpunit-config.php and set configuration variables specific to your MarkLogic setup.
  2. Run the tests:, (*17)

    % vendor/bin/phpunit tests

MLPHP uses PHPUnit for testing. See the tests README.md for more., (*18)

Contributing

You can request a new feature by submitting an issue to the project's [GitHub Issue Tracker] (https://github.com/marklogic/mlphp/issues)., (*19)

Please submit pull requests to the develop branch., (*20)

Copyright 2002-2015 MarkLogic Corporation. All Rights Reserved., (*21)

The Versions

07/02 2018

dev-develop

dev-develop http://github.com/marklogic/mlphp

PHP Client for MarkLogic

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Michael Wooldridge

database search nosql marklogic

23/12 2015

dev-master

9999999-dev http://github.com/marklogic/mlphp

PHP Client for MarkLogic

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Michael Wooldridge

database search nosql marklogic

23/12 2015

v0.0.2

0.0.2.0 http://github.com/marklogic/mlphp

PHP Client for MarkLogic

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Michael Wooldridge

database search nosql marklogic

01/12 2015

v0.0.1

0.0.1.0 http://github.com/marklogic/mlphp

PHP Client for MarkLogic

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Michael Wooldridge

database search nosql marklogic