Skip to content
This repository was archived by the owner on Dec 20, 2024. It is now read-only.

Commit fee66e2

Browse files
committed
Fix compatibility with Flysystem 3
1 parent 7de9e1a commit fee66e2

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/Support/Import/ArchiveManager.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,11 @@ public function delete($token)
150150
*/
151151
public function prune()
152152
{
153-
$files = $this->disk->listContents();
153+
$files = $this->disk->listContents('/');
154154
$limit = Carbon::now()->subWeek()->getTimestamp();
155-
foreach ($files as $metadata) {
156-
if ($metadata['timestamp'] < $limit) {
157-
$this->disk->delete($metadata['path']);
155+
foreach ($files as $file) {
156+
if ($file->lastModified() < $limit) {
157+
$this->disk->delete($file->path());
158158
}
159159
}
160160
}

tests/Support/Import/ArchiveManagerTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function testStoreUserExportNotAllowed()
5353
$this->assertFalse(true);
5454
} catch (Exception $e) {
5555
$this->assertStringContainsString('User imports are not allowed', $e->getMessage());
56-
$this->assertEmpty(Storage::disk('test')->listContents());
56+
$this->assertEmpty(Storage::disk('test')->listContents('/')->toArray());
5757
}
5858
}
5959

@@ -83,7 +83,7 @@ public function testStoreLabelTreeExportNotAllowed()
8383
$this->assertFalse(true);
8484
} catch (Exception $e) {
8585
$this->assertStringContainsString('Label tree imports are not allowed', $e->getMessage());
86-
$this->assertEmpty(Storage::disk('test')->listContents());
86+
$this->assertEmpty(Storage::disk('test')->listContents('/')->toArray());
8787
}
8888
}
8989

@@ -113,7 +113,7 @@ public function testStoreVolumeExportNotAllowed()
113113
$this->assertFalse(true);
114114
} catch (Exception $e) {
115115
$this->assertStringContainsString('Volume imports are not allowed', $e->getMessage());
116-
$this->assertEmpty(Storage::disk('test')->listContents());
116+
$this->assertEmpty(Storage::disk('test')->listContents('/')->toArray());
117117
}
118118
}
119119

@@ -175,7 +175,7 @@ public function testPrune()
175175

176176
$manager = new ArchiveManager;
177177
$token = $manager->store($file);
178-
$path = Storage::disk('test')->getAdapter()->applyPathPrefix($token);
178+
$path = storage_path("framework/testing/disks/test/{$token}");
179179

180180
$manager->prune();
181181
$this->assertTrue($manager->has($token));

0 commit comments

Comments
 (0)