GithubHelp home page GithubHelp logo

seongbae-ml / mlphp Goto Github PK

View Code? Open in Web Editor NEW

This project forked from marklogic-community/mlphp

0.0 2.0 0.0 3.24 MB

PHP Connector for MarkLogic REST API

Home Page: http://marklogic.github.com/mlphp

License: Apache License 2.0

PHP 18.67% XQuery 0.13% HTML 81.04% CSS 0.16%

mlphp's Introduction

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.

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

  • 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:

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

And then, depending on how you installed Composer, run

% composer install

or

% php composer.phar install

API Documentation

API docs are available online. A copy is also provided inside the MLPHP repo under api/docs.

License

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

Status

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

Examples

MLPHP examples are being revised.

Development

Building

% git clone [email protected]:marklogic/mlphp mlphp
% cd mlphp
% composer install

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 https://gist.github.com/825950)

     % cd $PATH_TO_MLPHP/mlphp/api
    

    If this is the first time,

     % git clone -b gh-pages \
         --single-branch [email protected]: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 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 for testing. See the tests README.md for more.

Contributing

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

Please submit pull requests to the develop branch.

Copyright

Copyright 2002-2015 MarkLogic Corporation. All Rights Reserved.

mlphp's People

Contributors

eedeebee avatar wooldridge avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.