Install predis

This commit is contained in:
Alex Thomassen 2023-11-23 23:23:43 +00:00
parent bbb248e681
commit 973fde7e36
Signed by: Alex
GPG Key ID: 10BD786B5F6FF5DE
4 changed files with 124 additions and 28 deletions

View File

@ -4330,7 +4330,7 @@ public static function macroCall($method, $parameters)
*/
public static function lock($name, $seconds = 0, $owner = null)
{
/** @var \Illuminate\Cache\FileStore $instance */
/** @var \Illuminate\Cache\RedisStore $instance */
return $instance->lock($name, $seconds, $owner);
}
/**
@ -4343,7 +4343,7 @@ public static function lock($name, $seconds = 0, $owner = null)
*/
public static function restoreLock($name, $owner)
{
/** @var \Illuminate\Cache\FileStore $instance */
/** @var \Illuminate\Cache\RedisStore $instance */
return $instance->restoreLock($name, $owner);
}
/**
@ -4354,54 +4354,76 @@ public static function restoreLock($name, $owner)
*/
public static function flush()
{
/** @var \Illuminate\Cache\FileStore $instance */
/** @var \Illuminate\Cache\RedisStore $instance */
return $instance->flush();
}
/**
* Get the full path for the given cache key.
* Remove all expired tag set entries.
*
* @param string $key
* @return string
* @return void
* @static
*/
public static function path($key)
public static function flushStaleTags()
{
/** @var \Illuminate\Cache\FileStore $instance */
return $instance->path($key);
/** @var \Illuminate\Cache\RedisStore $instance */
$instance->flushStaleTags();
}
/**
* Get the Filesystem instance.
* Get the Redis connection instance.
*
* @return \Illuminate\Filesystem\Filesystem
* @return \Illuminate\Redis\Connections\Connection
* @static
*/
public static function getFilesystem()
public static function connection()
{
/** @var \Illuminate\Cache\FileStore $instance */
return $instance->getFilesystem();
/** @var \Illuminate\Cache\RedisStore $instance */
return $instance->connection();
}
/**
* Get the working directory of the cache.
* Get the Redis connection instance that should be used to manage locks.
*
* @return string
* @return \Illuminate\Redis\Connections\Connection
* @static
*/
public static function getDirectory()
public static function lockConnection()
{
/** @var \Illuminate\Cache\FileStore $instance */
return $instance->getDirectory();
/** @var \Illuminate\Cache\RedisStore $instance */
return $instance->lockConnection();
}
/**
* Set the cache directory where locks should be stored.
* Specify the name of the connection that should be used to store data.
*
* @param string|null $lockDirectory
* @return \Illuminate\Cache\FileStore
* @param string $connection
* @return void
* @static
*/
public static function setLockDirectory($lockDirectory)
public static function setConnection($connection)
{
/** @var \Illuminate\Cache\FileStore $instance */
return $instance->setLockDirectory($lockDirectory);
/** @var \Illuminate\Cache\RedisStore $instance */
$instance->setConnection($connection);
}
/**
* Specify the name of the connection that should be used to manage locks.
*
* @param string $connection
* @return \Illuminate\Cache\RedisStore
* @static
*/
public static function setLockConnection($connection)
{
/** @var \Illuminate\Cache\RedisStore $instance */
return $instance->setLockConnection($connection);
}
/**
* Get the Redis database instance.
*
* @return \Illuminate\Contracts\Redis\Factory
* @static
*/
public static function getRedis()
{
/** @var \Illuminate\Cache\RedisStore $instance */
return $instance->getRedis();
}
/**
* Get the cache key prefix.
@ -4411,8 +4433,20 @@ public static function setLockDirectory($lockDirectory)
*/
public static function getPrefix()
{
/** @var \Illuminate\Cache\FileStore $instance */
/** @var \Illuminate\Cache\RedisStore $instance */
return $instance->getPrefix();
}
/**
* Set the cache key prefix.
*
* @param string $prefix
* @return void
* @static
*/
public static function setPrefix($prefix)
{
/** @var \Illuminate\Cache\RedisStore $instance */
$instance->setPrefix($prefix);
}
}

View File

@ -10,6 +10,7 @@
"laravel/framework": "^10.10",
"laravel/sanctum": "^3.3",
"laravel/tinker": "^2.8",
"predis/predis": "^2.2",
"socialiteproviders/twitch": "^5.3"
},
"require-dev": {

63
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "925e7ceab370510bc5aaa3e19f055941",
"content-hash": "36901d5853a460a1a7fe84c00fe5b7a6",
"packages": [
{
"name": "brick/math",
@ -2536,6 +2536,67 @@
],
"time": "2023-11-12T21:59:55+00:00"
},
{
"name": "predis/predis",
"version": "v2.2.2",
"source": {
"type": "git",
"url": "https://github.com/predis/predis.git",
"reference": "b1d3255ed9ad4d7254f9f9bba386c99f4bb983d1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/predis/predis/zipball/b1d3255ed9ad4d7254f9f9bba386c99f4bb983d1",
"reference": "b1d3255ed9ad4d7254f9f9bba386c99f4bb983d1",
"shasum": ""
},
"require": {
"php": "^7.2 || ^8.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.3",
"phpstan/phpstan": "^1.9",
"phpunit/phpunit": "^8.0 || ~9.4.4"
},
"suggest": {
"ext-relay": "Faster connection with in-memory caching (>=0.6.2)"
},
"type": "library",
"autoload": {
"psr-4": {
"Predis\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Till Krüss",
"homepage": "https://till.im",
"role": "Maintainer"
}
],
"description": "A flexible and feature-complete Redis client for PHP.",
"homepage": "http://github.com/predis/predis",
"keywords": [
"nosql",
"predis",
"redis"
],
"support": {
"issues": "https://github.com/predis/predis/issues",
"source": "https://github.com/predis/predis/tree/v2.2.2"
},
"funding": [
{
"url": "https://github.com/sponsors/tillkruss",
"type": "github"
}
],
"time": "2023-09-13T16:42:03+00:00"
},
{
"name": "psr/clock",
"version": "1.0.0",

View File

@ -160,7 +160,7 @@
'redis' => [
'client' => env('REDIS_CLIENT', 'phpredis'),
'client' => env('REDIS_CLIENT', 'predis'),
'options' => [
'cluster' => env('REDIS_CLUSTER', 'redis'),