summaryrefslogtreecommitdiff
path: root/ext/mnogosearch/php_mnogo.c
diff options
context:
space:
mode:
authorSergey Kartashoff <gluke@php.net>2001-03-01 13:26:26 +0000
committerSergey Kartashoff <gluke@php.net>2001-03-01 13:26:26 +0000
commit423fcaf2dcb4ec42383cd838df605f7c3f401f3f (patch)
tree3cb1011ad0bad2e451bad7724807d8faf4bfa4f3 /ext/mnogosearch/php_mnogo.c
parent035d2b3077bbfdae5c79e853b34d5222ebd769c0 (diff)
downloadphp-git-423fcaf2dcb4ec42383cd838df605f7c3f401f3f.tar.gz
Udm_Get_Doc_Count function from mnoGoSearch 3.1.11 has been added.
mnoGoSearch library version printing in phpinfo() has been added. Example updated.
Diffstat (limited to 'ext/mnogosearch/php_mnogo.c')
-rw-r--r--ext/mnogosearch/php_mnogo.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/ext/mnogosearch/php_mnogo.c b/ext/mnogosearch/php_mnogo.c
index 62724aa2b1..5453620bf9 100644
--- a/ext/mnogosearch/php_mnogo.c
+++ b/ext/mnogosearch/php_mnogo.c
@@ -117,6 +117,10 @@ function_entry mnogosearch_functions[] = {
PHP_FE(udm_free_res, NULL)
PHP_FE(udm_free_agent, NULL)
+
+#if UDM_VERSION_ID > 30110
+ PHP_FE(udm_get_doc_count, NULL)
+#endif
{NULL, NULL, NULL}
};
@@ -275,8 +279,13 @@ DLEXPORT PHP_RINIT_FUNCTION(mnogosearch)
DLEXPORT PHP_MINFO_FUNCTION(mnogosearch)
{
+ char buf[32];
+
php_info_print_table_start();
php_info_print_table_row(2, "mnoGoSearch Support", "enabled" );
+
+ sprintf(buf,"%d", UDM_VERSION_ID);
+ php_info_print_table_row(2, "mnoGoSearch library version", buf );
php_info_print_table_end();
}
@@ -1035,6 +1044,33 @@ DLEXPORT PHP_FUNCTION(udm_error)
/* }}} */
+#if UDM_VERSION_ID > 30110
+/* {{{ proto int udm_get_doc_count(int agent)
+ Get total number of documents in database */
+DLEXPORT PHP_FUNCTION(udm_get_doc_count)
+{
+ pval ** yyagent;
+ UDM_AGENT * Agent;
+ int id=-1;
+
+ switch(ZEND_NUM_ARGS()){
+ case 1: {
+ if (zend_get_parameters_ex(1, &yyagent)==FAILURE) {
+ RETURN_FALSE;
+ }
+ }
+ break;
+ default:
+ WRONG_PARAM_COUNT;
+ break;
+ }
+ ZEND_FETCH_RESOURCE(Agent, UDM_AGENT *, yyagent, id, "mnoGoSearch-Agent", le_link);
+ RETURN_LONG(UdmGetDocCount(Agent));
+}
+/* }}} */
+#endif
+
+
#endif