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