This package provides an extended autocomplete for PHP FFI in a PhpStorm IDE.
And maybe something else... Offer as PR =))
- Create Configuration (like
ffi-gen-config.php
)
// Example C/C++ header declaration:
//
// typedef struct MyExampleStruct { ... } MyExampleStruct;
// extern void foo(MyExampleStruct* a);
// extern void foo(MyExampleStruct** b);
//
return [
'out' => __DIR__ . '/resources/stubs',
'types' => [
'MyExampleStruct' => ['pointers' => 2],
// ^^^^^^^^^^^^^^^^ ^ - Number of pointers.
// Your Class Name Number 2 means that will be created
// "MyExampleStructPtr" and "MyExampleStructPtrPtr" pointers
],
];
- Generate
$ vendor/bin/ffi-generator.php ffi-gen-config.php