From 6c4ff800fcd7582b3bacb25ccd5e2c5374cf634f Mon Sep 17 00:00:00 2001 From: Martijn Otto Date: Mon, 17 Feb 2014 16:43:47 +0100 Subject: Removed the static property from the example as this is not currently enabled --- Examples/ConstStaticProp/cpp/mytestext.cpp | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'Examples') 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 - * + * * 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({ - + // Private PHP constructor! You can't instance object of MyTestClass Php::Private("__construct", Php::Method(&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(); } -- cgit v1.2.3