PHP-CPPPHP 开发扩展 C++ 库
PHP-CPP是一个用于开发PHP扩展的C++库。它提供了一套详实易用的类,用于开发PHP扩展。详细文档说明:http://www.php-cpp.com
示例1:
Php::Value hello_world(){ return "hello world!";}
示例2:
#include <phpcpp.h> /** * Global variable that stores the number of times * the function updateCounters() has been called in total * @var int */ int invokeTotalCount = 0; /** * Global variable that keeps track how many times the * function updateCounters() was called during the * current request * @var int */ int invokeDuringRequestCount = 0; /** * Native function that is callable from PHP * * This function updates a number of global variables that count * the number of times a function was called */ void updateCounters() { // increment global counters invokeTotalCount++; invokeDuringRequestCount++; } /** * Switch to C context, because the Zend engine expects get get_module() * to have a C style function signature */ extern "C" { /** * Startup function that is automatically called by the Zend engine * when PHP starts, and that should return the extension details * @return void* */ PHPCPP_EXPORT void *get_module() { // the extension object static Php::Extension extension("my_extension", "1.0"); // install a callback that is called at the beginning // of each request extension.onRequest([]() { // re-initialize the counter invokeDuringRequestCount = 0; }); // add the updateCounter method to the extension extension.add("updateCounters", updateCounters); // return the extension details return extension; } }
评论
PyCXX用 C++ 开发 Python 扩展
PyCXX项目的目的是为了简化用C++开发Python扩展。PyCXXisasetofclassestohelpcreateextensionsofPythonintheC++language.The
PyCXX用 C++ 开发 Python 扩展
0
libXCam相机功能扩展开发库
libXCam是一个扩展相机功能的项目,专注于图像质量改进和视频分析。图像预处理,图像后处理和智能分析支持许多功能。该库使GPU/CPU/ISP协同工作以提高图像质量。OpenCL用于提高不同平台的性
libXCam相机功能扩展开发库
0
WebAppLibWEB开发的C++类库
WebAppLib是一系列主要用于类Unix操作系统环境下WEB开发的C++类库。设计目的是通过提供使用简单方便、相对独立的C++类和函数来简化CGI程序开发过程中的常见操作,提高开发效率,降低系统维
WebAppLibWEB开发的C++类库
0