protected function buildOperations() { $this->invalidFiles = array(); $operations = array(); foreach ($this->files as $file) { $localFile = new Local($file['src'], $file['metadata'], $file['mime']); $remoteFile = new Remote($file['dest']); $upload = new Upload($localFile, $remoteFile); $localFile->loadExists(); if (!$localFile->exists()) { $this->invalidFiles[] = $localFile; $this->logError("File not found: " . $localFile->getLocalPath()); continue; } if (!is_readable($localFile->getLocalPath())) { $this->logError("Permissions problem (read denied): " . $localFile->getLocalPath()); } $operations[$upload->getId()] = $upload; } return $operations; }
protected function __construct($local, $remote) { $this->local = $local; $this->remote = $remote; $this->id = ($this->local ? $this->local->getLocalPath() : '') . ':' . ($this->remote ? $this->remote->getRemotePath() : ''); }