You've already forked Traefik-Redis-Api
46 lines
1.7 KiB
PHP
46 lines
1.7 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Siteworxpro\App\Facades;
|
|
|
|
use Illuminate\Support\Facades\Facade;
|
|
use Siteworxpro\App\Traefik\EntityEnum;
|
|
use Siteworxpro\App\Traefik\ProtocolEnum;
|
|
use Siteworxpro\App\Traefik\RedisClient as RedisClientConcrete;
|
|
|
|
/**
|
|
* Facade for RedisClient.
|
|
*
|
|
* This class provides a static interface to the RedisClientConcrete class.
|
|
*
|
|
* @method static void createOrReplace(string $name, array $data, EntityEnum $entity, ProtocolEnum $type = ProtocolEnum::HTTP) // @codingStandardsIgnoreLine
|
|
* @method static bool deleteAllKeys(string $name, EntityEnum $entity, ProtocolEnum $protocol = ProtocolEnum::HTTP)
|
|
* @method static array getAllMiddlewares(ProtocolEnum $protocol = ProtocolEnum::HTTP)
|
|
* @method static array getMiddleware(string $name, ProtocolEnum $protocol = ProtocolEnum::HTTP)
|
|
* @method static array getAllRouters(ProtocolEnum $protocol = ProtocolEnum::HTTP)
|
|
* @method static array getRouter(string $name, ProtocolEnum $protocol = ProtocolEnum::HTTP)
|
|
* @method static array getAllServices(ProtocolEnum $protocol = ProtocolEnum::HTTP)
|
|
* @method static array getService(string $name, ProtocolEnum $protocol = ProtocolEnum::HTTP)
|
|
*/
|
|
class RedisClient extends Facade
|
|
{
|
|
public static function getFacadeRoot(): RedisClientConcrete
|
|
{
|
|
if (self::$resolvedInstance !== null) {
|
|
$client = self::resolveFacadeInstance(self::getFacadeAccessor());
|
|
|
|
if ($client instanceof RedisClientConcrete) {
|
|
return $client;
|
|
}
|
|
}
|
|
|
|
return new RedisClientConcrete();
|
|
}
|
|
|
|
protected static function getFacadeAccessor(): string
|
|
{
|
|
return RedisClientConcrete::class;
|
|
}
|
|
}
|