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_pqexc.h"
29 #include "php_pqlob.h"
30 #include "php_pqres.h"
31 #include "php_pqstm.h"
32 #include "php_pqtxn.h"
33 #include "php_pqtypes.h"
35 #define PHP_MINIT_CALL(i) do { \
36 if (SUCCESS != PHP_MINIT(i)(type, module_number TSRMLS_CC)) { \
41 static PHP_MINIT_FUNCTION(pq
)
43 PHP_MINIT_CALL(pq_misc
);
44 PHP_MINIT_CALL(pqexc
);
46 PHP_MINIT_CALL(pqconn
);
47 PHP_MINIT_CALL(pqcancel
);
48 PHP_MINIT_CALL(pqtypes
);
50 PHP_MINIT_CALL(pqres
);
51 PHP_MINIT_CALL(pqstm
);
52 PHP_MINIT_CALL(pqtxn
);
53 PHP_MINIT_CALL(pqcur
);
55 PHP_MINIT_CALL(pqcopy
);
56 PHP_MINIT_CALL(pqlob
);
58 return php_persistent_handle_provide(ZEND_STRL("pq\\Connection"), php_pqconn_get_resource_factory_ops(), NULL
, NULL TSRMLS_CC
);
61 #define PHP_MSHUT_CALL(i) do { \
62 if (SUCCESS != PHP_MSHUTDOWN(i)(type, module_number TSRMLS_CC)) { \
67 static PHP_MSHUTDOWN_FUNCTION(pq
)
69 php_persistent_handle_cleanup(ZEND_STRL("pq\\Connection"), NULL
, 0 TSRMLS_CC
);
71 PHP_MSHUT_CALL(pqlob
);
72 PHP_MSHUT_CALL(pqcopy
);
73 PHP_MSHUT_CALL(pqtxn
);
74 PHP_MSHUT_CALL(pqstm
);
75 PHP_MSHUT_CALL(pqres
);
76 PHP_MSHUT_CALL(pqtypes
);
77 PHP_MSHUT_CALL(pqcancel
);
78 PHP_MSHUT_CALL(pqconn
);
83 static PHP_MINFO_FUNCTION(pq
)
85 #ifdef HAVE_PQLIBVERSION
88 char libpq_version
[10] = "pre-9.1";
90 php_info_print_table_start();
91 php_info_print_table_header(2, "PQ Support", "enabled");
92 php_info_print_table_row(2, "Extension Version", PHP_PQ_VERSION
);
93 php_info_print_table_end();
95 php_info_print_table_start();
96 php_info_print_table_header(2, "Used Library", "Version");
97 #ifdef HAVE_PQLIBVERSION
98 libpq_v
= PQlibVersion();
99 slprintf(libpq_version
, sizeof(libpq_version
), "%d.%d.%d", libpq_v
/10000%100, libpq_v
/100%100, libpq_v
%100);
101 php_info_print_table_row(2, "libpq", libpq_version
);
102 php_info_print_table_end();
105 static const zend_function_entry pq_functions
[] = {
109 static zend_module_dep pq_module_deps
[] = {
110 ZEND_MOD_REQUIRED("raphf")
111 ZEND_MOD_REQUIRED("spl")
112 ZEND_MOD_OPTIONAL("json")
116 zend_module_entry pq_module_entry
= {
117 STANDARD_MODULE_HEADER_EX
,
124 NULL
,/*PHP_RINIT(pq),*/
125 NULL
,/*PHP_RSHUTDOWN(pq),*/
128 STANDARD_MODULE_PROPERTIES
141 * vim600: noet sw=4 ts=4 fdm=marker
142 * vim<600: noet sw=4 ts=4