SystemBridge.php 575 B

123456789101112131415161718192021222324252627
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2024 Robin Appelman <robin@icewind.nl>
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OCA\Files_External\Lib\Storage;
  8. use Icewind\SMB\System;
  9. use OCP\IBinaryFinder;
  10. /**
  11. * Bridge the NC and SMB binary finding logic
  12. */
  13. class SystemBridge extends System {
  14. public function __construct(
  15. private IBinaryFinder $binaryFinder,
  16. ) {
  17. }
  18. protected function getBinaryPath(string $binary): ?string {
  19. $path = $this->binaryFinder->findBinaryPath($binary);
  20. return $path !== false ? $path : null;
  21. }
  22. }