public function rename($path_from, $path_to) { parent::rename($path_from, $path_to); $this->init(); // because of php bug not calling stream ctor if ($this->isUploadUrl($path_to)) { if ($this->isUploadURL($path_from)) { // from S3 to S3 - copy there $this->s3->copyObject($this->urlToObject(path_from), $this->urlToObject(path_to)); } else { // from local to S3 - just register the copy, parent did the local part $this->registerFile($path); } } if ($this->isUploadURL($path_from)) { $this->s3->removeObject($this->urlToObject($path_from)); } return true; }