first commit

This commit is contained in:
2024-10-25 23:02:37 +02:00
commit faeb2e52e8
7653 changed files with 1095335 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
<?
class RedisConnection {
private static $instance = null;
private $redis;
private function __construct() {
global $config;
$this -> redis = new \Redis();
if ( !$this -> redis -> connect( $config['redis']['host'], $config['redis']['port'] ) ) {
throw new Exception("Nie udało się połączyć z serwerem Redis.");
}
// Autentykacja za pomocą hasła
if ( !$this -> redis -> auth( $config['redis']['password'] ) ) {
}
}
public static function getInstance() {
if ( self::$instance === null ) {
self::$instance = new self();
}
return self::$instance;
}
public function getConnection() {
return $this->redis;
}
}