public function verify() { if ($this->local) { $this->local->load(); if (!$this->local->exists()) { return false; } } return true; }
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; }