PHPackages                             ronappleton/tile38-php-client - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. ronappleton/tile38-php-client

ActiveLibrary[Database &amp; ORM](/categories/database)

ronappleton/tile38-php-client
=============================

A php client for the Tile38 Ultra Fast Geospatial Database

v1.1.0(3d ago)31MITPHPPHP &gt;=8.1CI failing

Since Aug 14Pushed 3d ago1 watchersCompare

[ Source](https://github.com/ronappleton/tile38-php-client)[ Packagist](https://packagist.org/packages/ronappleton/tile38-php-client)[ RSS](/packages/ronappleton-tile38-php-client/feed)WikiDiscussions master Synced today

READMEChangelog (2)Dependencies (5)Versions (3)Used By (0)

tile38-php-client
=================

[](#tile38-php-client)

A php client for the Tile38 Ultra Fast Geospatial Database

[![License](https://camo.githubusercontent.com/bc0b63e84feb715b0f6d7931dbf5603ba0be1f8ace2e2178f9e6511c3c9bbc50/687474703a2f2f706f7365722e707567782e6f72672f726f6e6170706c65746f6e2f74696c6533382d7068702d636c69656e742f6c6963656e7365)](https://packagist.org/packages/ronappleton/tile38-php-client)[![PHP Version Require](https://camo.githubusercontent.com/83549782712f40ab6f344fc04fafe37fe79aeebc9f53114938be002f851bc2a8/687474703a2f2f706f7365722e707567782e6f72672f726f6e6170706c65746f6e2f74696c6533382d7068702d636c69656e742f726571756972652f706870)](https://packagist.org/packages/ronappleton/tile38-php-client)[![Codacy Badge](https://camo.githubusercontent.com/96017b3dd84d89e6d2e6875554ec0df44f999a6ee64e96ba0f3f99ea04a5e425/68747470733a2f2f6170702e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f3731623662663066313862373433666339376536666561646334326537613161)](https://www.codacy.com/gh/ronappleton/tile38-php-client/dashboard?utm_source=github.com&utm_medium=referral&utm_content=ronappleton/tile38-php-client&utm_campaign=Badge_Grade)

GeoJSON objects are provided by the [php-geojson](https://github.com/ronappleton/php-geojson) object builder, which is a dependency of this package.

Installation
------------

[](#installation)

```
composer require ronappleton/tile38-php-client
```

This library requires PHP &gt;= 8.1 and the `ext-redis` extension.

Usage
-----

[](#usage)

```
use RonAppleton\GeoJson\Enums\GeoJsonType;
use RonAppleton\GeoJson\Objects\Factory;
use Ronappleton\Tile38PhpClient\Clients\Tile38;
use Ronappleton\Tile38PhpClient\Commands\Objects\GeoJson;
use Ronappleton\Tile38PhpClient\Commands\Objects\Point;
use Ronappleton\Tile38PhpClient\Enums\SearchType;

$client = new Tile38('127.0.0.1', 9851);

// Set a point.
$client->set('fleet', 'truck1', Point::make(33.5123, -112.2693))->execute();

// Set a GeoJSON object built with php-geojson.
$point = Factory::make(GeoJsonType::Point);
$point->setPoints(-112.2693, 33.5123);

$client->set('cities', 'tempe', GeoJson::make($point))->execute();

// Search with options.
$client->nearby('fleet', Point::make(33.462, -112.268, 6000))
    ->limit(10)
    ->distance()
    ->points()
    ->execute();

// Create a geofenced pub/sub channel.
$client->setchan('warehouse', SearchType::Nearby, 'fleet', Point::make(33.5123, -112.2693, 500))
    ->fence()
    ->detect('enter,exit')
    ->execute();
```

Commands Covered
----------------

[](#commands-covered)

The **Since** column is the first Tile38 release the command is known to work with. The integration test suite (see below) verifies every implemented command against Tile38 `1.13.0`, `1.17.0`, `1.22.0`, `1.25.0`, `1.30.0`, `1.33.0` and `1.38.0`.

GroupCommand NameCommandSinceChannelsCHANS✅1.13.0ChannelsDELCHAN✅1.13.0ChannelsPDELCHAN✅1.13.0ChannelsPSUBSCRIBE✅1.13.0ChannelsSETCHAN✅1.13.0ChannelsSUBSCRIBE✅1.13.0---------------------------------ConnectionAUTH✅1.0.0ConnectionOUTPUT✅1.1.0ConnectionPING✅1.0.0ConnectionQUIT✅1.0.0ConnectionTIMEOUT✅1.17.0---------------------------------KeysBOUNDS✅1.3.0KeysDEL✅1.0.0KeysDROP✅1.0.0KeysEXISTS✅1.33.0KeysEXPIRE✅1.0.0KeysFEXISTS✅1.33.0KeysFGET✅1.33.0KeysFSET✅1.0.0KeysGET✅1.0.0KeysJDEL✅1.7.0KeysJGET✅1.7.0KeysJSET✅1.7.0KeysKEYS✅1.0.0KeysPDEL✅1.7.0KeysPERSIST✅1.0.0KeysRENAME✅1.14.5KeysRENAMENX✅1.14.5KeysSET✅1.0.0KeysSTATS✅1.0.0KeysTTL✅1.0.0---------------------------------ScriptingEVAL✅1.10.0ScriptingEVALNA✅1.10.0ScriptingEVALNASHA✅1.10.0ScriptingEVALRO✅1.10.0ScriptingEVALROSHA✅1.10.0ScriptingEVALSHA✅1.10.0ScriptingSCRIPT EXISTS✅1.10.0ScriptingSCRIPT FLUSH✅1.10.0ScriptingSCRIPT LOAD✅1.10.0---------------------------------SearchINTERSECTS✅1.0.0SearchNEARBY✅1.0.0SearchSCAN✅1.0.0SearchSEARCH✅1.4.2SearchWITHIN✅1.0.0ServerCONFIG GET✅1.0.0ServerCONFIG REWRITE✅1.0.0ServerCONFIG SET✅1.0.0ServerFLUSHDB✅1.0.0ServerGC✅1.0.0ServerHEALTHZ✅1.24.1ServerINFO✅1.0.0ServerREADONLY✅1.0.0ServerROLE✅1.32.0ServerSERVER✅1.0.0---------------------------------ReplicationAOF✅1.0.0ReplicationAOFMD5✅1.0.0ReplicationAOFSHRINK✅1.0.0ReplicationFOLLOW✅1.0.0---------------------------------WebhooksDELHOOK✅1.0.0WebhooksHOOKS✅1.0.0WebhooksPDELHOOK✅1.0.0WebhooksSETHOOK✅1.0.0---------------------------------UtilityTEST✅1.16.0UtilityRAW✅-`RAW` is a client-side passthrough for sending arbitrary commands and is not a Tile38 command.

### Version notes

[](#version-notes)

Options and features gated by Tile38 version:

Option / featureSince`WITHFIELDS` on GET1.1.0`EX` / `STRING` on SET1.3.0`NX` / `XX` on SET1.5.0`WHEREIN` clause1.10.0`WHEREEVAL` clause1.11.0`CLIP` (search)1.13.0`HEALTHZ` command1.24.1`CLIPBY` (search)1.25.0`SECTOR` area format1.26.0`BUFFER` (WITHIN / INTERSECTS)1.27.0WHERE filter expressions (`>`, `
