moriyoshi / boost.php Goto Github PK
View Code? Open in Web Editor NEWCreate your PHP extension in C++, in a minute.
Create your PHP extension in C++, in a minute.
Hello,
Would you have some tutoral on how to Migrating magento source code into boost.php?
My aim is to hafe a full magento php code as much as I can with c/c++ extension.
Could you also tell me the difference between boost.php and https://github.com/CopernicaMarketingSoftware/PHP-CPP
Regards, Heather
Hi there,
This looks very good but there's no example on Windows. Does this works? With VC9?
Thanks
Ricardo
I've got a bunch of classes that I've written, that I need to be able to use in this PHP module I'm building. For every single class I've written (lots), do I have to put it in the __initialize function and link all of that classes methods, even though I don't want to expose the functionality of that class? The issue I run into is that when I load the .so into PHP and try to run the exposed method, it says "undefined symbol" for the class I've defined in the module. The code compiles just fine. Here's an example:
#include "boost/php/module.hpp"
#include "boost/php/function.hpp"
#include "boost/php/klass.hpp"
using namespace boost;
// --------------------------------
class MyUtilClass {
public:
MyUtilClass();
std::string GetRandomDomain() {
return "@randomdomain.com";
}
};
// -------------------------------
class email_gen_module
: public php::module,
public php::function_container<email_gen_module> {
public:
class handler : public php::module::handler {
public:
handler(email_gen_module* mod) : php::module::handler(mod) {}
std::string getRandomEmail() {
MyUtilClass c;
std::string user = "randomuser";
std::string domain = c.GetRandomDomain();
return user + domain;
}
};
public:
email_gen_module(zend_module_entry* entry) : php::module(entry) {
entry->functions = defun("getRandomEmail", &handler::getRandomEmail);
}
};
#define BOOST_PHP_MODULE_NAME email_gen_module
#define BOOST_PHP_MODULE_CAPITALIZED_NAME EMAIL_GEN_MODULE
#define BOOST_PHP_MODULE_VERSION "0.1"
#define BOOST_PHP_MODULE_CLASS_NAME email_gen_module
#include "phpboost/module_def.hpp"
Thanks! And thanks for building this C++ interface!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.