Version 4.7.0
This commit is contained in:
1 parent
517a5e1f70
commit
8ba7d43898
1933 files changed
+65613
-11332
No files matched your search
+14
-2
@@ -381,6 +381,18 @@ class _Redis
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Publish a message to Redis PubSub
|
||||
*
|
||||
* @param string $key The message key
|
||||
* @param mixed $value The payload
|
||||
* @param boolean $encrypted Should the payload be encrypted? Has no effect in non-CiC environments.
|
||||
*/
|
||||
public function publish( string $key, $value=array(), bool $encrypted=FALSE ) :int
|
||||
{
|
||||
return $this->connection('write')->publish( $key, $this->encode($value, $encrypted) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Increments the score of a member from a sorted set by a given amount.
|
||||
* Overloaded here so it can be logged and a ttl set
|
||||
@@ -429,9 +441,9 @@ class _Redis
|
||||
* @param mixed $value Value
|
||||
* @return string
|
||||
*/
|
||||
public function encode( $value )
|
||||
public function encode( $value, $encryptIfCic=TRUE )
|
||||
{
|
||||
if ( \IPS\CIC )
|
||||
if ( \IPS\CIC && $encryptIfCic )
|
||||
{
|
||||
return \IPS\Text\Encrypt::fromPlaintext( json_encode( $value ) )->tag();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user