Download the PHP package liqueurdetoile/cakephp-fuse without Composer

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

Latest Stable Version Build Status Coverage Status license

Cakephp-fuse plugin for CakePHP

This plugin is a simple wrapper behavior around Fuse to implement fuzzy search within any model. Searches can only be performed on strings.

This behavior requires at least PHP 7.1 and can only be used with Cakephp 3.x and 4.x branches.

Installation

You can install this plugin into your CakePHP application using composer.

The recommended way to install composer packages is:

The plugin itself is only a behavior that can be attached to any model in the initialize method :

Behavior can also be attached on-the-fly as it does not require any additional initialize operations.

Usage

Basic usage

The behavior provides a fuse method on the model to get back a configured query. For convenience a custom finder is also available. The two following calls are totally equivalent :

When providing no additional options or configuration, fuzzy search will be applied to all string fields with default options. Any options accepted by Fuse are available. For instance, to restrict keys and tweak threshold (assuming there's a name field in Items data):

Persistent configuration

You can set up your model to always use a given persistent configuration set when using fuse. Is some options are also provided on-the-fly, they will be mixed with persistent ones and override the latter when conflicting.

Nested associations

The search can also be done in nested associations (only hasOne or BelongsTo) by using a dot separator with property name :

Autokeys detection

If no keys are provided in options, the model will consider each string field as a searchable key. This also works for any contained model in the query :

API cheatsheet

fuse(string $finder, array $options = [], \Cake\ORM\Query $query = null) : Query

Schedule the fuzzy search with finder keyword(s) on the results of the query and returns the query. If none is provided, the autokeys and default options will be applied only at runtime

find('fuse', array $options = [])

Convenient custom finder that relies on fuse method. To avoid any conflicts between regular query options and fuse options, expected options must follow this convention : ['filter' => <filter>, 'fuse' => [<fuseOption>:<value>, ...]]

getSearchableFields(): array

Returns the persistent defined keys for fuzzy search or populates them with autofields if none is set

setSearchableFields(array $fields = []): self Sets the persistent defined keys for fuzzy search

getFuseOptions(): array

Returns the current persistent options

setFuseOptions(array $options, bool $replace = false): self

Sets the persistent options. If keys are conflicting, provided value will override current value. If replace is set to true, all options will be replaced

There is some more advanced tools that can be found in behavior code.

CHANGELOG


All versions of cakephp-fuse with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1
cakephp/cakephp Version ^3.5|^4
loilo/fuse Version ^3.6
adbario/php-dot-notation Version ^2.2
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 liqueurdetoile/cakephp-fuse contains the following files

Loading the files please wait ....