File tree Expand file tree Collapse file tree 1 file changed +62
-0
lines changed Expand file tree Collapse file tree 1 file changed +62
-0
lines changed Original file line number Diff line number Diff line change @@ -297,4 +297,66 @@ public function enableUidCache(): void {
297
297
public function disableUidCache (): void {
298
298
$ this ->enable_uid_cache = false ;
299
299
}
300
+
301
+ /**
302
+ * Set the encryption method
303
+ * @param string $encryption
304
+ *
305
+ * @return void
306
+ */
307
+ public function setEncryption (string $ encryption ): void {
308
+ $ this ->encryption = $ encryption ;
309
+ }
310
+
311
+ /**
312
+ * Get the encryption method
313
+ * @return string
314
+ */
315
+ public function getEncryption (): string {
316
+ return $ this ->encryption ;
317
+ }
318
+
319
+ /**
320
+ * Check if the current session is connected
321
+ *
322
+ * @return bool
323
+ */
324
+ public function connected (): bool {
325
+ return (bool )$ this ->stream ;
326
+ }
327
+
328
+ /**
329
+ * Retrieves header/meta data from the resource stream
330
+ *
331
+ * @return array
332
+ */
333
+ public function meta (): array {
334
+ if (!$ this ->stream ) {
335
+ return [
336
+ "crypto " => [
337
+ "protocol " => "" ,
338
+ "cipher_name " => "" ,
339
+ "cipher_bits " => 0 ,
340
+ "cipher_version " => "" ,
341
+ ],
342
+ "timed_out " => true ,
343
+ "blocked " => true ,
344
+ "eof " => true ,
345
+ "stream_type " => "tcp_socket/unknown " ,
346
+ "mode " => "c " ,
347
+ "unread_bytes " => 0 ,
348
+ "seekable " => false ,
349
+ ];
350
+ }
351
+ return stream_get_meta_data ($ this ->stream );
352
+ }
353
+
354
+ /**
355
+ * Get the resource stream
356
+ *
357
+ * @return mixed
358
+ */
359
+ public function getStream (): mixed {
360
+ return $ this ->stream ;
361
+ }
300
362
}
You can’t perform that action at this time.
0 commit comments