Solutions

MarkLogic Data Hub Service

Fast data integration + improved data governance and security, with no infrastructure to buy or manage.

Learn More

Learn

Stay On Top Of Everything MarkLogic

Be the first to know! News, product information, and events delivered straight to your inbox.

Sign Me Up

Community

Stay On Top Of Everything MarkLogic

Be the first to know! News, product information, and events delivered straight to your inbox.

Sign Me Up

Company

Stay On Top Of Everything MarkLogic

Be the first to know! News, product information, and events delivered straight to your inbox.

Sign Me Up

MarkLogic Labs PHP API

by Mike Wooldridge

Attention PHP developers!

MLPHP

You can now build powerful search applications in PHP using MarkLogic Server with a new, open source PHP API, called MLPHP. The API makes it easy for PHP developers to store documents, manage document metadata, and create sophisticated search queries on a web server running PHP 5.3 or later. It communicates with MarkLogic using the server's REST API, available in MarkLogic 6 or later.

The PHP API is available for download at GitHub. See the INSTALL.txt file to get started and then check out the API Docs. After installing the PHP API, you can load documents into MarkLogic with just a couple lines of PHP code:

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

Searching is just as easy:

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

MLPHP is new and is a work-in-progress. If you have questions or want to provide some feedback, you can join in and give us a holler at general@developer.marklogic.com, file issues at GitHub, or drop me a line directly at mike.wooldridge AT marklogic dot com.

To download MarkLogic Server and use the free Express license, go here.

(If you want to build applications in Java, MarkLogic also has a great Java API.)

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.

Comments

The commenting feature on this page is enabled by a third party. Comments posted to this page are publicly visible.