Skip to content

Commit

Permalink
Optimize Memcached keys loading, Fix #25
Browse files Browse the repository at this point in the history
  • Loading branch information
RobiNN1 committed Sep 8, 2023
1 parent ab83077 commit 5ddb0d8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
use RobiNN\Pca\Dashboards\DashboardInterface;

class Admin {
public const VERSION = '1.6.0';
public const VERSION = '1.6.1';

/**
* @var array<string, DashboardInterface>
Expand Down
13 changes: 11 additions & 2 deletions src/Dashboards/Memcached/Compatibility/CommandTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,16 @@ private function commandName(string $command): string {
}

private function checkCommandEnd(string $command, string $buffer): bool {
return in_array($this->commandName($command), $this->no_end, true) ||
preg_match('/^('.implode('|', $this->with_end).')/imu', $buffer);
if (in_array($this->commandName($command), $this->no_end, true)) {
return true;
}

foreach ($this->with_end as $ending) {
if (str_ends_with($buffer, $ending."\r\n")) {
return true;
}
}

return false;
}
}

0 comments on commit 5ddb0d8

Please sign in to comment.