Skip to content
This repository was archived by the owner on May 6, 2026. It is now read-only.
libgravitonPublic archive

About

A PHP RQL Parsing Library

Resources

Stars

17 stars

Watchers

22 watching

Forks

Latest commit

 

History

423 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

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

This package adheres to SemVer versioning.

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();
$visitor->setBuilder($builder);
$lexer = new \Graviton\RqlParser\Lexer;
$parser = \Graviton\RqlParser\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

17 stars

Watchers

22 watching

Forks

Releases

Packages

Used by

Contributors

Languages