-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathpreload.php
834 lines (732 loc) · 19.9 KB
/
preload.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
<?php
declare(strict_types=1);
use FFI\CData;
use FFI\CType;
use ZE\PhpStream;
if (!\defined('MODULE_PERSISTENT')) {
/**
* @see zend_modules.h:MODULE_PERSISTENT
*/
\define('MODULE_PERSISTENT', 1);
}
if (!\defined('MODULE_TEMPORARY')) {
/**
* @see zend_modules.h:MODULE_TEMPORARY
*/
\define('MODULE_TEMPORARY', 2);
}
if (!\defined('DS'))
\define('DS', \DIRECTORY_SEPARATOR);
if (!\defined('None'))
\define('None', null);
if (!\defined('INET_ADDRSTRLEN'))
\define('INET_ADDRSTRLEN', 22);
if (!\defined('INET6_ADDRSTRLEN'))
\define('INET6_ADDRSTRLEN', 65);
if (!\defined('IS_WINDOWS'))
\define('IS_WINDOWS', ('\\' === \DS));
if (!\defined('IS_LINUX'))
\define('IS_LINUX', ('/' === \DS));
if (!\defined('IS_MACOS'))
\define('IS_MACOS', (\PHP_OS === 'Darwin'));
if (!\defined('EOL'))
\define('EOL', \PHP_EOL);
if (!\defined('CRLF'))
\define('CRLF', "\r\n");
if (!\defined('IS_ZTS'))
\define('IS_ZTS', \ZEND_THREAD_SAFE);
if (!\defined('IS_CLI')) {
/**
* Check if php is running from cli (command line).
*/
\define(
'IS_CLI',
\defined('STDIN') ||
(empty($_SERVER['REMOTE_ADDR']) && !isset($_SERVER['HTTP_USER_AGENT']) && \count($_SERVER['argv']) > 0)
);
}
if (!\defined('SYS_CONSOLE')) {
/**
* O.S. physical __input/output__ console `DEVICE`.
*/
\define('SYS_CONSOLE', \IS_WINDOWS ? '\\\\?\\CON' : '/dev/tty');
}
if (!\defined('SYS_NULL')) {
/**
* O.S. physical __null__ `DEVICE`.
*/
\define('SYS_NULL', \IS_WINDOWS ? '\\\\?\\NUL' : '/dev/null');
}
if (!\defined('SYS_PIPE')) {
/**
* O.S. physical __pipe__ prefix `string name` including trailing slash.
*/
\define('SYS_PIPE', \IS_WINDOWS ? '\\\\.\\pipe\\' : \getcwd() . '/');
}
if (!\defined('IS_PHP83'))
\define('IS_PHP83', ((float) \phpversion() >= 8.3));
if (!\defined('IS_PHP82'))
\define('IS_PHP82', ((float) \phpversion() >= 8.2) && !\IS_PHP83);
if (!\defined('IS_PHP81'))
\define('IS_PHP81', ((float) \phpversion() >= 8.1) && !\IS_PHP82);
if (!\defined('IS_PHP8'))
\define('IS_PHP8', ((float) \phpversion() >= 8.0));
if (!\defined('IS_PHP80'))
\define('IS_PHP80', (\IS_PHP8 && !\IS_PHP81));
if (!\defined('IS_PHP74'))
\define('IS_PHP74', ((float) \phpversion() >= 7.4) && !\IS_PHP8);
if (!\defined('ZEND_MODULE_API_NO'))
\define(
'ZEND_MODULE_API_NO',
\IS_PHP80 ? 20200930
: (\IS_PHP81 ? 20210902
: (\IS_PHP82 ? 20220829
: (\IS_PHP83 ? 20220830
: 20190902
)
)
)
);
if (!\defined('STDIN')) {
\define('STDIN', \fopen('php://stdin', 'r'));
}
if (!\defined('STDOUT')) {
\define('STDOUT', \fopen('php://stdout', 'w'));
}
if (!\defined('STDERR')) {
\define('STDERR', \fopen('php://stderr', 'w+'));
}
if (!\function_exists('setup_ffi_loader')) {
function ffi_cdef(string $code, string $lib = null): \FFI
{
if (!empty($lib)) {
return \FFI::cdef($code, $lib);
} else {
return \FFI::cdef($code);
}
}
/**
* @return php_stream
*/
function stream_stdout(): CData
{
return \ffi_object(\Core::get_stdio(1));
}
/**
* @return php_stream
*/
function stream_stdin(): CData
{
return \ffi_object(\Core::get_stdio(0));
}
/**
* @return php_stream
*/
function stream_stderr(): CData
{
return \ffi_object(\Core::get_stdio(2));
}
/**
* Returns **cast** a `zend` pointer as `typedef`.
*
* @param string $typedef
* @param object $ptr
* @return CData
*/
function ze_cast(string $typedef, $ptr): CData
{
return \Core::cast('ze', $typedef, \ffi_object($ptr));
}
/**
* Returns **cast** a `void*` pointer.
*
* @param CData $ptr
* @return CData void_ptr
*/
function ffi_void($ptr): CData
{
return \FFI::cast('void*', $ptr);
}
function ffi_set(string $tag, ?FFI $ffi): void
{
\Core::set($tag, $ffi);
}
function ffi_get(string $tag): ?\FFI
{
return \Core::get($tag);
}
/**
* Returns `C pointer` _addr_ of `C data` _type_.
*
* @param CData $ptr
* @return FFI\CData
*/
function ffi_ptr(CData $ptr): CData
{
return \FFI::addr($ptr);
}
/**
* Convert `C string` to PHP `string`.
*
* @param CData $ptr
* @return string
*/
function ffi_string(CData $ptr): string
{
return \FFI::string($ptr);
}
/**
* Convert PHP `string` to `C string`.
*
* @param string $string
* @param bool $owned
* @return CData char **pointer** of `string`
*/
function ffi_char(string $string, bool $owned = false, bool $persistent = false): CData
{
$size = \strlen($string);
$ptr = \FFI::new('char[' . ($size + 1) . ']', $owned, $persistent);
\FFI::memcpy($ptr, $string, $size);
return $ptr;
}
/**
* Convert PHP array of `string` to `char**` _C string_.
*
* @param string $string
* @return CData __char**__
*/
function ffi_char_variadic(string ...$string): CData
{
$n = 0;
$string_args = \FFI::new('char*[' . (\count($string) + 2) . ']', false);
foreach ($string as $value) {
$string_args[$n] = \ffi_char($value);
$n++;
}
$string_args[$n] = NULL;
return \FFI::cast('char**', $string_args);
}
/**
* Convert PHP associate array to _environment_ `char**` _C string_.
*
* @param array $env
* @return CData __char**__
*/
function ffi_char_assoc(array ...$items): ?CData
{
if (@\count(@\reset($items)) > 0) {
$i = 0;
$environment = \FFI::new('char*[' . (\count($items) + 1) . ']', false);
foreach ($items as $key => $value) {
$is = \is_array($value);
$key = $is ? \array_key_first($value) : $key;
$entry = \sprintf('%s=%s', $key, $is ? $value[$key] : $value);
$environment[$i] = \ffi_char($entry);
$i++;
}
$environment[$i] = NULL;
return \ze_cast('char**', $environment);
}
return null;
}
/**
* Creates a `char` C data structure of size.
*
* @param int $size
* @param bool $owned
* @return CData `char` C structure
*/
function ffi_characters(int $size, bool $owned = true): CData
{
$ptr = \FFI::new('char[' . ($size + 1) . ']', $owned);
return $ptr;
}
/**
* Checks `handle` and returns the `CData` object _pointer_ within by _invoking_.
*
* @param object $handle
* @return CData
*/
function ffi_object(object $handle): CData
{
return ($handle instanceof \ZE || $handle instanceof \CStruct || !\is_cdata($handle))
? $handle()
: $handle;
}
function ffi_null(): CData
{
return \FFI::cast('void*', 0);
}
function ffi_set_free(bool $status): void
{
\CStruct::ffi_free_set($status);
}
/**
* Check and manually removes an _list_ of previously created `C` data memory pointer.
*
* @param object|CData ...$ptr
* @return void
*/
function ffi_free_if(...$ptr): void
{
if (\CStruct::is_ffi_free_active()) {
foreach ($ptr as $cdata) {
try {
$object = ($cdata instanceof \ZE || $cdata instanceof \CStruct || !\is_cdata($cdata))
? $cdata()
: $cdata;
if (\is_cdata($object) && !\FFI::isNull($object))
\FFI::free($object);
} catch (\Throwable $e) {
}
}
}
}
/**
* Returns size of C data type of `object` or the given FFI\CData or FFI\CType.
*
* @param mixed $object
* @return integer
*/
function ffi_sizeof($object): int
{
if ($object instanceof \ZE)
$object = $object();
elseif ($object instanceof \CStruct)
return $object->sizeof();
elseif (!\is_cdata($object) || !$object instanceof CType)
$object = \zval_stack(0)()[0];
return \FFI::sizeof($object);
}
/**
* Returns the _CType_ **string** representing the `FFI\CData` object.
*
* @param CData $ptr
* @return string
*/
function ffi_str_typeof(CData $ptr): string
{
return \trim(\str_replace(['FFI\CType:', ' Object', "\n", '(', ')'], '', \print_r(\FFI::typeof($ptr), true)));
}
/**
* @return \FFI global interface to _PHP/Zend_ **_C_** library.
*/
function ze_ffi(): \FFI
{
return \Core::get('ze');
}
function misc_ffi(): \FFI
{
return \Core::get('misc');
}
/**
* @return \FFI global interface to _PThreads_ **_C_** library.
*/
function ts_ffi(): \FFI
{
return \Core::get('ts');
}
/**
* Checks whether the given `FFI\CData` object __C type__, it's *typedef* are equal.
*
* @param CData $ptr
* @param string $ctype typedef
* @return boolean
*/
function is_typeof(CData $ptr, string $ctype): bool
{
return \ffi_str_typeof($ptr) === $ctype;
}
/**
* Checks whether the given object is `FFI\CData`.
*
* @param mixed $ptr
* @return boolean
*/
function is_cdata($ptr): bool
{
return $ptr instanceof CData;
}
/**
* Checks whether the given _c struct_ object is `FFI\CData`, and has the given member `field`.
*
* @param object $ptr
* @param string $field member depth, up three levels *c_field0->c_field1->c_field2*
* @return boolean
*/
function is_cdata_valid(object $ptr, string $field): bool
{
try {
if (\strpos($field, '->') !== false) {
$fields = \explode('->', $field);
if (\count($fields) == 3)
\ffi_object($ptr)->{$fields[0]}->{$fields[1]}->{$fields[2]};
elseif (\count($fields) == 2)
\ffi_object($ptr)->{$fields[0]}->{$fields[1]};
} else {
\ffi_object($ptr)->{$field};
}
return true;
} catch (\Throwable $e) {
return false;
}
}
/**
* Checks whether the `FFI\CData` is a null pointer.
*
* @param object $ptr
* @return boolean
*/
function is_null_ptr(object $ptr): bool
{
try {
return \FFI::isNull(\ffi_object($ptr));
} catch (\Throwable $e) {
return true;
}
}
/**
* Check for _active_ `PHP Engine` **ffi** instance
*
* @return boolean
*/
function is_ze_ffi(): bool
{
return \Core::get('ze') instanceof \FFI;
}
/**
* Check for _active_ `pthreads` **ffi** instance
*
* @return boolean
*/
function is_ts_ffi(): bool
{
return \Core::get('ts') instanceof \FFI;
}
/**
* Temporary enable `cli` if needed to preform a the `routine` call.
*
* @param callable $routine
* @param mixed ...$arguments
* @return mixed
*/
function cli_direct(callable $routine, ...$arguments)
{
$cdata = \ze_ffi()->sapi_module;
$old = \ffi_string($cdata->name);
$changed = false;
if ($old !== 'cli') {
$changed = true;
$cdata->name = \ffi_char('cli');
}
$result = $routine(...$arguments);
if ($changed)
$cdata->name = \ffi_char($old);
return $result;
}
function bail_if_fail($X, string $file, int $lineno)
{
if (($X) != 0)
\ze_ffi()->_zend_bailout($file, $lineno);
}
/**
* Temporary enable `cli` if needed to preform a `php://fd/` **_php_stream_open_wrapper_ex()** call.
* - Same as `zval_fd_direct()` but returns underlying Zend **php_stream** _C structure_ of `resource`.
*
* @param integer $resource fd number
* @return PhpStream
*/
function php_stream_direct(int $resource): ?PhpStream
{
return \cli_direct(function (int $type) {
$fd = \Core::get_stdio($type);
if ($fd === null) {
return PhpStream::open_wrapper('php://fd/' . $type, '', 0);
}
return $fd;
}, $resource);
}
/**
* Gets class name
*
* @param object $handle
* @return string
*/
function reflect_object_name(object $handle): string
{
return (new \ReflectionObject($handle))->getName();
}
/**
* Converts a **class** instance `method` into a _closure_.
*
* @param object $class instance
* @param string $method callable
* @return \Closure
*/
function closure_from(object $class, string $method): \Closure
{
return \Closure::fromCallable([$class, $method]);
}
/**
* Converts the unsigned integer netlong from network byte order to host byte order.
*
* @param mixed $str
* @return int
*/
function ntohl(...$str)
{
return \unpack('I', \pack('N', ...$str))[1];
}
/**
* Converts the unsigned integer hostlong from host byte order to network byte order.
*
* @param mixed $str
* @return int
*/
function htonl(...$str)
{
return \unpack('N', \pack('I', ...$str))[1];
}
/**
* Converts the unsigned short integer netshort from network byte order to host byte order.
*
* @param mixed $str
* @return int
*/
function ntohs(...$str)
{
return \unpack('S', \pack('n', ...$str))[1];
}
/**
* Converts the unsigned short integer hostshort from host byte order to network byte order.
*
* @param mixed $str
* @return int
*/
function htons(...$str)
{
return \unpack('n', \pack('S', ...$str))[1];
}
/**
* Creates/returns `C data` **int** base _typedef_, a generic `FFI` _CStruct_ class _instance_.
*
* @param string $typedef
* @param string $ffi_tag
* @param int $value
* @param boolean $owned
* @param boolean $persistent
* @return \CStruct
*/
function c_int_type(
string $typedef,
string $ffi_tag = 'ze',
$value = null,
bool $owned = true,
bool $persistent = false
): \CStruct {
return \CStruct::integer_init($typedef, $ffi_tag, $value, $owned, $persistent);
}
/**
* Creates/returns `C data` **struct** base _typedef_, a generic `FFI` _CStruct_ class _instance_.
*
* @param string $typedef
* @param string $ffi_tag
* @param array|null $values
* @param boolean $owned
* @param boolean $persistent
* @return \CStruct
*/
function c_struct_type(
string $typedef,
string $ffi_tag = 'ze',
array $values = null,
bool $owned = true,
bool $persistent = false
): \CStruct {
return \CStruct::struct_init($typedef, $ffi_tag, $values, $owned, $persistent);
}
/**
* Creates/returns `C data` **type** _typedef_, a generic `FFI` _CStruct_ class _instance_.
*
* @param string $type
* @param string $ffi_tag
* @param boolean $owned
* @param boolean $persistent
* @return \CStruct
*/
function c_typedef(
string $type,
string $ffi_tag = 'ze',
bool $owned = true,
bool $persistent = false
): \CStruct {
return \CStruct::type_init($type, $ffi_tag, $owned, $persistent);
}
/**
* Creates/return `C data` **array** base _typedef_, a generic `FFI` _CStruct_ class _instance_.
*
* @param string $typedef
* @param string $ffi_tag
* @param integer $size
* @param boolean $owned
* @param boolean $persistent
* @return \CStruct
*/
function c_array_type(
string $typedef,
string $ffi_tag = 'ze',
int $size = 1,
bool $owned = true,
bool $persistent = false
): \CStruct {
return \CStruct::array_init($typedef, $ffi_tag, $size, $owned, $persistent);
}
function ze_init(): void
{
if (!\is_ze_ffi()) {
// Try if preloaded
try {
\Core::set('ze', \FFI::scope("__zend__"));
\Core::scope_set();
} catch (\Throwable $e) {
\zend_preloader();
}
if (!\is_ze_ffi()) {
throw new \RuntimeException("FFI parse failed!");
}
}
}
/**
* @param string $tag name for a **FFI** `instance`
* @param string $cdef_file C header file for `\FFI::load`
* @return void
*/
function setup_ffi_loader(string $tag, string $cdef_file): void
{
\Core::set($tag, \FFI::load($cdef_file));
}
function zend_preloader(): void
{
$minor = \IS_PHP81 ? '1'
: (\IS_PHP82 ? '2'
: (\IS_PHP83 ? '3'
: '')
);
$os = __DIR__ . \DS . (\PHP_OS_FAMILY === 'Windows' ? 'headers\zeWin' : 'headers/ze');
$php = $os . \PHP_MAJOR_VERSION . $minor . (\PHP_ZTS ? 'ts' : '') . '.h';
\setup_ffi_loader('ze', $php);
if (\IS_WINDOWS) {
$mmap_header = __DIR__ . '\\headers\\windows_mman.h';
if (\file_exists('vendor\\symplely\\zend-ffi')) {
$vendor_code = \str_replace('.h', '_generated.h', $mmap_header);
if (!\file_exists($vendor_code)) {
$file = \str_replace(
'FFI_LIB ".',
'FFI_LIB "vendor\\\symplely\\\zend-ffi',
\file_get_contents($mmap_header)
);
\file_put_contents(
$vendor_code,
$file,
\LOCK_EX
);
}
$mmap_header = $vendor_code;
}
\setup_ffi_loader('misc', $mmap_header);
}
if (\file_exists('.' . \DS . 'ffi_extension.json')) {
$loader = function ($iterator, bool $isDir) {
foreach ($iterator as $fileInfo) {
if ($isDir && !$fileInfo->isFile())
continue;
$file = $isDir ? $fileInfo->getPathname() : $fileInfo;
include_once $file;
}
};
$preload_list = \json_decode(\file_get_contents('.' . \DS . 'ffi_extension.json'), true);
if (isset($preload_list['preload']['directory'])) {
foreach ($preload_list['preload']['directory'] as $directory) {
$dir = new \RecursiveDirectoryIterator($directory, \RecursiveDirectoryIterator::KEY_AS_PATHNAME);
$iterator = new \RecursiveIteratorIterator($dir, \RecursiveIteratorIterator::SELF_FIRST);
$loader($iterator, true);
}
}
if (isset($preload_list['preload']['files'])) {
$loader($preload_list['preload']['files'], false);
}
if (\PHP_ZTS) {
try {
\Core::set('ts', \FFI::scope("__threads__"));
} catch (\Throwable $e) {
$dir = __DIR__;
if (\IS_WINDOWS)
$header = $dir . '\\headers\\windows_pthreads.h';
elseif (\file_exists($dir . '/headers/linux_pthreads.h'))
$header = $dir . '/headers/linux_pthreads.h';
else {
$platform = null;
if (\PHP_OS == 'Darwin')
$platform .= '/usr/lib/libpthread.dylib';
elseif (\php_uname('m') == 'aarch64')
$platform .= '/usr/lib/aarch64-linux-gnu/libpthread.so';
else {
$header = null;
$os = [];
$files = \glob('/etc/*-release');
foreach ($files as $file) {
$lines = \array_filter(\array_map(function ($line) {
// split value from key
$parts = \explode('=', $line);
// makes sure that "useless" lines are ignored (together with array_filter)
if (\count($parts) !== 2)
return false;
// remove quotes, if the value is quoted
$parts[1] = \str_replace(['"', "'"], '', $parts[1]);
return $parts;
}, \file($file)));
foreach ($lines as $line)
$os[$line[0]] = $line[1];
}
$like = \trim((string) $os['ID_LIKE']);
if ($like == 'debian')
$platform = '/lib/x86_64-linux-gnu/libpthread.so.0';
elseif ($like =='redhat' || $like === 'fedora')
$platform = '/usr/lib64/libpthread.so';
}
if (!\is_null($platform)) {
\file_put_contents(
$dir . '/headers/linux_pthreads.h',
\str_replace(
'__platforms_pthread_library_location__',
$platform,
\file_get_contents($dir . '/headers/linux_native_threads.h')
),
\LOCK_EX
);
$header = $dir . '/headers/linux_pthreads.h';
}
}
if (\file_exists('vendor\\symplely\\zend-ffi') && \IS_WINDOWS) {
$vendor_code = \str_replace('.h', '_generated.h', $header);
if (!\file_exists($vendor_code)) {
$file = \str_replace(
'FFI_LIB ".',
'FFI_LIB "vendor\\\symplely\\\zend-ffi',
\file_get_contents($header)
);
\file_put_contents(
$vendor_code,
$file,
\LOCK_EX
);
}
$header = $vendor_code;
}
\setup_ffi_loader('ts', $header);
}
}
}
}
\ze_init();
}