2 +--------------------------------------------------------------------+
4 +--------------------------------------------------------------------+
5 | Redistribution and use in source and binary forms, with or without |
6 | modification, are permitted provided that the conditions mentioned |
7 | in the accompanying LICENSE file are met. |
8 +--------------------------------------------------------------------+
9 | Copyright (c) 2013, Michael Wallner <mike@php.net> |
10 +--------------------------------------------------------------------+
19 #include <ext/standard/info.h>
24 #include "php_pq_misc.h"
25 #include "php_pqcancel.h"
26 #include "php_pqconn.h"
27 #include "php_pqcopy.h"
28 #include "php_pqcur.h"
29 #include "php_pqexc.h"
30 #include "php_pqlob.h"
31 #include "php_pqres.h"
32 #include "php_pqstm.h"
33 #include "php_pqtxn.h"
34 #include "php_pqtypes.h"
36 #define PHP_MINIT_CALL(i) do { \
37 if (SUCCESS != PHP_MINIT(i)(type, module_number TSRMLS_CC)) { \
42 static PHP_MINIT_FUNCTION(pq
)
44 PHP_MINIT_CALL(pq_misc
);
45 PHP_MINIT_CALL(pqexc
);
47 PHP_MINIT_CALL(pqconn
);
48 PHP_MINIT_CALL(pqcancel
);
49 PHP_MINIT_CALL(pqtypes
);
51 PHP_MINIT_CALL(pqres
);
52 PHP_MINIT_CALL(pqstm
);
53 PHP_MINIT_CALL(pqtxn
);
54 PHP_MINIT_CALL(pqcur
);
56 PHP_MINIT_CALL(pqcopy
);
57 PHP_MINIT_CALL(pqlob
);
59 return php_persistent_handle_provide(ZEND_STRL("pq\\Connection"), php_pqconn_get_resource_factory_ops(), NULL
, NULL TSRMLS_CC
);
62 #define PHP_MSHUT_CALL(i) do { \
63 if (SUCCESS != PHP_MSHUTDOWN(i)(type, module_number TSRMLS_CC)) { \
68 static PHP_MSHUTDOWN_FUNCTION(pq
)
70 php_persistent_handle_cleanup(ZEND_STRL("pq\\Connection"), NULL
, 0 TSRMLS_CC
);
72 PHP_MSHUT_CALL(pqlob
);
73 PHP_MSHUT_CALL(pqcopy
);
74 PHP_MSHUT_CALL(pqcur
);
75 PHP_MSHUT_CALL(pqtxn
);
76 PHP_MSHUT_CALL(pqstm
);
77 PHP_MSHUT_CALL(pqres
);
78 PHP_MSHUT_CALL(pqtypes
);
79 PHP_MSHUT_CALL(pqcancel
);
80 PHP_MSHUT_CALL(pqconn
);
85 static PHP_MINFO_FUNCTION(pq
)
87 #ifdef HAVE_PQLIBVERSION
90 char libpq_version
[10] = "pre-9.1";
92 php_info_print_table_start();
93 php_info_print_table_header(2, "PQ Support", "enabled");
94 php_info_print_table_row(2, "Extension Version", PHP_PQ_VERSION
);
95 php_info_print_table_end();
97 php_info_print_table_start();
98 php_info_print_table_header(3, "Used Library", "Compiled", "Linked");
99 #ifdef HAVE_PQLIBVERSION
100 libpq_v
= PQlibVersion();
101 slprintf(libpq_version
, sizeof(libpq_version
), "%d.%d.%d", libpq_v
/10000%100, libpq_v
/100%100, libpq_v
%100);
103 php_info_print_table_row(3, "libpq", PHP_PQ_LIBVERSION
, libpq_version
);
104 php_info_print_table_end();
107 static const zend_function_entry pq_functions
[] = {
111 static zend_module_dep pq_module_deps
[] = {
112 ZEND_MOD_REQUIRED("raphf")
113 ZEND_MOD_REQUIRED("spl")
114 ZEND_MOD_OPTIONAL("json")
118 zend_module_entry pq_module_entry
= {
119 STANDARD_MODULE_HEADER_EX
,
126 NULL
,/*PHP_RINIT(pq),*/
127 NULL
,/*PHP_RSHUTDOWN(pq),*/
130 STANDARD_MODULE_PROPERTIES
143 * vim600: noet sw=4 ts=4 fdm=marker
144 * vim<600: noet sw=4 ts=4