Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/viest/PHP-FoundationDB
PHP FoundationDB Drive
https://github.com/viest/PHP-FoundationDB
extension foundationdb php php7
Last synced: 2 months ago
JSON representation
PHP FoundationDB Drive
- Host: GitHub
- URL: https://github.com/viest/PHP-FoundationDB
- Owner: viest
- Created: 2018-05-03T06:24:48.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-06-23T15:12:07.000Z (over 4 years ago)
- Last Synced: 2024-10-16T11:52:56.335Z (3 months ago)
- Topics: extension, foundationdb, php, php7
- Language: C
- Homepage:
- Size: 36.1 KB
- Stars: 37
- Watchers: 3
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-foundationdb - PHP
- awesome-php-extensions - PHP-FoundationDB - FoundationDB 客户端 (客户端)
README
# PHP-FoundationDB
[![Build Status](https://travis-ci.org/viest/PHP-FoundationDB.svg?branch=master)](https://travis-ci.org/viest/PHP-FoundationDB)
FoundationDB is a distributed database designed to handle large volumes of structured data across clusters of commodity servers. It organizes data as an ordered key-value store and employs ACID transactions for all operations. It is especially well-suited for read/write workloads but also has excellent performance for write-intensive workloads.
### Open Database
```php
$foundationClient = new \Foundation\Client();$database = $foundationClient
->connection('/usr/local/etc/foundationdb/fdb.cluster')
->database('DB');
```### Insert
#### Grammar
```php
bool set(string $key, string $value);
```#### Example
```php
$database->set('viest', json_encode([
'name' => 'JiexinWang',
'age' => 22
]));
```### Find
#### Grammar
```php
string get(string $key);
```#### Example
```php
$user = $database->get('viest');
```### Delete
#### Grammar
```php
bool clear(string $key);
```#### Example
```php
$database->clear('viest')
```### Range
#### Grammar
```php
array range(int $startIndex, int $endIndex);
```#### Example
```php
$rangeArray = $database->range(0, 2);
```