Download the PHP package railken/search-query without Composer

On this page you can find all versions of the php package railken/search-query. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package search-query

Search Query

Actions Status

Converts a simple expression (e.g. 'x eq 1 or y gt 2') into a tree object. This can be pretty usefull when building the API endpoint for a search.

Requirements

PHP 7.1 or later.

Composer

You can install it via Composer by typing the following command:

Demo

demo

Usage

A simple usage looks like this:

The result formatted in json of $result:

Nodes

Key node

All alphanumeric (starting with alphabetic character) are converted as . Other characters allowed:

Examples:

Value node

All numbers and strings are converted as . The delimiter of strings can be either or

Examples:

Group node

All round parenthesis create a group node . Of course a nested group can be made. If a parenthesis is missing an exception will be thrown

Examples:

AND, OR

This operators requires a before and after, otherwise an exception will be thrown.

Can be expressed as literals (and, or) or as symbols (&&, ||)

Important: If a parent group is defined and the LogicNode is the only child, the LogicNode will take the place of the GroupNode.

Examples:

EQ, NOT_EQ, GT, GTE, LT, LTE

All these operators requires or a before and afters. Can be expressed as literals (eq, not eq, gt, gte, lt, lte) or as symbols (=, !=, >, >=, < <=)

Examples:

Comparison can be also made between two keys

Examples:

CT, SW, EW

These operators will handle comparison with strings: contains, start with and end with.

Examples:

NULL, NOT NULL

These operators don't require a node after the operator.

Custom resolver

As you already saw, in order to parse the query you have to add the resolvers. So you are free to add any resolvers you want, but pay attention to the order: KeyValue and NodeValue are the foundation for all the resolvers, so be carefull.

Here's an example of custom resolver and node

CustomResolver.php

CustomNode.php

Remember to add the resolver when you're creating the instance of the parser

If you have a more complicated node to resolve simply add the method resolve to the CustomResolver.

Railken\SQ\Languages\BoomTree\Resolvers\CustomResolver

There is also a CustomResolver that works and cycle with all children and it's configurabile through a Closure, it's Railken\SQ\Languages\BoomTree\Resolvers\CustomResolver. For istance you could attach a prefix to all KeyNode doing this:

License

Open-source software licensed under the MIT license.


All versions of search-query with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1
railken/bag Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package railken/search-query contains the following files

Loading the files please wait ....