diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2018-11-02 21:19:27 +0100 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2019-01-04 09:21:21 +0100 |
commit | cb742e7045d1f5af7994ad1e918b0ddc9ba01914 (patch) | |
tree | 7d1681c35780cc4b4ca4283d16845ea74ad61dac /apps/dav/lib/Upload/RootCollection.php | |
parent | a1f9ed1d7d9e953833850a14405687e115bf0b82 (diff) | |
download | nextcloud-server-cb742e7045d1f5af7994ad1e918b0ddc9ba01914.tar.gz nextcloud-server-cb742e7045d1f5af7994ad1e918b0ddc9ba01914.zip |
Background job to cleanup leftover chunked uploads
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'apps/dav/lib/Upload/RootCollection.php')
-rw-r--r-- | apps/dav/lib/Upload/RootCollection.php | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/apps/dav/lib/Upload/RootCollection.php b/apps/dav/lib/Upload/RootCollection.php index 696de064dd8..436792e25ec 100644 --- a/apps/dav/lib/Upload/RootCollection.php +++ b/apps/dav/lib/Upload/RootCollection.php @@ -1,4 +1,5 @@ <?php +declare(strict_types=1); /** * @copyright Copyright (c) 2016, ownCloud, Inc. * @@ -23,20 +24,31 @@ namespace OCA\DAV\Upload; use Sabre\DAVACL\AbstractPrincipalCollection; +use Sabre\DAVACL\PrincipalBackend; class RootCollection extends AbstractPrincipalCollection { + /** @var CleanupService */ + private $cleanupService; + + public function __construct(PrincipalBackend\BackendInterface $principalBackend, + string $principalPrefix, + CleanupService $cleanupService) { + parent::__construct($principalBackend, $principalPrefix); + $this->cleanupService = $cleanupService; + } + /** * @inheritdoc */ - function getChildForPrincipal(array $principalInfo) { - return new UploadHome($principalInfo); + public function getChildForPrincipal(array $principalInfo): UploadHome { + return new UploadHome($principalInfo, $this->cleanupService); } /** * @inheritdoc */ - function getName() { + public function getName(): string { return 'uploads'; } |