Download the PHP package aerospike/aerospike-php without Composer
On this page you can find all versions of the php package aerospike/aerospike-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package aerospike-php
Aerospike PHP 8+ Client (v1.0.0)
An Aerospike client library for PHP 8+.
PHP-Client Introduction
This is the documentation for the Aerospike PHP Client. The PHP client comprises of two essential components. Firstly, we have a robust PHP client written in Rust and a connection manager written in Go, serving as a shared resource among PHP processes. The connection manager daemon efficiently handles all requests and responses between the PHP processes and the Aerospike server.
Requirements
- PHP v8.1+
- Cargo
- Aerospike server
- Linux or Darwin
- PHPUnit v10
- Rustc >= v1.74
- Go Toolchain Go Toolchains - The Go Programming Language
- Protobuf Compiler protoc-gen-go command - google.golang.org/protobuf/cmd/protoc-gen-go - Go Packages
- ext-php-rs v0.12.0 github repository link NOTE: Please see instruction for setting up ext-php-rs for windows [here]
Setup
- Clone the PHP-Client repository
Setting up the Aerospike client connection manager:
Installing up the dependencies and Running the Aerospike Connection manager
- Make sure the go toolchain has been installed. Download the package from The Go Programming Language. Follow the steps to correctly install Go. NOTE: Ensure that the PATH variable has been updated with the GOBIN path.
-
Install protobuf compiler:
-
Change directory into php-client/aerospike-connection-manager
- Build and run the aerospike-connection-manager
NOTE: Please view the README.md in the php-client/aerospike-connection-manager
directory for more information about the setting up the aerospike-connection-manager and configuring the client policy.
Build and Install the PHP-Client
-
Check the php version
- Install and setup the Aerospike Aerospike server
-
To build and install the
PHP-Client
in the default paths run the makefile -
To build and install the
PHP-Client
in manually, run the following commands: - Once the build is successful copy the file from
target/release/libaerospike$(EXTENSION)
[$EXTENSION = .so for Linux and .dylib for Mac and Windows] to the PHP extension directory path. - Add
extension=libaerospike$(EXTENSION)
to yourphp.ini
file. - Run
phpunit tests/
to ensure the setup and build was successful.
NOTE: The Aerospike server must be running for the tests to run successfully.
Running your PHP Project
-
Running your PHP script:
- Before running your script pre-requisites are Aerospike connection manager and Aerospike Server must be running.
- Once the build is successful and all the pre-requisites are met, import the Aerospike namespace to your PHP script.
-
To connect to the Aerospike connection manager add:
- Run the php script If there are no Errors then you have successfully connected to the Aerospike DB.
NOTE: If the connection manager daemon crashes, you will have to manually remove the file /tmp/asld_grpc.sock
from its path.
- Configuring policies: Configuring Policies (Read, Write, Batch and Info) - These policies can be set via getters and setter in the php code. On creating an object of that policy class, the default values are initialized for that policy. For example:
Documentation
- Reference Documentation can be found [here] (https://aerospike.github.io/php-client/)
- Aerospike Documentation can be found here
Issues
If there are any bugs, feature requests or feedback -> please create an issue on GitHub. Issues will be regularly reviewed by the Aerospike Client Engineering Team.
Usage
The following is a very simple example of CRUD operations in an Aerospike database.
Batch Operations Examples:
For more detailed examples you can see the examples direcotry php-client/examples