@@ -64,11 +64,6 @@ class Adapter implements AdapterInterface
64
64
*/
65
65
protected $ permissionFlagResolver ;
66
66
67
- /**
68
- * @var CallInvokerInterface
69
- */
70
- protected $ invoker ;
71
-
72
67
/**
73
68
* @var array
74
69
*/
@@ -85,7 +80,6 @@ public function __construct(LoopInterface $loop, array $options = [])
85
80
{
86
81
$ this ->loop = $ loop ;
87
82
88
- $ this ->invoker = \React \Filesystem \getInvoker ($ this , $ options , 'invoker ' , 'React\Filesystem\InstantInvoker ' );
89
83
$ this ->openFileLimiter = new OpenFileLimiter (\React \Filesystem \getOpenFileLimit ($ options ));
90
84
$ this ->permissionFlagResolver = new PermissionFlagResolver ();
91
85
@@ -145,15 +139,6 @@ public function setFilesystem(FilesystemInterface $filesystem)
145
139
];
146
140
}
147
141
148
- /**
149
- * @param CallInvokerInterface $invoker
150
- * @return void
151
- */
152
- public function setInvoker (CallInvokerInterface $ invoker )
153
- {
154
- $ this ->invoker = $ invoker ;
155
- }
156
-
157
142
/**
158
143
* @param string $function
159
144
* @param array $args
@@ -176,7 +161,7 @@ public function callFilesystem($function, $args, $errorResultCode = -1)
176
161
*/
177
162
public function chmod ($ path , $ mode )
178
163
{
179
- return $ this ->invoker -> invokeCall ('chmod ' , [
164
+ return $ this ->callFilesystem ('chmod ' , [
180
165
'path ' => $ path ,
181
166
'mode ' => decoct ($ mode ),
182
167
]);
@@ -189,7 +174,7 @@ public function chmod($path, $mode)
189
174
*/
190
175
public function mkdir ($ path , $ mode = self ::CREATION_MODE )
191
176
{
192
- return $ this ->invoker -> invokeCall ('mkdir ' , [
177
+ return $ this ->callFilesystem ('mkdir ' , [
193
178
'path ' => $ path ,
194
179
'mode ' => decoct ($ this ->permissionFlagResolver ->resolve ($ mode )),
195
180
]);
@@ -271,7 +256,7 @@ public function close($fd)
271
256
*/
272
257
public function rmdir ($ path )
273
258
{
274
- return $ this ->invoker -> invokeCall ('rmdir ' , [
259
+ return $ this ->callFilesystem ('rmdir ' , [
275
260
'path ' => $ path ,
276
261
]);
277
262
}
@@ -282,7 +267,7 @@ public function rmdir($path)
282
267
*/
283
268
public function unlink ($ path )
284
269
{
285
- return $ this ->invoker -> invokeCall ('unlink ' , [
270
+ return $ this ->callFilesystem ('unlink ' , [
286
271
'path ' => $ path ,
287
272
]);
288
273
}
@@ -295,7 +280,7 @@ public function unlink($path)
295
280
*/
296
281
public function chown ($ path , $ uid , $ gid )
297
282
{
298
- return $ this ->invoker -> invokeCall ('chown ' , [
283
+ return $ this ->callFilesystem ('chown ' , [
299
284
'path ' => $ path ,
300
285
'uid ' => $ uid ,
301
286
'gid ' => $ gid ,
@@ -308,7 +293,7 @@ public function chown($path, $uid, $gid)
308
293
*/
309
294
public function stat ($ filename )
310
295
{
311
- return $ this ->invoker -> invokeCall ('stat ' , [
296
+ return $ this ->callFilesystem ('stat ' , [
312
297
'path ' => $ filename ,
313
298
])->then (function ($ stat ) {
314
299
$ stat ['atime ' ] = new DateTime ('@ ' . $ stat ['atime ' ]);
@@ -335,7 +320,7 @@ public function lsStream($path)
335
320
{
336
321
$ stream = new ObjectStream ();
337
322
338
- $ this ->invoker -> invokeCall ('readdir ' , [
323
+ $ this ->callFilesystem ('readdir ' , [
339
324
'path ' => $ path ,
340
325
'flags ' => $ this ->options ['lsFlags ' ],
341
326
])->then (function ($ result ) use ($ path , $ stream ) {
@@ -372,7 +357,7 @@ protected function processLsContents($basePath, $result, ObjectStream $stream)
372
357
*/
373
358
public function touch ($ path , $ mode = self ::CREATION_MODE )
374
359
{
375
- return $ this ->invoker -> invokeCall ('touch ' , [
360
+ return $ this ->callFilesystem ('touch ' , [
376
361
'path ' => $ path ,
377
362
'mode ' => decoct ($ this ->permissionFlagResolver ->resolve ($ mode )),
378
363
]);
@@ -385,7 +370,7 @@ public function touch($path, $mode = self::CREATION_MODE)
385
370
*/
386
371
public function rename ($ fromPath , $ toPath )
387
372
{
388
- return $ this ->invoker -> invokeCall ('rename ' , [
373
+ return $ this ->callFilesystem ('rename ' , [
389
374
'from ' => $ fromPath ,
390
375
'to ' => $ toPath ,
391
376
]);
@@ -397,7 +382,7 @@ public function rename($fromPath, $toPath)
397
382
*/
398
383
public function readlink ($ path )
399
384
{
400
- return $ this ->invoker -> invokeCall ('readlink ' , [
385
+ return $ this ->callFilesystem ('readlink ' , [
401
386
'path ' => $ path ,
402
387
])->then (function ($ result ) {
403
388
return \React \Promise \resolve ($ result ['path ' ]);
@@ -411,7 +396,7 @@ public function readlink($path)
411
396
*/
412
397
public function symlink ($ fromPath , $ toPath )
413
398
{
414
- return $ this ->invoker -> invokeCall ('symlink ' , [
399
+ return $ this ->callFilesystem ('symlink ' , [
415
400
'from ' => $ fromPath ,
416
401
'to ' => $ toPath ,
417
402
])->then (function ($ result ) {
0 commit comments