Skip to content

AlexandreClaerhout/php-rql-parser

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

php-rql-parser - Query MongoDB using RQL in PHP

Build Status Scrutinizer Code Quality Code Coverage Latest Stable Version Total Downloads Latest Unstable Version License

This is a wrapper around xiag-ag/rql-parser that combines that parser with a small layer of mongodb integration.

This package adheres to SemVer versioning. It will be considered stable after reaching 2.x since the initial 1.x release is considered rather buggy.

It uses a github version of git-flow in which new features and bugfixes must be merged to develop using a github pull request. It uses the standard git-flow naming conventions with the addition of a 'v' prefix to version tags.

Installation

Install it using composer.

composer require graviton/php-rql-parser

Usage

<?php

require 'vendor/autoload.php';

$rql = 'or(eq(name,foo)&eq(name,bar))';

/** @var \Doctrine\ODM\MongoDB\Query\Builder $builder */
$visitor = new \Graviton\Rql\Visitor\MongoOdm($builder);
$lexer = new \Xiag\Rql\Parser\Lexer;
$parser = \Xiag\Rql\Parser\Parser::createDefault();

// parse some Resource Query Language 
$rqlQuery = $parser->parse($lexer->tokenize($rql));

// get query
$query = $visitor->visit($rqlQuery)->getQuery();

// ...

Development

We welcome contributions on the develop branch.

About

A PHP RQL Parsing Library

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 99.6%
  • Shell 0.4%