9
9
use React \Filesystem \ObjectStream ;
10
10
use React \Filesystem \ObjectStreamSink ;
11
11
use React \Filesystem \AdapterInterface ;
12
- use React \Filesystem \CallInvokerInterface ;
13
12
use React \Filesystem \FilesystemInterface ;
14
13
use React \Filesystem \MappedTypeDetector ;
15
14
use React \Filesystem \ModeTypeDetector ;
@@ -65,11 +64,6 @@ class Adapter implements AdapterInterface
65
64
*/
66
65
protected $ permissionFlagResolver ;
67
66
68
- /**
69
- * @var CallInvokerInterface
70
- */
71
- protected $ invoker ;
72
-
73
67
/**
74
68
* @var array
75
69
*/
@@ -86,7 +80,6 @@ public function __construct(LoopInterface $loop, array $options = [])
86
80
{
87
81
$ this ->loop = $ loop ;
88
82
89
- $ this ->invoker = \React \Filesystem \getInvoker ($ this , $ options , 'invoker ' , 'React\Filesystem\InstantInvoker ' );
90
83
$ this ->openFileLimiter = new OpenFileLimiter (\React \Filesystem \getOpenFileLimit ($ options ));
91
84
$ this ->permissionFlagResolver = new PermissionFlagResolver ();
92
85
@@ -154,23 +147,6 @@ public function setFilesystem(FilesystemInterface $filesystem)
154
147
];
155
148
}
156
149
157
- /**
158
- * {@inheritDoc}
159
- */
160
- public function getInvoker ()
161
- {
162
- return $ this ->invoker ;
163
- }
164
-
165
- /**
166
- * @param CallInvokerInterface $invoker
167
- * @return void
168
- */
169
- public function setInvoker (CallInvokerInterface $ invoker )
170
- {
171
- $ this ->invoker = $ invoker ;
172
- }
173
-
174
150
/**
175
151
* @param string $function
176
152
* @param array $args
@@ -197,7 +173,7 @@ public function callFilesystem($function, $args, $errorResultCode = -1)
197
173
*/
198
174
public function chmod ($ path , $ mode )
199
175
{
200
- return $ this ->invoker -> invokeCall ('chmod ' , [
176
+ return $ this ->callFilesystem ('chmod ' , [
201
177
'path ' => $ path ,
202
178
'mode ' => decoct ($ mode ),
203
179
]);
@@ -210,7 +186,7 @@ public function chmod($path, $mode)
210
186
*/
211
187
public function mkdir ($ path , $ mode = self ::CREATION_MODE )
212
188
{
213
- return $ this ->invoker -> invokeCall ('mkdir ' , [
189
+ return $ this ->callFilesystem ('mkdir ' , [
214
190
'path ' => $ path ,
215
191
'mode ' => decoct ($ this ->permissionFlagResolver ->resolve ($ mode )),
216
192
]);
@@ -299,7 +275,7 @@ public function close($fd)
299
275
*/
300
276
public function getContents ($ path , $ offset = 0 , $ length = null )
301
277
{
302
- return $ this ->invoker -> invokeCall ('getContents ' , [
278
+ return $ this ->callFilesystem ('getContents ' , [
303
279
'path ' => $ path ,
304
280
'offset ' => $ offset ,
305
281
'maxlen ' => $ length ,
@@ -323,7 +299,7 @@ public function getContents($path, $offset = 0, $length = null)
323
299
*/
324
300
public function putContents ($ path , $ content )
325
301
{
326
- return $ this ->invoker -> invokeCall ('putContents ' , [
302
+ return $ this ->callFilesystem ('putContents ' , [
327
303
'path ' => $ path ,
328
304
'chunk ' => base64_encode ($ content ),
329
305
'flags ' => 0 ,
@@ -346,7 +322,7 @@ public function putContents($path, $content)
346
322
*/
347
323
public function appendContents ($ path , $ content )
348
324
{
349
- return $ this ->invoker -> invokeCall ('putContents ' , [
325
+ return $ this ->callFilesystem ('putContents ' , [
350
326
'path ' => $ path ,
351
327
'chunk ' => base64_encode ($ content ),
352
328
'flags ' => FILE_APPEND ,
@@ -361,7 +337,7 @@ public function appendContents($path, $content)
361
337
*/
362
338
public function rmdir ($ path )
363
339
{
364
- return $ this ->invoker -> invokeCall ('rmdir ' , [
340
+ return $ this ->callFilesystem ('rmdir ' , [
365
341
'path ' => $ path ,
366
342
]);
367
343
}
@@ -372,7 +348,7 @@ public function rmdir($path)
372
348
*/
373
349
public function unlink ($ path )
374
350
{
375
- return $ this ->invoker -> invokeCall ('unlink ' , [
351
+ return $ this ->callFilesystem ('unlink ' , [
376
352
'path ' => $ path ,
377
353
]);
378
354
}
@@ -385,7 +361,7 @@ public function unlink($path)
385
361
*/
386
362
public function chown ($ path , $ uid , $ gid )
387
363
{
388
- return $ this ->invoker -> invokeCall ('chown ' , [
364
+ return $ this ->callFilesystem ('chown ' , [
389
365
'path ' => $ path ,
390
366
'uid ' => $ uid ,
391
367
'gid ' => $ gid ,
@@ -398,7 +374,7 @@ public function chown($path, $uid, $gid)
398
374
*/
399
375
public function stat ($ filename )
400
376
{
401
- return $ this ->invoker -> invokeCall ('stat ' , [
377
+ return $ this ->callFilesystem ('stat ' , [
402
378
'path ' => $ filename ,
403
379
])->then (function ($ stat ) {
404
380
$ stat ['atime ' ] = new DateTime ('@ ' . $ stat ['atime ' ]);
@@ -425,7 +401,7 @@ public function lsStream($path)
425
401
{
426
402
$ stream = new ObjectStream ();
427
403
428
- $ this ->invoker -> invokeCall ('readdir ' , [
404
+ $ this ->callFilesystem ('readdir ' , [
429
405
'path ' => $ path ,
430
406
'flags ' => $ this ->options ['lsFlags ' ],
431
407
])->then (function ($ result ) use ($ path , $ stream ) {
@@ -462,7 +438,7 @@ protected function processLsContents($basePath, $result, ObjectStream $stream)
462
438
*/
463
439
public function touch ($ path , $ mode = self ::CREATION_MODE )
464
440
{
465
- return $ this ->invoker -> invokeCall ('touch ' , [
441
+ return $ this ->callFilesystem ('touch ' , [
466
442
'path ' => $ path ,
467
443
'mode ' => decoct ($ this ->permissionFlagResolver ->resolve ($ mode )),
468
444
]);
@@ -475,7 +451,7 @@ public function touch($path, $mode = self::CREATION_MODE)
475
451
*/
476
452
public function rename ($ fromPath , $ toPath )
477
453
{
478
- return $ this ->invoker -> invokeCall ('rename ' , [
454
+ return $ this ->callFilesystem ('rename ' , [
479
455
'from ' => $ fromPath ,
480
456
'to ' => $ toPath ,
481
457
]);
@@ -487,7 +463,7 @@ public function rename($fromPath, $toPath)
487
463
*/
488
464
public function readlink ($ path )
489
465
{
490
- return $ this ->invoker -> invokeCall ('readlink ' , [
466
+ return $ this ->callFilesystem ('readlink ' , [
491
467
'path ' => $ path ,
492
468
])->then (function ($ result ) {
493
469
return \React \Promise \resolve ($ result ['path ' ]);
@@ -501,7 +477,7 @@ public function readlink($path)
501
477
*/
502
478
public function symlink ($ fromPath , $ toPath )
503
479
{
504
- return $ this ->invoker -> invokeCall ('symlink ' , [
480
+ return $ this ->callFilesystem ('symlink ' , [
505
481
'from ' => $ fromPath ,
506
482
'to ' => $ toPath ,
507
483
])->then (function ($ result ) {
0 commit comments