多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
[TOC] ## 示例 ### 读取php.ini变量 ``` void myFunction() { int output_buffering = Php::ini_get("output_buffering"); std::string variables_order = Php::ini_get("variables_order"); } ``` ### 从php.ini中检索预定义的变量 则必须先在get_module()函数中注册它们,然后才能调用Php :: ini_get()检索当前值 ``` #include <phpcpp.h> void myFunction() { int var1 = Php::ini_get("my_extension.var1"); std::string var2 = Php::ini_get("my_extension.var2"); } extern "C" { PHPCPP_EXPORT void *get_module() { static Php::Extension extension("my_extension", "1.0"); // export one function extension.add("myFunction", myFunction); // 注册 配置 extension.add(Php::Ini("my_extension.var1", "default-value")); extension.add(Php::Ini("my_extension.var2", 12345)); // return a pointer to the extension object return extension; } } ```