| Command | Description | Supported | Tested | Class/Trait | Method |
|---|---|---|---|---|---|
| isConnected | A method to determine if a phpredis object thinks it's connected to a server. | ✅ | ✅ | Introspection | isConnected |
| getHost | Retrieve our host or unix socket that we're connected to. | ✅ | ✅ | Introspection | getHost |
| getPort | Get the port we're connected to. | ✅ | ✅ | Introspection | getPort |
| getDbNum | Get the database number phpredis is pointed to. | ✅ | ✅ | Introspection | getDbNum |
| getTimeout | Get the (write) timeout in use for phpredis. | ✅ | ✅ | Introspection | getTimeout |
| getReadTimeout | Get the read timeout specified to phpredis or FALSE if we're not connected. | ✅ | ✅ | Introspection | getReadTimeout |
| getPersistentID | Gets the persistent ID that phpredis is using. | ✅ | ✅ | Introspection | getPersistentID |
| getAuth | Get the password used to authenticate the phpredis connection. | ✅ | ✅ | Introspection | getAuth |
$valkey = new Valkey();
$valkey->connect('127.0.0.1', 6379);
$valkey->isConnected();
$valkey->getHost();
$valkey->getPort();
$valkey->getDbNum();
$valkey->getTimeout();
$valkey->getReadTimeout();
$valkey->getPersistentID();
$valkey->getAuth();Description: A method to determine if a valkey-php object thinks it's connected to a server
None
Boolean Returns TRUE if valkey-php thinks it's connected and FALSE if not
Description: Retrieve our host or unix socket that we're connected to
None
Mixed The host or unix socket we're connected to or FALSE if we're not connected
Description: Get the port we're connected to
None
Mixed Returns the port we're connected to or FALSE if we're not connected
Description: Get the database number valkey-php is pointed to
None
Mixed Returns the database number (LONG) valkey-php thinks it's pointing to or FALSE if we're not connected
Description: Get the (write) timeout in use for valkey-php
None
Mixed The timeout (DOUBLE) specified in our connect call or FALSE if we're not connected
Description: Get the read timeout specified to valkey-php or FALSE if we're not connected
None
Mixed Returns the read timeout (which can be set using setOption and Valkey::OPT_READ_TIMEOUT) or FALSE if we're not connected
Description: Gets the persistent ID that valkey-php is using
None
Mixed Returns the persistent id valkey-php is using (which will only be set if connected with pconnect), NULL if we're not using a persistent ID, and FALSE if we're not connected
Description: Get the password (or username and password if using Valkey 6 ACLs) used to authenticate the connection.
None
Mixed Returns NULL if no username/password are set, the password string if a password is set, and a [username, password] array if authenticated with a username and password.