Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Directory::createFileDirectly
  • Loading branch information
Vincent Petry committed Aug 28, 2017
commit 6428fab13bb50ab969a6b5a7af6d99bcaf3a131c
10 changes: 10 additions & 0 deletions apps/dav/lib/Connector/Sabre/Directory.php
Original file line number Diff line number Diff line change
Expand Up @@ -461,4 +461,14 @@ public function moveInto($targetName, $fullSourcePath, INode $sourceNode) {

return true;
}

/**
* Create a file directly, bypassing the hooks
*
* @param string $name name
* @param resource $data data
*/
public function createFileDirectly($name, $data) {
$this->fileView->file_put_contents($this->getPath() . '/' . $name, $data);
}
}
5 changes: 0 additions & 5 deletions apps/dav/lib/Connector/Sabre/Node.php
Original file line number Diff line number Diff line change
Expand Up @@ -382,9 +382,4 @@ protected function sanitizeMtime ($mtimeFromRequest) {
}
return $mtime;
}

public function getView() {
return $this->fileView;
}

}
4 changes: 2 additions & 2 deletions apps/dav/lib/Upload/UploadFolder.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ function __construct(Directory $node) {
}

function createFile($name, $data = null) {
$view = $this->node->getView();
$view->file_put_contents($this->node->getPath() . '/' . $name, $data);
// need to bypass hooks for individual chunks
$this->node->createFileDirectly($name, $data);
}

function createDirectory($name) {
Expand Down