Refactored cache drivers 🗃 (#1553)

* Refactored cache drivers 🗃

* Updated

* Update APCu.php

* Update APCu.php

* Update APCu.php

* Update APCu.php

* Update APCu.php

* Update Redis.php

* Update Redis.php

* Updated

* Update

* Updated

* Update config.php

* Updated

* Updated

* Updated

* Updated

* Update config.php

* Updated

* Update composer.lock

* Delete composer.lock

* Create composer.lock

* Update composer.lock

* Update common.php

* Update File.php

* Updated

* Update Sqlite.php

* Update common.php

* Update Redis.php

* Updated

* Update common.php

* Updated
This commit is contained in:
Roman Kelesidis 2024-07-22 14:55:04 +07:00 committed by GitHub
commit 17a320b7c8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
23 changed files with 1561 additions and 1066 deletions

View file

@ -129,24 +129,15 @@ switch ($bb_cfg['datastore_type']) {
case 'apcu':
$datastore = new TorrentPier\Legacy\Datastore\APCu($bb_cfg['cache']['prefix']);
break;
case 'memcache':
$datastore = new TorrentPier\Legacy\Datastore\Memcache($bb_cfg['cache']['memcache'], $bb_cfg['cache']['prefix']);
case 'memcached':
$datastore = new TorrentPier\Legacy\Datastore\Memcached($bb_cfg['cache']['memcached'], $bb_cfg['cache']['prefix']);
break;
case 'sqlite':
$default_cfg = [
'db_file_path' => $bb_cfg['cache']['db_dir'] . 'datastore.sqlite.db',
'pconnect' => true,
'con_required' => true,
];
$datastore = new TorrentPier\Legacy\Datastore\Sqlite($default_cfg, $bb_cfg['cache']['prefix']);
$datastore = new TorrentPier\Legacy\Datastore\Sqlite($bb_cfg['cache']['db_dir'] . 'datastore', $bb_cfg['cache']['prefix']);
break;
case 'redis':
$datastore = new TorrentPier\Legacy\Datastore\Redis($bb_cfg['cache']['redis'], $bb_cfg['cache']['prefix']);
break;
case 'filecache':
default:
$datastore = new TorrentPier\Legacy\Datastore\File($bb_cfg['cache']['db_dir'] . 'datastore/', $bb_cfg['cache']['prefix']);