|
8 | 8 | namespace OC\Core\Command\Info; |
9 | 9 |
|
10 | 10 | use OC\Files\ObjectStore\ObjectStoreStorage; |
| 11 | +use OC\Files\ObjectStore\PrimaryObjectStoreConfig; |
11 | 12 | use OC\Files\Storage\Wrapper\Encryption; |
12 | 13 | use OC\Files\Storage\Wrapper\Wrapper; |
13 | 14 | use OC\Files\View; |
@@ -36,6 +37,7 @@ public function __construct( |
36 | 37 | IFactory $l10nFactory, |
37 | 38 | private FileUtils $fileUtils, |
38 | 39 | private \OC\Encryption\Util $encryptionUtil, |
| 40 | + private PrimaryObjectStoreConfig $objectStoreConfig, |
39 | 41 | ) { |
40 | 42 | $this->l10n = $l10nFactory->get('core'); |
41 | 43 | parent::__construct(); |
@@ -145,6 +147,25 @@ private function outputStorageDetails(IMountPoint $mountPoint, Node $node, Input |
145 | 147 | $parts = explode(':', $objectStoreId); |
146 | 148 | /** @var string $bucket */ |
147 | 149 | $bucket = array_pop($parts); |
| 150 | + if ($this->objectStoreConfig->hasMultipleObjectStorages()) { |
| 151 | + $configs = $this->objectStoreConfig->getObjectStoreConfigs(); |
| 152 | + foreach ($configs as $instance => $config) { |
| 153 | + if (is_array($config)) { |
| 154 | + if ($config['arguments']['multibucket']) { |
| 155 | + if (str_starts_with($bucket, $config['arguments']['bucket'])) { |
| 156 | + $postfix = substr($bucket, strlen($config['arguments']['bucket'])); |
| 157 | + if (is_numeric($postfix)) { |
| 158 | + $output->writeln(' object store instance: ' . $instance); |
| 159 | + } |
| 160 | + } |
| 161 | + } else { |
| 162 | + if ($config['arguments']['bucket'] === $bucket) { |
| 163 | + $output->writeln(' object store instance: ' . $instance); |
| 164 | + } |
| 165 | + } |
| 166 | + } |
| 167 | + } |
| 168 | + } |
148 | 169 | $output->writeln(' bucket: ' . $bucket); |
149 | 170 | if ($node instanceof \OC\Files\Node\File) { |
150 | 171 | $output->writeln(' object id: ' . $storage->getURN($node->getId())); |
|
0 commit comments