File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 66
77use Closure ;
88use Illuminate \Support \Facades \File ;
9+ use Illuminate \Support \Facades \Log ;
910use Itiden \Backup \Abstracts \BackupPipe ;
1011use Itiden \Backup \Support \Zipper ;
12+ use RuntimeException ;
13+ use Statamic \Facades \Stache ;
1114
1215class Users extends BackupPipe
1316{
@@ -18,7 +21,7 @@ public static function getKey(): string
1821
1922 public function restore (string $ restoringFromPath , Closure $ next )
2023 {
21- $ destination = config ( ' statamic.stache.stores. users.directory ' );
24+ $ destination = Stache:: store ( ' users ' )?->directory( );
2225 $ users = $ this ->getDirectoryPath ($ restoringFromPath );
2326
2427 File::copyDirectory ($ users , $ destination );
@@ -28,7 +31,13 @@ public function restore(string $restoringFromPath, Closure $next)
2831
2932 public function backup (Zipper $ zip , Closure $ next )
3033 {
31- $ zip ->addDirectory (config ('statamic.stache.stores.users.directory ' ), static ::getKey ());
34+ $ usersDir = Stache::store ('users ' )?->directory();
35+
36+ if (!$ usersDir ) {
37+ throw new RuntimeException ('Users directory not found ' );
38+ }
39+
40+ $ zip ->addDirectory ($ usersDir , static ::getKey ());
3241
3342 return $ next ($ zip );
3443 }
You can’t perform that action at this time.
0 commit comments