(StorageAdapterInterface $storage, string $dir)
| 96 | } |
| 97 | |
| 98 | private static function ensureRemoteFolderMarker(StorageAdapterInterface $storage, string $dir): void |
| 99 | { |
| 100 | if (!self::shouldUseRemoteMarker($storage)) { |
| 101 | return; |
| 102 | } |
| 103 | $markerName = self::remoteDirMarker(); |
| 104 | if ($markerName === '') { |
| 105 | return; |
| 106 | } |
| 107 | $dir = rtrim($dir, "/\\"); |
| 108 | if ($dir === '' || $dir === '.') { |
| 109 | return; |
| 110 | } |
| 111 | $markerPath = $dir . DIRECTORY_SEPARATOR . $markerName; |
| 112 | try { |
| 113 | if ($storage->stat($markerPath) !== null) { |
| 114 | return; |
| 115 | } |
| 116 | $storage->mkdir($dir, 0775, true); |
| 117 | $storage->write($markerPath, ''); |
| 118 | } catch (\Throwable $e) { |
| 119 | // Best-effort only; remote backends may not support markers. |
| 120 | } |
| 121 | } |
| 122 | |
| 123 | /** |
| 124 | * Resolve a logical folder key (e.g. "root", "invoices/2025") to a |
no test coverage detected