Permalink
Browse files

Import sqlbuilder extension skeleton

  • Loading branch information...
1 parent 9e97c1b commit fac53edaf2460dc3715ff37a40da06923d2c119f @c9s committed Mar 20, 2013
Showing with 60 additions and 0 deletions.
  1. +11 −0 ext/config.m4
  2. +36 −0 ext/php_sqlbuilder.c
  3. +13 −0 ext/php_sqlbuilder.h
View
@@ -0,0 +1,11 @@
+
+PHP_ARG_ENABLE(sqlbuilder,
+ [Whether to enable the "sqlbuilder" extension],
+ [ --enable-sqlbuilder Enable "sqlbuilder" extension support])
+
+if test $PHP_SQLBUILDER != "no"; then
+ PHP_REQUIRE_CXX()
+ PHP_SUBST(SQLBUILDER_SHARED_LIBADD)
+ PHP_ADD_LIBRARY(stdc++, 1, SQLBUILDER_SHARED_LIBADD)
+ PHP_NEW_EXTENSION(sqlbuilder, php_sqlbuilder.c, $ext_shared)
+fi
View
@@ -0,0 +1,36 @@
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+#include "php.h"
+#include "php_sqlbuilder.h"
+
+static function_entry sqlbuilder_functions[] = {
+ PHP_FE(sqlbuilder_test, NULL)
+ {NULL, NULL, NULL}
+};
+
+zend_module_entry sqlbuilder_module_entry = {
+#if ZEND_MODULE_API_NO >= 20010901
+ STANDARD_MODULE_HEADER,
+#endif
+ PHP_SQLBUILDER_EXTNAME,
+ sqlbuilder_functions,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+#if ZEND_MODULE_API_NO >= 20010901
+ PHP_SQLBUILDER_VERSION,
+#endif
+ STANDARD_MODULE_PROPERTIES
+};
+
+#ifdef COMPILE_DL_SQLBUILDER
+ZEND_GET_MODULE(sqlbuilder)
+#endif
+
+PHP_FUNCTION(sqlbuilder_test)
+{
+ RETURN_STRING("Hello World", 1);
+}
View
@@ -0,0 +1,13 @@
+
+
+#ifndef PHP_SQLBUILDER_H
+#define PHP_SQLBUILDER_H 1
+#define PHP_SQLBUILDER_VERSION "1.0"
+#define PHP_SQLBUILDER_EXTNAME "sqlbuilder"
+
+PHP_FUNCTION(sqlbuilder_test);
+
+extern zend_module_entry sqlbuilder_module_entry;
+#define phpext_sqlbuilder_ptr &sqlbuilder_module_entry
+
+#endif

0 comments on commit fac53ed

Please sign in to comment.