Download the PHP package ppshobi/psonic without Composer

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

Psonic - PHP client for sonic auto suggestion engine

codecov

.github/workflows/tests.yml

Summary

Sonic is a super fast auto-suggestion engine built by the team at crisp.chat, a customer engagement platform. it is built in Rust and they officially support a javascript client, but if you want to use sonic via PHP, this is the library that you can look for. Completely unit tested, and adheres to modern coding standards, and offers a clean API to interact with sonic.

Installation & Usage

you need a running sonic instance (locally or in the cloud, the port 1491 should be accessible) php7+ and composer to make this library work. Read more on installing sonic

Api Documentaion

Full API Documentaion

Usage

once you have psonic in place, you have access to the Client and Channel classes, Each channel instance requires a separate new client instance since sonic doesn't allow channel switching within the same connection. Read more about sonic concepts below

Indexing

To index few objects into the sonic use the following sample code, make sure you have a running instance of sonic on port 1491

Searching/AutoSuggestions

To search on the index using the following sample code

To get autosuggestions/autocomplete for a term from the index use the following sample code

Basic sonic Concepts

Sonic is more of an identifier index than a document index. Meaning, if the query matches some records it will be giving you the identifier of the matched object, than the object itself. Probably you will have to query the actual data store again with those keys. Check Basic Terminology used in sonic below as well. Read more on sonic repository

Channels

Sonic doesn't offer an HTTP endpoint as of now, rather it offers a TCP endpoint like Redis (They call it RESP protocol), and we call it channel. There are 3 kind of channels

Basic Terminology

Consider you are storing the chats of your customers from an e-commerce website.

Testing & Contribution

To run sonic in local, the best way is to use docker

Run below command in terminal. you should have a sonic instance running.

$ docker run -d -p 1491:1491 -v /path/to/sonic.cfg:/etc/sonic.cfg -v /path/to/sonic/data/store:/var/lib/sonic/store/ valeriansaliou/sonic:v1.1.9

Then do a git clone of this project

$ cd ~ && git clone https://github.com/ppshobi/psonic.git

then cd into the project directory and do a composer install

$ cd psonic && composer install

Use phpunit to run tests.

Feel free to send pull requests.


All versions of psonic with dependencies

PHP Build Version
Package Version
Requires php Version ^7.3|^8.0
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 ppshobi/psonic contains the following files

Loading the files please wait ....