Skip to content

Commit

Permalink
Update PHPMem.php
Browse files Browse the repository at this point in the history
  • Loading branch information
RobiNN1 committed Nov 25, 2024
1 parent 5b162c6 commit d749014
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/Dashboards/Memcached/PHPMem.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class PHPMem {
private array $allowed_commands = [
'set', 'add', 'replace', 'append', 'prepend', 'cas', 'get', 'gets', 'gat', 'gats',
'touch', 'delete', 'incr', 'decr', 'stats', 'flush_all', 'version', 'lru_crawler',
'lru', 'slabs', 'me', 'mg', 'ms', 'md', 'ma', 'cache_memlimit', 'verbosity',
'lru', 'slabs', 'me', 'mg', 'ms', 'md', 'ma', 'cache_memlimit', 'verbosity', 'quit',
];

/**
Expand All @@ -29,7 +29,7 @@ class PHPMem {
* @var array<int, string>
*/
private array $no_end = [
'incr', 'decr', 'version', 'me', 'mg', 'ms', 'md', 'ma', 'cache_memlimit',
'incr', 'decr', 'version', 'me', 'mg', 'ms', 'md', 'ma', 'cache_memlimit', 'quit',
];

/**
Expand Down Expand Up @@ -299,4 +299,11 @@ private function checkCommandEnd(string $command, string $buffer): bool {

return false;
}

/**
* @throws MemcachedException
*/
public function __destruct() {
$this->runCommand('quit');
}
}

0 comments on commit d749014

Please sign in to comment.