Manage UDFs - aerospike-community/aerospike-client-php GitHub Wiki

Manage UDFs

Use the following Aerospike PHP client APIs to manage User-Defined Functions (UDFs) on the server:

  • register()
  • deregister()
  • listRegistered()
  • getRegistered()
$status = $db->register('/path/to/my_udf.lua', 'my_udf');
if ($status == Aerospike::OK) {
    echo "UDF module at $path is registered as my_udf on the Aerospike DB.\n";
    $status = $db->listRegistered($modules);
    if ($status == Aerospike::OK) {
        var_dump($modules);
    }
} else {
    echo "Error[{$db->errorno()}]: ".$db->error();
}