private function processItem($localPath, $remotePath) { if (is_file($localPath)) { if (is_readable($localPath)) { $metadata = array(); $mime = $this->getMimeType($localPath); $this->allFiles[] = array('src' => $localPath, 'dest' => $remotePath, 'metadata' => $metadata, 'mime' => $mime, 'size' => filesize($localPath), 'md5' => $this->md5Cache->get($localPath)); } else { $this->logError("File could not be read: " . $localPath); } } else { if (is_dir($localPath)) { $this->logInfo("processItem: directory: {$localPath}"); $items = scandir($localPath); foreach ($items as $item) { if ($item == '.' || $item == '..') { continue; } $this->processItem($localPath . '/' . $item, $remotePath . '/' . $item); } } } }