32
32
namespace OCA \Backup \Command ;
33
33
34
34
35
+ use ArtificialOwl \MySmallPhpTools \Exceptions \SignatoryException ;
35
36
use OC \Core \Command \Base ;
36
37
use OCA \Backup \Exceptions \RestoringPointNotFoundException ;
37
38
use OCA \Backup \Service \PackService ;
38
39
use OCA \Backup \Service \PointService ;
40
+ use OCA \Backup \Service \RemoteStreamService ;
39
41
use OCP \Files \NotFoundException ;
40
42
use OCP \Files \NotPermittedException ;
41
43
use Symfony \Component \Console \Input \InputArgument ;
42
44
use Symfony \Component \Console \Input \InputInterface ;
43
45
use Symfony \Component \Console \Output \OutputInterface ;
46
+ use Throwable ;
44
47
45
48
46
49
/**
@@ -57,18 +60,27 @@ class PointUnpack extends Base {
57
60
/** @var PackService */
58
61
private $ packService ;
59
62
63
+ /** @var RemoteStreamService */
64
+ private $ remoteStreamService ;
65
+
60
66
61
67
/**
62
68
* PointUnpack constructor.
63
69
*
64
70
* @param PointService $pointService
65
71
* @param PackService $packService
72
+ * @param RemoteStreamService $remoteStreamService
66
73
*/
67
- public function __construct (PointService $ pointService , PackService $ packService ) {
74
+ public function __construct (
75
+ PointService $ pointService ,
76
+ PackService $ packService ,
77
+ RemoteStreamService $ remoteStreamService
78
+ ) {
68
79
parent ::__construct ();
69
80
70
81
$ this ->pointService = $ pointService ;
71
82
$ this ->packService = $ packService ;
83
+ $ this ->remoteStreamService = $ remoteStreamService ;
72
84
}
73
85
74
86
@@ -89,16 +101,25 @@ protected function configure() {
89
101
* @param OutputInterface $output
90
102
*
91
103
* @return int
92
- * @throws RestoringPointNotFoundException
93
104
* @throws NotFoundException
94
105
* @throws NotPermittedException
106
+ * @throws RestoringPointNotFoundException
107
+ * @throws SignatoryException
108
+ * @throws Throwable
95
109
*/
96
110
protected function execute (InputInterface $ input , OutputInterface $ output ): int {
97
111
$ point = $ this ->pointService ->getLocalRestoringPoint ($ input ->getArgument ('pointId ' ));
98
112
99
113
$ this ->pointService ->initBaseFolder ($ point );
100
114
$ this ->packService ->unpackPoint ($ point );
101
115
116
+
117
+ // set Archive flag up after unpack
118
+ $ point ->setArchive (true );
119
+
120
+ $ this ->remoteStreamService ->subSignPoint ($ point );
121
+ $ this ->pointService ->updateSubInfos ($ point );
122
+
102
123
return 0 ;
103
124
}
104
125
0 commit comments