CakeFest 2024: The Official CakePHP Conference

Memcached::setSaslAuthData

(PECL memcached >= 2.0.0)

Memcached::setSaslAuthData認証用の資格情報を設定する

説明

public Memcached::setSaslAuthData(string $username, string $password): bool

Memcached::setSaslAuthData() は、ユーザー名とパスワードを設定します。 これらを、memcache サーバーでの SASL 認証に使います。

このメソッドを使えるのは、memcached 拡張モジュールを SASL サポートつきでビルドしたときだけです。 その方法については Memcached のインストール/設定 を参照ください。

パラメータ

username

認証で使うユーザー名。

password

認証で使うパスワード。

戻り値

成功した場合に true を、失敗した場合に false を返します。

add a note

User Contributed Notes 1 note

up
4
me at koen dot pt
9 years ago
When using setSaslAuthData(), it's a good change you'll get the following warning:

Warning: Memcached::setSaslAuthData(): SASL is only supported with binary protocol in test.php on line 8

To enable binary protocol you'll have to set the Memcached::OPT_BINARY_PROTOCOL option to true:

<?php
$mc
->setOption(Memcached::OPT_BINARY_PROTOCOL, true);
?>
To Top