예제 #1
0
파일: Wiki.php 프로젝트: Tjorriemorrie/app
 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;
 }
예제 #2
0
 protected function __construct($local, $remote)
 {
     $this->local = $local;
     $this->remote = $remote;
     $this->id = ($this->local ? $this->local->getLocalPath() : '') . ':' . ($this->remote ? $this->remote->getRemotePath() : '');
 }