redisConnection = $redisConnection; $this->basePath = $basePath; } /** * Czyszczenie całego cache (katalogi + Redis) * * @return array ['success' => bool, 'message' => string] */ public function clearCache(): array { \S::delete_dir( $this->basePath . 'temp/' ); \S::delete_dir( $this->basePath . 'thumbs/' ); $redisCleared = false; if ( $this->redisConnection ) { $redis = $this->redisConnection->getConnection(); if ( $redis ) { $redis->flushAll(); $redisCleared = true; } } return [ 'success' => true, 'message' => 'Cache został wyczyszczony.', 'redisCleared' => $redisCleared ]; } }