fle-php
Field-Level Encryption with the Couchbase PHP SDK — CryptoManager setup, encrypting and decrypting document fields
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Field-Level Encryption with the Couchbase PHP SDK — CryptoManager setup, encrypting and decrypting document fields
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Couchbase SDK error handling — UnambiguousTimeoutException vs AmbiguousTimeoutException, DocumentNotFoundException, CasMismatchException, DurabilityImpossibleException, SDK debug logging, sdk-doctor connectivity diagnostics, retryable vs non-retryable errors, circuit breaker, error best practices
Couchbase SDK patterns for Rust — CAS optimistic locking, retry on CasMismatch, tokio bulk operations with join_all/FuturesUnordered, atomic counters, sub-document (MutateInSpec/LookupInSpec), array operations, exists, replica reads, touch/getAndTouch, preserve_expiry, error handling
Configure and optimize Couchbase SDK connections in Rust — async/tokio cluster setup, singleton pattern, wait_until_ready, timeouts, KV CRUD (upsert/insert/get/replace/remove), expiry, durability, sub-document operations
SQL++ queries with the Couchbase Rust SDK — scope.query, cluster.query, positional and named parameters, scan consistency, deserializing rows into structs, DML (INSERT/UPDATE/DELETE/UPSERT), MutationState RYOW
Testing Couchbase Rust applications — unit testing with mockall, integration testing with testcontainers-rs, scope/collection isolation
Distributed ACID transactions are not supported by the Couchbase Rust SDK 1.x — alternatives and workarounds
| name | fle-php |
| summary | Field-Level Encryption with the Couchbase PHP SDK — CryptoManager setup, encrypting and decrypting document fields |
| description | Field-Level Encryption with the Couchbase PHP SDK — CryptoManager setup, encrypting and decrypting document fields |
| compatibility | PHP SDK 4.x. couchbase/couchbase-encryption Composer package required. |
| metadata | {"last_verified":"2026-05","min_server_version":"6.0","handoff":[{"condition":"user asks about FLE concepts or supported SDKs","skill":"fle"},{"condition":"user asks about connection setup","skill":"server-connection-php"}]} |
composer require couchbase/couchbase-encryption
use Couchbase\ClusterOptions;
use Couchbase\Cluster;
use CouchbaseEncryption\AeadAes256CbcHmacSha512Provider;
use CouchbaseEncryption\DefaultCryptoManager;
use CouchbaseEncryption\InsecureKeyring;
$keyBytes = str_repeat("\x00", 64); // 64-byte key for AES-256
$keyring = new InsecureKeyring(['my-key-id' => $keyBytes]);
$provider = new AeadAes256CbcHmacSha512Provider($keyring);
$cryptoManager = new DefaultCryptoManager();
$cryptoManager->registerEncrypter('my-encrypter', $provider->encrypterForKey('my-key-id'));
$cryptoManager->registerDecrypter($provider->decrypter());
$options = new ClusterOptions();
$options->credentials('username', 'Password!123');
$options->cryptoManager($cryptoManager);
$cluster = new Cluster('couchbase://localhost', $options);
$collection = $cluster->bucket('myapp')->defaultCollection();
$doc = [
'name' => 'Alice',
'ssn' => '123-45-6789',
'credit_card' => '4111111111111111',
];
$upsertOptions = new \Couchbase\UpsertOptions();
$upsertOptions->encryptFields([
'ssn' => 'my-encrypter',
'credit_card' => 'my-encrypter',
]);
$collection->upsert('user::alice', $doc, $upsertOptions);
$result = $collection->get('user::alice');
$doc = $result->content();
// Decryption is automatic when cryptoManager is configured
echo $doc['ssn']; // "123-45-6789"
fle for full concept reference