gluke Mon Feb 5 00:42:54 2001 EDT
Modified files:
/php4/ext/mnogosearch README php_mnogo.c php_mnogo.h
Log:
Fixed mnogosearch protos. Fixed mnogosearch functions return values.
A bug with capital letters break search has been fixed.
@- Fixed mnogosearch protos. Fixed mnogosearch functions return values.
@ A bug with capital letters break search has been fixed. (gluke)
Index: php4/ext/mnogosearch/README
diff -u php4/ext/mnogosearch/README:1.3 php4/ext/mnogosearch/README:1.4
--- php4/ext/mnogosearch/README:1.3 Fri Feb 2 04:54:14 2001
+++ php4/ext/mnogosearch/README Mon Feb 5 00:42:53 2001
@@ -1,5 +1,5 @@
$Source: /local/repository/php4/ext/mnogosearch/README,v $
-$Id: README,v 1.3 2001/02/02 12:54:14 gluke Exp $
+$Id: README,v 1.4 2001/02/05 08:42:53 gluke Exp $
mnoGoSearch extension module for PHP4.
Basic mnoGoSearch function implementation.
@@ -12,14 +12,13 @@
TODO
-1. Implement more UdmSearch functions.
+1. Implement more mnoGoSearch functions.
-2. Fix config.m4 to detect whether UdmSearch is actually installed.
-Currently there is no any checking. ./configure just trust that UdmSearch
+2. Fix config.m4 to detect whether mnoGoSearch is actually installed.
+Currently there is no any checking. ./configure just trust that mnoGoSearch
does exist.
-3. Test with more databases. Currently tested with MySQL which is compiled into
-PHP4 by default and does not require any additional UdmSearch libraries.
- Actually it should work fine with other supported database.
+3. Test with more databases. Currently tested with MySQL.
+Actually it should work fine with other supported databases.
4. Write PHP interface documentation.
Index: php4/ext/mnogosearch/php_mnogo.c
diff -u php4/ext/mnogosearch/php_mnogo.c:1.5 php4/ext/mnogosearch/php_mnogo.c:1.6
--- php4/ext/mnogosearch/php_mnogo.c:1.5Fri Feb 2 07:49:58 2001
+++ php4/ext/mnogosearch/php_mnogo.cMon Feb 5 00:42:53 2001
@@ -1,5 +1,5 @@
/* $Source: /local/repository/php4/ext/mnogosearch/php_mnogo.c,v $ */
-/* $Id: php_mnogo.c,v 1.5 2001/02/02 15:49:58 eschmid Exp $ */
+/* $Id: php_mnogo.c,v 1.6 2001/02/05 08:42:53 gluke Exp $ */
/*
+--+
@@ -174,7 +174,7 @@
}
-/* {{{ proto int mnogosearch_alloc_agent(string dbaddr [, string dbmode])
+/* {{{ proto int udm_alloc_agent(string dbaddr [, string dbmode])
Allocate mnoGoSearch session */
DLEXPORT PHP_FUNCTION(udm_alloc_agent)
{
@@ -233,7 +233,7 @@
/* }}} */
-/* {{{ proto int udm_set_agent_param(string agent, int var, string val)
+/* {{{ proto int udm_set_agent_param(int agent, int var, string val)
Set mnoGoSearch agent session parameters */
DLEXPORT PHP_FUNCTION(udm_set_agent_param)
{
@@ -363,7 +363,7 @@
/* }}} */
-/* {{{ proto int udm_find(int agent_identifier, string query)
+/* {{{ proto int udm_find(int agent, string query)
Perform search */
DLEXPORT PHP_FUNCTION(udm_find)
{
@@ -385,13 +385,17 @@
}
ZEND_FETCH_RESOURCE(Agent, UDM_AGENT *, yyagent, id, "mnoGoSearch-Agent",
le_link);
convert_to_string_ex(yyquery);
- Res=UdmFind(Agent,(*yyquery)-value.str.val);
- ZEND_REGISTER_RESOURCE(return_value,Res,le_res);
+
+ if (Res=UdmFind(Agent,UdmTolower((*yyquery)-value.str.val,Agent-charset))) {
+ ZEND_REGISTER_RESOURCE(return_value,Res,le_res);
+ } else {
+ RETURN_FALSE;
+ }
}
/* }}} */
-/* {{{ proto int udm_get_res_field(int res_identifier, int row_num, int field_name)
+/* {{{ proto int udm_get_res_field(int res, int row, int field)
Fetch mnoGoSearch result field */
DLEXPORT PHP_FUNCTION(udm_get_res_field){
pval **yyres, **yyrow_num, **yyfield_name;
@@ -440,8 +444,8 @@
/* }}} */
-/* {{{ proto int udm_get_res_param(int res_identifier, int param_id)
- mnoGoSearch result parameters */
+/* {{{ proto int udm_get_res_param(int res, int param)
+ Get mnoGoSearch result parameters */
DLEXPORT PHP_FUNCTION(udm_get_res_param)
{
pval ** yyres, ** yyparam;
@@ -473,7 +477,7 @@
/* }}} */
-/* {{{ proto int udm_free_res(int res_identifier)
+/* {{{ proto int udm_free_res(int res)
mnoGoSearch free result */
DLEXPORT PHP_FUNCTION(udm_free_res)
{
@@ -492,12 +496,13 @@
}
ZEND_FETCH_RESOURCE(Res, UDM_RESULT *, yyres, -1, "mnoGoSearch-Result",
le_res);
zend_list_delete((*yyres)-value.lval);
-
+
+ RETURN_TRUE;
}
/* }}} */
-/* {{{ proto int udm_errno(int agent_identifier)
+/* {{{ proto int udm_errno(int agent)
mnoGoSearch error number */
DLEXPORT PHP_FUNCTION(udm_errno)
{
@@ -520,7 +525,7 @@
/* }}} */
-/* {{{ proto int udm_error(int agent_identifier)
+/* {{{ proto string udm_error(int agent)
mnoGoSearch error message */
DLEXPORT PHP_FUNCTION(udm_error)
{
@@ -544,7 +549,7 @@
/* }}} */
-/* {{{ proto int udm_free_agent(int agent_identifier)
+/* {{{