Exemplo n.º 1
0
            echo "Scan Failed";
        }
        $db->close();
    } else {
        echo "Aerospike DB connection is not established";
    }
});
$app->get('/scanApply', function () use($db, $LUA_DIR) {
    if ($db->isConnected()) {
        $status = $db->register($LUA_DIR . "/test_record_udf.lua", "test_record_udf.lua");
        if ($status != Aerospike::OK) {
            echo "UDF register failed\n";
            $db->close();
            exit(0);
        }
        $status = $db->scanApply("test", "demo", "test_record_udf", "bin_udf_operation_integer", array('age', 1, 2), $scan_id);
        if ($status != Aerospike::OK) {
            echo "Scan Apply Failed";
            break;
        }
        $status = $db->scanInfo($scan_id, $scan_info);
        if ($status != Aerospike::OK) {
            echo "Scan Info Failed";
            break;
        }
        var_dump($scan_info);
        $db->close();
    } else {
        echo "Aerospike DB connection is not established";
    }
});