2012-02-27 06:04:04 -05:00
|
|
|
<?php
|
2024-05-23 03:26:56 -04:00
|
|
|
|
2015-02-26 05:37:37 -05:00
|
|
|
/**
|
2024-05-23 03:26:56 -04:00
|
|
|
* SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
|
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
|
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
2015-03-26 06:44:34 -04:00
|
|
|
*/
|
2012-09-07 12:30:48 -04:00
|
|
|
namespace OC\Files\Storage;
|
|
|
|
|
|
2020-04-10 08:19:56 -04:00
|
|
|
class CommonTest extends \OC\Files\Storage\Common {
|
2012-02-27 06:04:04 -05:00
|
|
|
/**
|
|
|
|
|
* underlying local storage used for missing functions
|
2012-09-07 12:30:48 -04:00
|
|
|
* @var \OC\Files\Storage\Local
|
2012-02-27 06:04:04 -05:00
|
|
|
*/
|
|
|
|
|
private $storage;
|
2012-08-29 02:38:33 -04:00
|
|
|
|
2024-10-08 09:13:16 -04:00
|
|
|
public function __construct(array $parameters) {
|
|
|
|
|
$this->storage = new \OC\Files\Storage\Local($parameters);
|
2012-02-27 06:04:04 -05:00
|
|
|
}
|
2012-08-29 02:38:33 -04:00
|
|
|
|
2024-09-19 12:19:34 -04:00
|
|
|
public function getId(): string {
|
2024-09-19 05:10:31 -04:00
|
|
|
return 'test::' . $this->storage->getId();
|
2012-09-12 16:50:10 -04:00
|
|
|
}
|
2024-10-01 10:12:30 -04:00
|
|
|
public function mkdir(string $path): bool {
|
2012-02-27 06:04:04 -05:00
|
|
|
return $this->storage->mkdir($path);
|
|
|
|
|
}
|
2024-10-01 10:12:30 -04:00
|
|
|
public function rmdir(string $path): bool {
|
2012-02-27 06:04:04 -05:00
|
|
|
return $this->storage->rmdir($path);
|
|
|
|
|
}
|
2024-10-01 10:12:30 -04:00
|
|
|
public function opendir(string $path) {
|
2012-02-27 06:04:04 -05:00
|
|
|
return $this->storage->opendir($path);
|
|
|
|
|
}
|
2024-10-01 10:12:30 -04:00
|
|
|
public function stat(string $path): array|false {
|
2012-02-27 06:04:04 -05:00
|
|
|
return $this->storage->stat($path);
|
|
|
|
|
}
|
2024-10-01 10:12:30 -04:00
|
|
|
public function filetype(string $path): string|false {
|
2013-11-20 09:25:29 -05:00
|
|
|
return @$this->storage->filetype($path);
|
2012-02-27 06:04:04 -05:00
|
|
|
}
|
2024-10-01 10:12:30 -04:00
|
|
|
public function isReadable(string $path): bool {
|
2012-08-15 11:55:54 -04:00
|
|
|
return $this->storage->isReadable($path);
|
2012-02-27 06:04:04 -05:00
|
|
|
}
|
2024-10-01 10:12:30 -04:00
|
|
|
public function isUpdatable(string $path): bool {
|
2012-08-15 11:55:54 -04:00
|
|
|
return $this->storage->isUpdatable($path);
|
2012-02-27 06:04:04 -05:00
|
|
|
}
|
2024-10-01 10:12:30 -04:00
|
|
|
public function file_exists(string $path): bool {
|
2012-02-27 06:04:04 -05:00
|
|
|
return $this->storage->file_exists($path);
|
|
|
|
|
}
|
2024-10-01 10:12:30 -04:00
|
|
|
public function unlink(string $path): bool {
|
2012-02-27 06:04:04 -05:00
|
|
|
return $this->storage->unlink($path);
|
|
|
|
|
}
|
2024-10-01 10:12:30 -04:00
|
|
|
public function fopen(string $path, string $mode) {
|
2012-11-02 14:53:02 -04:00
|
|
|
return $this->storage->fopen($path, $mode);
|
2012-02-27 06:04:04 -05:00
|
|
|
}
|
2024-10-01 10:12:30 -04:00
|
|
|
public function free_space(string $path): int|float|false {
|
2012-02-27 06:04:04 -05:00
|
|
|
return $this->storage->free_space($path);
|
|
|
|
|
}
|
2024-10-01 10:12:30 -04:00
|
|
|
public function touch(string $path, ?int $mtime = null): bool {
|
2012-11-02 14:53:02 -04:00
|
|
|
return $this->storage->touch($path, $mtime);
|
2012-02-29 17:42:40 -05:00
|
|
|
}
|
2013-08-18 05:02:08 -04:00
|
|
|
}
|