Skip to content

Commit eae0831

Browse files
committed
Redis cache: tidy up organisation, inline lock Lua script
1 parent 18f8237 commit eae0831

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+359
-188
lines changed

src/cache/src/ConfigProvider.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44

55
namespace Hypervel\Cache;
66

7-
use Hypervel\Cache\Console\CacheBenchmarkCommand;
8-
use Hypervel\Cache\Console\CacheDoctorCommand;
97
use Hypervel\Cache\Console\ClearCommand;
10-
use Hypervel\Cache\Console\PruneStaleTagsCommand;
8+
use Hypervel\Cache\Redis\Console\BenchmarkCommand;
9+
use Hypervel\Cache\Redis\Console\DoctorCommand;
10+
use Hypervel\Cache\Redis\Console\PruneStaleTagsCommand;
1111
use Hypervel\Cache\Contracts\Factory;
1212
use Hypervel\Cache\Contracts\Store;
1313
use Hypervel\Cache\Listeners\CreateSwooleTable;
@@ -27,9 +27,9 @@ public function __invoke(): array
2727
CreateTimer::class,
2828
],
2929
'commands' => [
30-
CacheBenchmarkCommand::class,
31-
CacheDoctorCommand::class,
30+
BenchmarkCommand::class,
3231
ClearCommand::class,
32+
DoctorCommand::class,
3333
PruneStaleTagsCommand::class,
3434
],
3535
'publish' => [

src/cache/src/LuaScripts.php

Lines changed: 0 additions & 27 deletions
This file was deleted.

src/cache/src/Console/Benchmark/BenchmarkContext.php renamed to src/cache/src/Redis/Console/Benchmark/BenchmarkContext.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace Hypervel\Cache\Console\Benchmark;
5+
namespace Hypervel\Cache\Redis\Console\Benchmark;
66

77
use Exception;
88
use Hyperf\Command\Command;

src/cache/src/Console/Benchmark/ResultsFormatter.php renamed to src/cache/src/Redis/Console/Benchmark/ResultsFormatter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace Hypervel\Cache\Console\Benchmark;
5+
namespace Hypervel\Cache\Redis\Console\Benchmark;
66

77
use Hyperf\Command\Command;
88
use Hypervel\Support\Number;

src/cache/src/Console/Benchmark/ScenarioResult.php renamed to src/cache/src/Redis/Console/Benchmark/ScenarioResult.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace Hypervel\Cache\Console\Benchmark;
5+
namespace Hypervel\Cache\Redis\Console\Benchmark;
66

77
/**
88
* Simple container for benchmark scenario results.

src/cache/src/Console/Benchmark/Scenarios/BulkWriteScenario.php renamed to src/cache/src/Redis/Console/Benchmark/Scenarios/BulkWriteScenario.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
declare(strict_types=1);
44

5-
namespace Hypervel\Cache\Console\Benchmark\Scenarios;
5+
namespace Hypervel\Cache\Redis\Console\Benchmark\Scenarios;
66

7-
use Hypervel\Cache\Console\Benchmark\BenchmarkContext;
8-
use Hypervel\Cache\Console\Benchmark\ScenarioResult;
7+
use Hypervel\Cache\Redis\Console\Benchmark\BenchmarkContext;
8+
use Hypervel\Cache\Redis\Console\Benchmark\ScenarioResult;
99

1010
/**
1111
* Tests bulk write (putMany) performance with tags.

src/cache/src/Console/Benchmark/Scenarios/CleanupScenario.php renamed to src/cache/src/Redis/Console/Benchmark/Scenarios/CleanupScenario.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
declare(strict_types=1);
44

5-
namespace Hypervel\Cache\Console\Benchmark\Scenarios;
5+
namespace Hypervel\Cache\Redis\Console\Benchmark\Scenarios;
66

7-
use Hypervel\Cache\Console\Benchmark\BenchmarkContext;
8-
use Hypervel\Cache\Console\Benchmark\ScenarioResult;
7+
use Hypervel\Cache\Redis\Console\Benchmark\BenchmarkContext;
8+
use Hypervel\Cache\Redis\Console\Benchmark\ScenarioResult;
99

1010
/**
1111
* Tests cleanup command performance after creating orphaned tags.

src/cache/src/Console/Benchmark/Scenarios/DeepTaggingScenario.php renamed to src/cache/src/Redis/Console/Benchmark/Scenarios/DeepTaggingScenario.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
declare(strict_types=1);
44

5-
namespace Hypervel\Cache\Console\Benchmark\Scenarios;
5+
namespace Hypervel\Cache\Redis\Console\Benchmark\Scenarios;
66

7-
use Hypervel\Cache\Console\Benchmark\BenchmarkContext;
8-
use Hypervel\Cache\Console\Benchmark\ScenarioResult;
7+
use Hypervel\Cache\Redis\Console\Benchmark\BenchmarkContext;
8+
use Hypervel\Cache\Redis\Console\Benchmark\ScenarioResult;
99

1010
/**
1111
* Tests deep tagging with a single tag across many items.

src/cache/src/Console/Benchmark/Scenarios/HeavyTaggingScenario.php renamed to src/cache/src/Redis/Console/Benchmark/Scenarios/HeavyTaggingScenario.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
declare(strict_types=1);
44

5-
namespace Hypervel\Cache\Console\Benchmark\Scenarios;
5+
namespace Hypervel\Cache\Redis\Console\Benchmark\Scenarios;
66

7-
use Hypervel\Cache\Console\Benchmark\BenchmarkContext;
8-
use Hypervel\Cache\Console\Benchmark\ScenarioResult;
7+
use Hypervel\Cache\Redis\Console\Benchmark\BenchmarkContext;
8+
use Hypervel\Cache\Redis\Console\Benchmark\ScenarioResult;
99

1010
/**
1111
* Tests heavy tagging with many tags per item.

src/cache/src/Console/Benchmark/Scenarios/NonTaggedScenario.php renamed to src/cache/src/Redis/Console/Benchmark/Scenarios/NonTaggedScenario.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
declare(strict_types=1);
44

5-
namespace Hypervel\Cache\Console\Benchmark\Scenarios;
5+
namespace Hypervel\Cache\Redis\Console\Benchmark\Scenarios;
66

7-
use Hypervel\Cache\Console\Benchmark\BenchmarkContext;
8-
use Hypervel\Cache\Console\Benchmark\ScenarioResult;
7+
use Hypervel\Cache\Redis\Console\Benchmark\BenchmarkContext;
8+
use Hypervel\Cache\Redis\Console\Benchmark\ScenarioResult;
99

1010
/**
1111
* Tests non-tagged cache operations (put, get, forget, remember, putMany, add).

0 commit comments

Comments
 (0)