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 <Zend/zend_interfaces.h>
25 #include <Zend/zend_exceptions.h>
26 #include <ext/spl/spl_array.h>
27 #include <ext/spl/spl_exceptions.h>
28 #include <ext/raphf/php_raphf.h>
30 #include <libpq-events.h>
31 #include <libpq/libpq-fs.h>
36 #include "php_pq_misc.h"
37 #include "php_pqcancel.h"
38 #include "php_pqconn.h"
39 #include "php_pqcopy.h"
40 #include "php_pqexc.h"
41 #include "php_pqlob.h"
42 #include "php_pqres.h"
43 #include "php_pqstm.h"
44 #include "php_pqtxn.h"
45 #include "php_pqtypes.h"
47 #define PHP_MINIT_CALL(i) do { \
48 if (SUCCESS != PHP_MINIT(i)(type, module_number TSRMLS_CC)) { \
53 static PHP_MINIT_FUNCTION(pq
)
55 PHP_MINIT_CALL(pqexc
);
57 PHP_MINIT_CALL(pqconn
);
58 PHP_MINIT_CALL(pqcancel
);
59 PHP_MINIT_CALL(pqtypes
);
61 PHP_MINIT_CALL(pqres
);
62 PHP_MINIT_CALL(pqstm
);
63 PHP_MINIT_CALL(pqtxn
);
65 PHP_MINIT_CALL(pqcopy
);
66 PHP_MINIT_CALL(pqlob
);
68 return php_persistent_handle_provide(ZEND_STRL("pq\\Connection"), php_pqconn_get_resource_factory_ops(), NULL
, NULL TSRMLS_CC
);
71 static PHP_MSHUTDOWN_FUNCTION(pq
)
73 php_persistent_handle_cleanup(ZEND_STRL("pq\\Connection"), NULL
, 0 TSRMLS_CC
);
77 static PHP_MINFO_FUNCTION(pq
)
79 #ifdef HAVE_PQLIBVERSION
82 char libpq_version
[10] = "pre-9.1";
84 php_info_print_table_start();
85 php_info_print_table_header(2, "PQ Support", "enabled");
86 php_info_print_table_row(2, "Extension Version", PHP_PQ_EXT_VERSION
);
87 php_info_print_table_end();
89 php_info_print_table_start();
90 php_info_print_table_header(2, "Used Library", "Version");
91 #ifdef HAVE_PQLIBVERSION
92 libpq_v
= PQlibVersion();
93 slprintf(libpq_version
, sizeof(libpq_version
), "%d.%d.%d", libpq_v
/10000%100, libpq_v
/100%100, libpq_v
%100);
95 php_info_print_table_row(2, "libpq", libpq_version
);
96 php_info_print_table_end();
99 const zend_function_entry pq_functions
[] = {
103 static zend_module_dep pq_module_deps
[] = {
104 ZEND_MOD_REQUIRED("raphf")
105 ZEND_MOD_REQUIRED("spl")
109 zend_module_entry pq_module_entry
= {
110 STANDARD_MODULE_HEADER_EX
,
117 NULL
,/*PHP_RINIT(pq),*/
118 NULL
,/*PHP_RSHUTDOWN(pq),*/
121 STANDARD_MODULE_PROPERTIES
134 * vim600: noet sw=4 ts=4 fdm=marker
135 * vim<600: noet sw=4 ts=4