diff --git a/lib/LogFileAccessor.php b/lib/LogFileAccessor.php index 3d0f53b..0e78c97 100644 --- a/lib/LogFileAccessor.php +++ b/lib/LogFileAccessor.php @@ -29,6 +29,7 @@ private static function getFilesystem($args) 'passive' => true, 'ssl' => false, 'timeout' => 30, + 'root' => '/', ]; $args['filesystem'] = new Filesystem(new Ftp([ 'host' => $args['host'], @@ -38,6 +39,7 @@ private static function getFilesystem($args) 'passive' => isset($args['passive']) ? $args['passive'] : $default['passive'], 'ssl' => isset($args['ssl']) ? $args['ssl'] : $default['ssl'], 'timeout' => isset($args['timeout']) ? $args['timeout'] : $default['timeout'], + 'root' => isset($args['root']) ? $args['root'] : $default['root'], ])); break; case 'sftp': @@ -46,6 +48,7 @@ private static function getFilesystem($args) 'passive' => true, 'ssl' => false, 'timeout' => 30, + 'root' => '/', ]; $config = [ 'host' => $args['host'], @@ -55,6 +58,7 @@ private static function getFilesystem($args) 'passive' => isset($args['passive']) ? $args['passive'] : $default['passive'], 'ssl' => isset($args['ssl']) ? $args['ssl'] : $default['ssl'], 'timeout' => isset($args['timeout']) ? $args['timeout'] : $default['timeout'], + 'root' => isset($args['root']) ? $args['root'] : $default['root'], ]; if (isset($args['private_key'])) { $config['privateKey'] = $args['private_key']; diff --git a/lib/LogFileCache.php b/lib/LogFileCache.php index ce7b95e..2a68526 100644 --- a/lib/LogFileCache.php +++ b/lib/LogFileCache.php @@ -57,7 +57,7 @@ private function deleteCache(LogFile $logFile) public function emptyCache() { - $cache = $this->cache->get('/')->getContents(); + $cache = $this->cache->listContents('/'); foreach ($cache as $file) { if ($file['type'] == 'file' && substr($file['basename'], 0, 1) !== '.') { $this->cache->delete($file['path']);