mirror of
https://git.friendi.ca/friendica/friendica.git
synced 2025-06-07 20:04:32 +02:00
Make PHPCS happy
This commit is contained in:
parent
a20828f618
commit
50c720688b
6 changed files with 28 additions and 33 deletions
|
@ -16,10 +16,9 @@ use Friendica\Core\Cache\Exception\InvalidCacheDriverException;
|
||||||
*/
|
*/
|
||||||
class APCuCache extends AbstractCache implements ICanCacheInMemory
|
class APCuCache extends AbstractCache implements ICanCacheInMemory
|
||||||
{
|
{
|
||||||
const NAME = 'apcu';
|
|
||||||
|
|
||||||
use CompareSetTrait;
|
use CompareSetTrait;
|
||||||
use CompareDeleteTrait;
|
use CompareDeleteTrait;
|
||||||
|
const NAME = 'apcu';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @throws InvalidCacheDriverException
|
* @throws InvalidCacheDriverException
|
||||||
|
@ -156,10 +155,10 @@ class APCuCache extends AbstractCache implements ICanCacheInMemory
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'entries' => $apcu['num_entries'] ?? null,
|
'entries' => $apcu['num_entries'] ?? null,
|
||||||
'used_memory' => $apcu['mem_size'] ?? null,
|
'used_memory' => $apcu['mem_size'] ?? null,
|
||||||
'hits' => $apcu['num_hits'] ?? null,
|
'hits' => $apcu['num_hits'] ?? null,
|
||||||
'misses' => $apcu['num_misses'] ?? null,
|
'misses' => $apcu['num_misses'] ?? null,
|
||||||
'avail_mem' => $sma['avail_mem'] ?? null,
|
'avail_mem' => $sma['avail_mem'] ?? null,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,9 +15,8 @@ use Friendica\Core\Cache\Enum;
|
||||||
*/
|
*/
|
||||||
class ArrayCache extends AbstractCache implements ICanCacheInMemory
|
class ArrayCache extends AbstractCache implements ICanCacheInMemory
|
||||||
{
|
{
|
||||||
const NAME = 'array';
|
|
||||||
|
|
||||||
use CompareDeleteTrait;
|
use CompareDeleteTrait;
|
||||||
|
const NAME = 'array';
|
||||||
|
|
||||||
/** @var array Array with the cached data */
|
/** @var array Array with the cached data */
|
||||||
protected $cachedData = [];
|
protected $cachedData = [];
|
||||||
|
|
|
@ -19,11 +19,10 @@ use Memcache;
|
||||||
*/
|
*/
|
||||||
class MemcacheCache extends AbstractCache implements ICanCacheInMemory
|
class MemcacheCache extends AbstractCache implements ICanCacheInMemory
|
||||||
{
|
{
|
||||||
const NAME = 'memcache';
|
|
||||||
|
|
||||||
use CompareSetTrait;
|
use CompareSetTrait;
|
||||||
use CompareDeleteTrait;
|
use CompareDeleteTrait;
|
||||||
use MemcacheCommandTrait;
|
use MemcacheCommandTrait;
|
||||||
|
const NAME = 'memcache';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Memcache
|
* @var Memcache
|
||||||
|
@ -163,14 +162,14 @@ class MemcacheCache extends AbstractCache implements ICanCacheInMemory
|
||||||
$stats = $this->memcache->getStats();
|
$stats = $this->memcache->getStats();
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'version' => $stats['version'] ?? null,
|
'version' => $stats['version'] ?? null,
|
||||||
'entries' => $stats['curr_items'] ?? null,
|
'entries' => $stats['curr_items'] ?? null,
|
||||||
'used_memory' => $stats['bytes'] ?? null,
|
'used_memory' => $stats['bytes'] ?? null,
|
||||||
'uptime' => $stats['uptime'] ?? null,
|
'uptime' => $stats['uptime'] ?? null,
|
||||||
'connected_clients' => $stats['curr_connections'] ?? null,
|
'connected_clients' => $stats['curr_connections'] ?? null,
|
||||||
'hits' => $stats['get_hits'] ?? null,
|
'hits' => $stats['get_hits'] ?? null,
|
||||||
'misses' => $stats['get_misses'] ?? null,
|
'misses' => $stats['get_misses'] ?? null,
|
||||||
'evictions' => $stats['evictions'] ?? null,
|
'evictions' => $stats['evictions'] ?? null,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,11 +20,10 @@ use Psr\Log\LoggerInterface;
|
||||||
*/
|
*/
|
||||||
class MemcachedCache extends AbstractCache implements ICanCacheInMemory
|
class MemcachedCache extends AbstractCache implements ICanCacheInMemory
|
||||||
{
|
{
|
||||||
const NAME = 'memcached';
|
|
||||||
|
|
||||||
use CompareSetTrait;
|
use CompareSetTrait;
|
||||||
use CompareDeleteTrait;
|
use CompareDeleteTrait;
|
||||||
use MemcacheCommandTrait;
|
use MemcacheCommandTrait;
|
||||||
|
const NAME = 'memcached';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var \Memcached
|
* @var \Memcached
|
||||||
|
@ -185,14 +184,14 @@ class MemcachedCache extends AbstractCache implements ICanCacheInMemory
|
||||||
}
|
}
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'version' => $stats['version'] ?? null,
|
'version' => $stats['version'] ?? null,
|
||||||
'entries' => $stats['curr_items'] ?? null,
|
'entries' => $stats['curr_items'] ?? null,
|
||||||
'used_memory' => $stats['bytes'] ?? null,
|
'used_memory' => $stats['bytes'] ?? null,
|
||||||
'uptime' => $stats['uptime'] ?? null,
|
'uptime' => $stats['uptime'] ?? null,
|
||||||
'connected_clients' => $stats['curr_connections'] ?? null,
|
'connected_clients' => $stats['curr_connections'] ?? null,
|
||||||
'hits' => $stats['get_hits'] ?? null,
|
'hits' => $stats['get_hits'] ?? null,
|
||||||
'misses' => $stats['get_misses'] ?? null,
|
'misses' => $stats['get_misses'] ?? null,
|
||||||
'evictions' => $stats['evictions'] ?? null,
|
'evictions' => $stats['evictions'] ?? null,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
|
|
||||||
namespace Friendica\Core\Lock\Type;
|
namespace Friendica\Core\Lock\Type;
|
||||||
|
|
||||||
use Friendica\Core\Cache\Capability\ICanCache;
|
|
||||||
use Friendica\Core\Cache\Capability\ICanCacheInMemory;
|
use Friendica\Core\Cache\Capability\ICanCacheInMemory;
|
||||||
use Friendica\Core\Cache\Enum\Duration;
|
use Friendica\Core\Cache\Enum\Duration;
|
||||||
use Friendica\Core\Cache\Exception\CachePersistenceException;
|
use Friendica\Core\Cache\Exception\CachePersistenceException;
|
||||||
|
|
|
@ -59,10 +59,10 @@ class StatsCaching extends BaseModule
|
||||||
if (function_exists('opcache_get_status')) {
|
if (function_exists('opcache_get_status')) {
|
||||||
$status = opcache_get_status(false);
|
$status = opcache_get_status(false);
|
||||||
$data['opcache'] = [
|
$data['opcache'] = [
|
||||||
'enabled' => $status['opcache_enabled'] ?? false,
|
'enabled' => $status['opcache_enabled'] ?? false,
|
||||||
'hit_rate' => $status['opcache_statistics']['opcache_hit_rate'] ?? null,
|
'hit_rate' => $status['opcache_statistics']['opcache_hit_rate'] ?? null,
|
||||||
'used_memory' => $status['memory_usage']['used_memory'] ?? null,
|
'used_memory' => $status['memory_usage']['used_memory'] ?? null,
|
||||||
'free_memory' => $status['memory_usage']['free_memory'] ?? null,
|
'free_memory' => $status['memory_usage']['free_memory'] ?? null,
|
||||||
'num_cached_scripts' => $status['opcache_statistics']['num_cached_scripts'] ?? null,
|
'num_cached_scripts' => $status['opcache_statistics']['num_cached_scripts'] ?? null,
|
||||||
];
|
];
|
||||||
} else {
|
} else {
|
||||||
|
@ -73,7 +73,7 @@ class StatsCaching extends BaseModule
|
||||||
|
|
||||||
if ($this->cache instanceof ICanCacheInMemory) {
|
if ($this->cache instanceof ICanCacheInMemory) {
|
||||||
$data['cache'] = [
|
$data['cache'] = [
|
||||||
'type' => $this->cache->getName(),
|
'type' => $this->cache->getName(),
|
||||||
'stats' => $this->cache->getStats(),
|
'stats' => $this->cache->getStats(),
|
||||||
];
|
];
|
||||||
} else {
|
} else {
|
||||||
|
@ -84,7 +84,7 @@ class StatsCaching extends BaseModule
|
||||||
|
|
||||||
if ($this->lock instanceof CacheLock) {
|
if ($this->lock instanceof CacheLock) {
|
||||||
$data['lock'] = [
|
$data['lock'] = [
|
||||||
'type' => $this->lock->getName(),
|
'type' => $this->lock->getName(),
|
||||||
'stats' => $this->lock->getCacheStats(),
|
'stats' => $this->lock->getCacheStats(),
|
||||||
];
|
];
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue