diff options
-rw-r--r-- | Examples/CallPhpFunctions/callphpfunction.cpp | 4 | ||||
-rw-r--r-- | Examples/FunctionWithParameters/functionwithparameters.cpp | 8 | ||||
-rw-r--r-- | Examples/simple/simple.cpp | 18 | ||||
-rw-r--r-- | include/classbase.h | 3 |
4 files changed, 17 insertions, 16 deletions
diff --git a/Examples/CallPhpFunctions/callphpfunction.cpp b/Examples/CallPhpFunctions/callphpfunction.cpp index 9932a3e..9190065 100644 --- a/Examples/CallPhpFunctions/callphpfunction.cpp +++ b/Examples/CallPhpFunctions/callphpfunction.cpp @@ -43,8 +43,8 @@ extern "C" // add function to extension extension.add("call_php_function", call_php_function, { - Php::ByVal("addFunc", Php::callableType), - Php::ByVal("x", Php::numericType) + Php::ByVal("addFunc", Php::Type::Callable), + Php::ByVal("x", Php::Type::Numeric) }); // return the extension module diff --git a/Examples/FunctionWithParameters/functionwithparameters.cpp b/Examples/FunctionWithParameters/functionwithparameters.cpp index dd7bb9f..2600bad 100644 --- a/Examples/FunctionWithParameters/functionwithparameters.cpp +++ b/Examples/FunctionWithParameters/functionwithparameters.cpp @@ -99,18 +99,18 @@ extern "C" // add function, with defined numeric parameters, to extension extension.add("my_with_defined_parameters_function", my_with_defined_parameters_function, { - Php::ByVal("x", Php::numericType), - Php::ByVal("y", Php::numericType) + Php::ByVal("x", Php::Type::Numeric), + Php::ByVal("y", Php::Type::Numeric) }); // add function, with defined parameter by reference, to extension extension.add("my_with_defined_parameters_reference_function", my_with_defined_parameters_reference_function, { - Php::ByRef("string", Php::stringType) + Php::ByRef("string", Php::Type::String) }); // add function, with defined array parameter, to extension extension.add("my_with_defined_array_parameters_function", my_with_defined_array_parameters_function, { - Php::ByVal("array", Php::arrayType) + Php::ByVal("array", Php::Type::Array) }); // add function, with defined object parameter, to extension diff --git a/Examples/simple/simple.cpp b/Examples/simple/simple.cpp index 3a93bdc..bfbcfab 100644 --- a/Examples/simple/simple.cpp +++ b/Examples/simple/simple.cpp @@ -161,21 +161,21 @@ extern "C" // define the functions extension.add("my_plus", my_plus, { - Php::ByVal("a", Php::numericType), - Php::ByVal("b", Php::numericType), + Php::ByVal("a", Php::Type::Numeric), + Php::ByVal("b", Php::Type::Numeric), Php::ByVal("c", "MyClass"), - Php::ByRef("d", Php::stringType) + Php::ByRef("d", Php::Type::String) }); extension.add("bubblesort", bubblesort); - Php::Method<MyCustomClass> x(&MyCustomClass::myMethod); - // define classes - extension.add("my_class", Php::Class<MyCustomClass>({ - Php::Public("myMethod", Php::Method<MyCustomClass>(&MyCustomClass::myMethod)), - Php::Public("__construct", Php::Method<MyCustomClass>(&MyCustomClass::__construct)) - })); + Php::Class<MyCustomClass> myCustomClass("my_class"); + myCustomClass.method("mymethod", &MyCustomClass::myMethod); + myCustomClass.method("__construct", &MyCustomClass::__construct); + + // add to extension + extension.add(myCustomClass); // return the module entry return extension.module(); diff --git a/include/classbase.h b/include/classbase.h index d3f3833..9dd4628 100644 --- a/include/classbase.h +++ b/include/classbase.h @@ -18,6 +18,7 @@ * Forward declarations */ struct _zend_object_value; +struct _zend_object_handlers; /** * Set up namespace @@ -217,7 +218,7 @@ private: * Retrieve pointer to our own object handlers * @return zend_object_handlers */ - static zend_object_handlers *objectHandlers(); + static struct _zend_object_handlers *objectHandlers(); /** * Name of the class |