コード例 #1
0
 // 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_function_with_parameters","1.0");
     
     // add function, with undefined parameters, to extension
     extension.add<my_with_undefined_parameters_function>("my_with_undefined_parameters_function");
     
     // add function, with defined numeric parameters, to extension
     extension.add<my_with_defined_parameters_function>("my_with_defined_parameters_function", {
         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::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::Type::Array)
         });
     
     // add function, with defined object parameter, to extension
     extension.add<my_with_defined_object_parameters_function>("my_with_defined_object_parameters_function", {
         Php::ByVal("myClassObjVar", "MyPhpClass")
         });
     
     // return the extension module
     return extension.module();
 }
コード例 #2
0
    // 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_function_return_value","1.0");

        // add function to extension
        extension.add<my_return_value_function>("my_return_value_function");

        // return the extension module
        return extension.module();
    }
コード例 #3
0
ファイル: functionvoid.cpp プロジェクト: DewArmy/PHP-CPP
 // 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_function_void","1.0");
     
     // add function to extension
     extension.add("my_void_function", my_function_void);
     
     // return the extension module
     return extension.module();
 }
コード例 #4
0
ファイル: globals.cpp プロジェクト: DewArmy/PHP-CPP
 // export the "get_module" function that will be called by the Zend engine
 PHPCPP_EXPORT void *get_module()
 {
     // create extension
     static Php::Extension extension("globals","1.0");
     
     // add function to extension
     extension.add("process_globals", process_globals);
     
     // return the extension module
     return extension.module();
 }
コード例 #5
0
 // export the "get_module" function that will be called by the Zend engine
 PHPCPP_EXPORT void *get_module()
 {
     // create extension
     static Php::Extension extension("elmars", "1.0");
     extension.add("hallo", hello, {
         Php::ByVal("firstname", Php::Type::Numeric),
         Php::ByVal("lastname", Php::Type::String)
     });
     extension.add("sum_all", sumAll);
     // return the extension module
     return extension.module();
 }
コード例 #6
0
ファイル: callphpfunction.cpp プロジェクト: DewArmy/PHP-CPP
 // export the "get_module" function that will be called by the Zend engine
 PHPCPP_EXPORT void *get_module()
 {
     // create extension
     static Php::Extension extension("call_php_function","1.0");
     
     // add function to extension
     extension.add("call_php_function", call_php_function, {
         Php::ByVal("addFunc", Php::Type::Callable),
         Php::ByVal("x", Php::Type::Numeric)
         });
     
     // return the extension module
     return extension.module();
 }