Download the PHP package mnemesong/spex without Composer

On this page you can find all versions of the php package mnemesong/spex. 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 spex

mnemesong/spex

Latest Stable Version PHPUnit PHPStan-lvl9 PHP Version Require License


General description / Общее описание

ENG:

The package provides objects and an interface for expression of specifications (describes the conditions for fetching records from storage). For quick construction, use Sp::ex() builder.

RUS:

Пакет предоставляет объекты и интерфейс для выражения спецификаций (описывают услоние выборки записей из хранилища). Для быстрого построения используется билдер Sp::ex()


Requirements / Требования


Installation / Установка

composer require "mnemesong/spex"


Specifications / Спецификации

ENG:

Specifications allow you to specify a condition for searching or selecting records, including logically complex ones.

Specifier Sp::ex

The ex() method of class Sp allows you to quickly express any specification of various types. Its general syntax looks like as follows

Sp::ex(<spec character>, <column name>, <additional comparison parameter(column name, value or null)>);

Additional type parameter depends on the specification type. There are several types of specifications:


Array comparison specifications

They have the general form: Sp::ex(string <spec mark>, string <column name>, array <comparison array>)

Types of array comparison specifications:
Example:

Sp::ex("in", "age", [11, 22, 33, 44, 55])


Table column comparison specifications

Have a general form: Sp::ex(string <spec mark>, string <column name>, string <column name>)

Table column comparison specification types:
Example:

Sp::ex("cs<=", "contractsCount", "requestsCount")


Number Comparison Specifications

They have the general form: Sp::ex(string <spec character>, string <column name>, float|int|stringNumber <numerical value>)

Comparison specification types with numeric value:
Example:

Sp::ex("n=", "winsCount", "losesCount")


String comparison specifications

They have the general form: Sp::ex(string <spec character>, string <column name>, string <string value>)

Comparison specification types with string value:
Example:

Sp::ex("s=", "name", "Bob")


Unary Comparison Specifications

They have a general form: Sp::ex(string <spec mark>, string <column name>)

Unary comparison specification types:
Example:

Sp::ex("empty", "comment")


Complex compound specifications

They have the general form: Sp::ex(string <spec mark>, SpecificationInterface[] < array of child specifications>)

Types of complex compound specifications:
Example:

Sp::ex("and", [Sp::ex("!empty", "birthday"), Sp::ex("!empty", "age")])


Unary compound specifications

They have the general form: Sp::ex(string <spec mark>, SpecificationInterface <child specification>)

Unary compound specification types:
Example:

Sp::ex("!", Sp::ex("c=", "managerUuid", "customerUuid"))


RUS:

Спецификации позволяют указывать условие для поиска или отбора записей, в том числе логически сложные.

Выразитель спецификаций Sp::ex

Метод ex() класса Sp позволяет быстро выражать любые спецификации различных типов. Его общий синтаксис выгляди следующим образом

Sp::ex(<знак спецификации>, <имя колонки>, <доп. параметр сравнения(имя колонки, значеие или null)>);

Тип доп. параметра зависит от типа спецификации. Существует несколько типов спецификаций:


Спецификации сравнения с массивом

Имеют общий вид: Sp::ex(string <знак спецификации>, string <имя колонки>, array <массив сравнения>)

Типы спецификаций сравнения с массивом:
Пример:

Sp::ex("in", "age", [11, 22, 33, 44, 55])


Спецификации сравнения колонок таблицы

Имеют общий вид: Sp::ex(string <знак спецификации>, string <имя колонки>, string <имя колонки>)

Типы спецификаций сравнения колонок таблицы:
Пример:

Sp::ex("cs<=", "contractsCount", "requestsCount")


Спецификации сравнения c числовым значением

Имеют общий вид: Sp::ex(string <знак спецификации>, string <имя колонки>, float|int|stringNumber <числовое значение>)

Типы спецификаций сравнения c числовым значением:
Пример:

Sp::ex("n=", "winsCount", "losesCount")


Спецификации сравнения cо строковым значением

Имеют общий вид: Sp::ex(string <знак спецификации>, string <имя колонки>, string <строковое значение>)

Типы спецификаций сравнения cо строковым значением:
Пример:

Sp::ex("s=", "name", "Bob")


Спецификации унарного сравнения

Имеют общий вид: Sp::ex(string <знак спецификации>, string <имя колонки>)

Типы спецификаций унарного сравнения:
Пример:

Sp::ex("empty", "comment")


Сложные составные спецификации

Имеют общий вид: Sp::ex(string <знак спецификации>, SpecificationInterface[] <массив дочерних спецификаций>)

Типы сложных составных спецификаций:
Пример:

Sp::ex("and", [Sp::ex("!empty", "birthday"), Sp::ex("!empty", "age")])


Унарные составные спецификации

Имеют общий вид: Sp::ex(string <знак спецификации>, SpecificationInterface <дочерняя спецификация>)

Типы унарных составных спецификаций:
Пример:

Sp::ex("!", Sp::ex("c=", "managerUuid", "customerUuid"))



Converting Structures to Specifications / Преобразование структур в спецификации

ENG

The class Sp allows you to turn Structures into specifications. This is useful when you need to check in some repository the presence of records in many respects similar to a specific structure. Use the Sp::st()

method for this

Example

$struct = new Structure(['name' => 'Victoria', 'age' => 21]);
$spec = Sp::st($struct, 'and');
// The result will be equivalent to the following code:
$spec = Sp::ex('and', [
 Sp::ex('s=', 'name', 'Victoria')
 Sp::ex('s=', 'age', '21');
]);

RUS

Класс Sp позволяет превращать Структуры в спецификации. Это полезно когда нужно проверить в каком-то хранилище наличие записей по многим параметрам похожих на конкретную структуру. Используйте для этого метод Sp::st()

Пример

$struct = new Structure(['name' => 'Victoria', 'age' => 21]);
$spec = Sp::st($struct, 'and');
// Результат будет эквивалентен следующему коду:
$spec = Sp::ex('and', [
 Sp::ex('s=', 'name', 'Victoria')
 Sp::ex('s=', 'age', '21');
]);

License / Лицензия

- MIT

Contacts / Контакты

- Anatoly Starodubtsev "Pantagruel74" - [email protected]

All versions of spex with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
webmozart/assert Version 1.11.*
mnemesong/structure Version 0.4.*
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 mnemesong/spex contains the following files

Loading the files please wait ....