@@ -44,16 +44,6 @@ class Adapter implements AdapterInterface
44
44
*/
45
45
protected $ permissionFlagResolver ;
46
46
47
- /**
48
- * @var CallInvokerInterface
49
- */
50
- protected $ invoker ;
51
-
52
- /**
53
- * @var CallInvokerInterface
54
- */
55
- protected $ readDirInvoker ;
56
-
57
47
/**
58
48
* @var FilesystemInterface
59
49
*/
@@ -96,8 +86,6 @@ public function __construct(LoopInterface $loop, array $options = [])
96
86
*/
97
87
protected function applyConfiguration (array $ options )
98
88
{
99
- $ this ->invoker = \React \Filesystem \getInvoker ($ this , $ options , 'invoker ' , 'React\Filesystem\InstantInvoker ' );
100
- $ this ->readDirInvoker = \React \Filesystem \getInvoker ($ this , $ options , 'read_dir_invoker ' , 'React\Filesystem\InstantInvoker ' );
101
89
$ this ->openFileLimiter = new OpenFileLimiter (\React \Filesystem \getOpenFileLimit ($ options ));
102
90
$ this ->options = array_merge_recursive ($ this ->options , $ options );
103
91
}
@@ -118,14 +106,6 @@ public function getLoop()
118
106
return $ this ->loop ;
119
107
}
120
108
121
- /**
122
- * {@inheritDoc}
123
- */
124
- public function setInvoker (CallInvokerInterface $ invoker )
125
- {
126
- $ this ->invoker = $ invoker ;
127
- }
128
-
129
109
/**
130
110
* {@inheritDoc}
131
111
*/
@@ -152,7 +132,7 @@ public function setReadDirInvoker(CallInvokerInterface $invoker)
152
132
*/
153
133
public function stat ($ filename )
154
134
{
155
- return $ this ->invoker -> invokeCall ('eio_lstat ' , [$ filename ])->then (function ($ stat ) {
135
+ return $ this ->callFilesystem ('eio_lstat ' , [$ filename ])->then (function ($ stat ) {
156
136
$ stat ['atime ' ] = new DateTime ('@ ' .$ stat ['atime ' ]);
157
137
$ stat ['mtime ' ] = new DateTime ('@ ' .$ stat ['mtime ' ]);
158
138
$ stat ['ctime ' ] = new DateTime ('@ ' .$ stat ['ctime ' ]);
@@ -165,31 +145,31 @@ public function stat($filename)
165
145
*/
166
146
public function unlink ($ filename )
167
147
{
168
- return $ this ->invoker -> invokeCall ('eio_unlink ' , [$ filename ]);
148
+ return $ this ->callFilesystem ('eio_unlink ' , [$ filename ]);
169
149
}
170
150
171
151
/**
172
152
* {@inheritDoc}
173
153
*/
174
154
public function rename ($ fromFilename , $ toFilename )
175
155
{
176
- return $ this ->invoker -> invokeCall ('eio_rename ' , [$ fromFilename , $ toFilename ]);
156
+ return $ this ->callFilesystem ('eio_rename ' , [$ fromFilename , $ toFilename ]);
177
157
}
178
158
179
159
/**
180
160
* {@inheritDoc}
181
161
*/
182
162
public function chmod ($ path , $ mode )
183
163
{
184
- return $ this ->invoker -> invokeCall ('eio_chmod ' , [$ path , $ mode ]);
164
+ return $ this ->callFilesystem ('eio_chmod ' , [$ path , $ mode ]);
185
165
}
186
166
187
167
/**
188
168
* {@inheritDoc}
189
169
*/
190
170
public function chown ($ path , $ uid , $ gid )
191
171
{
192
- return $ this ->invoker -> invokeCall ('eio_chown ' , [$ path , $ uid , $ gid ]);
172
+ return $ this ->callFilesystem ('eio_chown ' , [$ path , $ uid , $ gid ]);
193
173
}
194
174
195
175
/**
@@ -250,7 +230,7 @@ protected function processLsContents($basePath, $result, ObjectStream $stream)
250
230
*/
251
231
public function mkdir ($ path , $ mode = self ::CREATION_MODE )
252
232
{
253
- return $ this ->invoker -> invokeCall ('eio_mkdir ' , [
233
+ return $ this ->callFilesystem ('eio_mkdir ' , [
254
234
$ path ,
255
235
$ this ->permissionFlagResolver ->resolve ($ mode ),
256
236
]);
@@ -261,7 +241,7 @@ public function mkdir($path, $mode = self::CREATION_MODE)
261
241
*/
262
242
public function rmdir ($ path )
263
243
{
264
- return $ this ->invoker -> invokeCall ('eio_rmdir ' , [$ path ]);
244
+ return $ this ->callFilesystem ('eio_rmdir ' , [$ path ]);
265
245
}
266
246
267
247
/**
@@ -272,7 +252,7 @@ public function open($path, $flags, $mode = self::CREATION_MODE)
272
252
$ eioFlags = $ this ->openFlagResolver ->resolve ($ flags );
273
253
$ mode = $ this ->permissionFlagResolver ->resolve ($ mode );
274
254
return $ this ->openFileLimiter ->open ()->then (function () use ($ path , $ eioFlags , $ mode ) {
275
- return $ this ->invoker -> invokeCall ('eio_open ' , [
255
+ return $ this ->callFilesystem ('eio_open ' , [
276
256
$ path ,
277
257
$ eioFlags ,
278
258
$ mode ,
@@ -288,7 +268,7 @@ public function open($path, $flags, $mode = self::CREATION_MODE)
288
268
*/
289
269
public function close ($ fd )
290
270
{
291
- return $ this ->invoker -> invokeCall ('eio_close ' , [$ fd ])->always (function () {
271
+ return $ this ->callFilesystem ('eio_close ' , [$ fd ])->always (function () {
292
272
$ this ->openFileLimiter ->close ();
293
273
});
294
274
}
@@ -302,14 +282,14 @@ public function touch($path, $mode = self::CREATION_MODE, $time = null)
302
282
if ($ time === null ) {
303
283
$ time = microtime (true );
304
284
}
305
- return $ this ->invoker -> invokeCall ('eio_utime ' , [
285
+ return $ this ->callFilesystem ('eio_utime ' , [
306
286
$ path ,
307
287
$ time ,
308
288
$ time ,
309
289
]);
310
290
}, function () use ($ path , $ mode ) {
311
291
return $ this ->openFileLimiter ->open ()->then (function () use ($ path , $ mode ) {
312
- return $ this ->invoker -> invokeCall ('eio_open ' , [
292
+ return $ this ->callFilesystem ('eio_open ' , [
313
293
$ path ,
314
294
EIO_O_CREAT ,
315
295
$ this ->permissionFlagResolver ->resolve ($ mode ),
@@ -325,7 +305,7 @@ public function touch($path, $mode = self::CREATION_MODE, $time = null)
325
305
*/
326
306
public function read ($ fileDescriptor , $ length , $ offset )
327
307
{
328
- return $ this ->invoker -> invokeCall ('eio_read ' , [
308
+ return $ this ->callFilesystem ('eio_read ' , [
329
309
$ fileDescriptor ,
330
310
$ length ,
331
311
$ offset ,
@@ -337,7 +317,7 @@ public function read($fileDescriptor, $length, $offset)
337
317
*/
338
318
public function write ($ fileDescriptor , $ data , $ length , $ offset )
339
319
{
340
- return $ this ->invoker -> invokeCall ('eio_write ' , [
320
+ return $ this ->callFilesystem ('eio_write ' , [
341
321
$ fileDescriptor ,
342
322
$ data ,
343
323
$ length ,
@@ -350,7 +330,7 @@ public function write($fileDescriptor, $data, $length, $offset)
350
330
*/
351
331
public function readlink ($ path )
352
332
{
353
- return $ this ->invoker -> invokeCall ('eio_readlink ' , [
333
+ return $ this ->callFilesystem ('eio_readlink ' , [
354
334
$ path ,
355
335
]);
356
336
}
@@ -360,7 +340,7 @@ public function readlink($path)
360
340
*/
361
341
public function symlink ($ fromPath , $ toPath )
362
342
{
363
- return $ this ->invoker -> invokeCall ('eio_symlink ' , [
343
+ return $ this ->callFilesystem ('eio_symlink ' , [
364
344
$ fromPath ,
365
345
$ toPath ,
366
346
]);
0 commit comments