Slide 8
Slide 8 text
Foreign Function Interface(FFI)
-
This extension allows the loading of shared libraries (.DLL or .so), calling of C functions and accessing of C
data structures in pure PHP, without having to have deep knowledge of the Zend extension API, and without
having to learn a third “intermediate” language. The public API is implemented as a single class FFI with
several static methods (some of them may be called dynamically), and overloaded object methods, which
perform the actual interaction with C data.
-
この拡張モジュールを使用すると、共有ライブラリ (.DLL または .so) の読み込み、C 言語の関数の呼び出し、C 言語
のデータ構造へのアクセスを純粋な PHP で行うことができ、Zend 拡張モジュールの API を深く理解する必要も、第
三の「中間」言語を学ぶ必要もありません。パブリック API は、いくつかの静的メソッド (そのうちのいくつかは動的に
コールされることもあります) とオーバーロードされたオブジェクトメソッドを持つ単一の FFI クラスとして実装されてお
り、C データとの実際のやり取りを行います。
8