diff options
author | Martijn Otto <martijn.otto@copernica.com> | 2014-02-17 16:43:47 +0100 |
---|---|---|
committer | Martijn Otto <martijn.otto@copernica.com> | 2014-02-17 16:43:47 +0100 |
commit | 6c4ff800fcd7582b3bacb25ccd5e2c5374cf634f (patch) | |
tree | 32d89ec661cc21161b05fee1f99221d2247d14d8 /Examples | |
parent | ff3c75d116f3764253b727b3d8e8106710c22628 (diff) |
Removed the static property from the example as this is not currently enabled
Diffstat (limited to 'Examples')
-rw-r--r-- | Examples/ConstStaticProp/cpp/mytestext.cpp | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/Examples/ConstStaticProp/cpp/mytestext.cpp b/Examples/ConstStaticProp/cpp/mytestext.cpp index 7d8dc95..7b5d0ce 100644 --- a/Examples/ConstStaticProp/cpp/mytestext.cpp +++ b/Examples/ConstStaticProp/cpp/mytestext.cpp @@ -1,7 +1,7 @@ /** * cppclassinphp.cpp * @author Jasper van Eck<jasper.vaneck@copernica.com> - * + * * An example file to show the working of using a C++ class in PHP. */ @@ -13,43 +13,41 @@ using namespace std; class MyTestExt : public Php::Base { - + public: MyTestExt() {} - + virtual ~MyTestExt() {} virtual void __construct() {} - + }; // Symbols are exported according to the "C" language -extern "C" +extern "C" { // export the "get_module" function that will be called by the Zend engine PHPCPP_EXPORT void *get_module() { // create extension static Php::Extension extension("my_test_ext","0.1a"); - + // add the custom class ot the extension extension.add( - "MyTestClass", + "MyTestClass", Php::Class<MyTestExt>({ - + // Private PHP constructor! You can't instance object of MyTestClass Php::Private("__construct", Php::Method<MyTestExt>(&MyTestExt::__construct)), - + Php::Const("version", "v0.01-alpha"), Php::Const("PI", 3.14159265), Php::Const("IMISNULL"), - - Php::Static("exp", 2.71828182846), }) ); - + // return the extension module return extension.module(); } |