Skip to content
Merged
Changes from all commits
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
21 changes: 21 additions & 0 deletions core/Command/Info/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
namespace OC\Core\Command\Info;

use OC\Files\ObjectStore\ObjectStoreStorage;
use OC\Files\ObjectStore\PrimaryObjectStoreConfig;
use OC\Files\Storage\Wrapper\Encryption;
use OC\Files\Storage\Wrapper\Wrapper;
use OC\Files\View;
Expand Down Expand Up @@ -36,6 +37,7 @@ public function __construct(
IFactory $l10nFactory,
private FileUtils $fileUtils,
private \OC\Encryption\Util $encryptionUtil,
private PrimaryObjectStoreConfig $objectStoreConfig,
) {
$this->l10n = $l10nFactory->get('core');
parent::__construct();
Expand Down Expand Up @@ -145,6 +147,25 @@ private function outputStorageDetails(IMountPoint $mountPoint, Node $node, Input
$parts = explode(':', $objectStoreId);
/** @var string $bucket */
$bucket = array_pop($parts);
if ($this->objectStoreConfig->hasMultipleObjectStorages()) {
$configs = $this->objectStoreConfig->getObjectStoreConfigs();
foreach ($configs as $instance => $config) {
if (is_array($config)) {
if ($config['arguments']['multibucket']) {
if (str_starts_with($bucket, $config['arguments']['bucket'])) {
$postfix = substr($bucket, strlen($config['arguments']['bucket']));
if (is_numeric($postfix)) {
$output->writeln(' object store instance: ' . $instance);
}
}
} else {
if ($config['arguments']['bucket'] === $bucket) {
$output->writeln(' object store instance: ' . $instance);
}
}
}
}
}
$output->writeln(' bucket: ' . $bucket);
if ($node instanceof \OC\Files\Node\File) {
$output->writeln(' object id: ' . $storage->getURN($node->getId()));
Expand Down
Loading