[PHP-CVS] cvs: php-src(PHP_4_3) /ext/mnogosearch php_mnogo.c php_mnogo.h
gluke Sun Nov 28 15:03:29 2004 EDT Modified files: (Branch: PHP_4_3) /php-src/ext/mnogosearchphp_mnogo.c php_mnogo.h Log: - MnoGoSearch extension updated to fix compilation issues with mnogosearch-3.2.25+ http://cvs.php.net/diff.php/php-src/ext/mnogosearch/php_mnogo.c?r1=1.66.2.12r2=1.66.2.13ty=u Index: php-src/ext/mnogosearch/php_mnogo.c diff -u php-src/ext/mnogosearch/php_mnogo.c:1.66.2.12 php-src/ext/mnogosearch/php_mnogo.c:1.66.2.13 --- php-src/ext/mnogosearch/php_mnogo.c:1.66.2.12 Mon Feb 16 11:40:15 2004 +++ php-src/ext/mnogosearch/php_mnogo.c Sun Nov 28 15:03:28 2004 @@ -1,5 +1,5 @@ /* $Source: /repository/php-src/ext/mnogosearch/php_mnogo.c,v $ */ -/* $Id: php_mnogo.c,v 1.66.2.12 2004/02/16 16:40:15 gluke Exp $ */ +/* $Id: php_mnogo.c,v 1.66.2.13 2004/11/28 20:03:28 gluke Exp $ */ /* +--+ @@ -77,7 +77,7 @@ #define UDM_PARAM_HLBEG19 #define UDM_PARAM_HLEND20 #define UDM_PARAM_SYNONYM 21 -#define UDM_PARAM_SEARCHD 22 +#define UDM_PARAM_SEARCHD 22 /* unused */ #define UDM_PARAM_QSTRING 23 #define UDM_PARAM_REMOTE_ADDR 24 #define UDM_PARAM_QUERY25 @@ -156,11 +156,6 @@ #if UDM_VERSION_ID = 30200 PHP_FE(udm_check_charset, NULL) -#if UDM_VERSION_ID == 30203 - PHP_FE(udm_open_stored, NULL) - PHP_FE(udm_check_stored,NULL) - PHP_FE(udm_close_stored,NULL) -#endif #if UDM_VERSION_ID = 30203 PHP_FE(udm_crc32, NULL) #endif @@ -168,12 +163,16 @@ PHP_FE(udm_parse_query_string, NULL) PHP_FE(udm_make_excerpt,NULL) PHP_FE(udm_set_agent_param_ex, NULL) + PHP_FE(udm_get_agent_param_ex, NULL) PHP_FE(udm_get_res_field_ex,NULL) #endif #if UDM_VERSION_ID = 30211 PHP_FE(udm_hash32, NULL) PHP_FE(udm_alloc_agent_array, NULL) #endif +#if UDM_VERSION_ID = 30216 + PHP_FE(udm_store_doc_cgi, NULL) +#endif #endif PHP_FE(udm_alloc_agent, NULL) @@ -317,7 +316,6 @@ REGISTER_LONG_CONSTANT(UDM_PARAM_HLEND, UDM_PARAM_HLEND,CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT(UDM_PARAM_SYNONYM, UDM_PARAM_SYNONYM,CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT(UDM_PARAM_SEARCHD, UDM_PARAM_SEARCHD,CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT(UDM_PARAM_STORED, UDM_PARAM_STORED,CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT(UDM_PARAM_GROUPBYSITE, UDM_PARAM_GROUPBYSITE,CONST_CS | CONST_PERSISTENT); @@ -431,21 +429,38 @@ } static char* MyRemoveHiLightDup(const char *s){ - size_t len=strlen(s)+1; - char*res=malloc(len); - char*d; - - for(d=res;s[0];s++){ - switch(s[0]){ - case '\2': - case '\3': - break; - default: - *d++=*s; - } - } - *d='\0'; - return res; + size_t len=strlen(s)+1; + char *d, *res = (char*)emalloc(len); + + for(d=res; s[0]; s++) + { +switch(s[0]) +{ + case '\2': + case '\3': +break; + case '': +if (s[1] == '#') +{ + char *e; + int code= 0; + + for (e= (char *)s+2; (*e = '0') (*e = '9'); code= code*10 + e[0]-'0', e++); + if (*e == ';') + { +*d++= (code 128) ? code : '?'; +s= e; +break; + } +} +/* pass through */ + + default: +*d++=*s; +} + } + *d='\0'; + return res; } /* {{{ proto int udm_alloc_agent(string dbaddr [, string dbmode]) @@ -908,18 +923,6 @@ #endif break; - case UDM_PARAM_SEARCHD: -#if UDM_VERSION_ID = 30203 - UdmSDCLientListAdd((Agent-Conf-sdcl),val); - { - size_t i; - for(i=0;iAgent-Conf-sdcl.nclients;i++){ - UdmSDCLientListAdd(Agent-sdcl,Agent-Conf-sdcl.Clients[i].addr); - } - } -#endif - break; - case UDM_PARAM_QSTRING: #if UDM_VERSION_ID = 30204 UdmVarListReplaceStr(Agent-Conf-Vars,QUERY_STRING,val); @@ -1211,43 +1214,48 @@ #endif case UDM_ISPELL_TYPE_AFFIX: -#if UDM_VERSION_ID 30200 +#if UDM_VERSION_ID 30200 Agent-Conf-ispell_mode = ~UDM_ISPELL_MODE_DB; - #if UDM_VERSION_ID 30111 Agent-Conf-ispell_mode =
Re: [PHP-CVS] cvs: php-src(PHP_4_3) /ext/mnogosearch php_mnogo.c php_mnogo.h
Why such a major patch which adds features is applied to the stable build during the final stages of a release cycle? Please revert the patch. If there are fixes need to allow compilation with mnogosearch-3.2.25+ those can go in, but no new features please. Ilia -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_4_3) /ext/mnogosearch php_mnogo.c
gluke Sun Nov 28 15:30:09 2004 EDT Modified files: (Branch: PHP_4_3) /php-src/ext/mnogosearchphp_mnogo.c Log: - MnoGoSearch extension latest patch reverted http://cvs.php.net/diff.php/php-src/ext/mnogosearch/php_mnogo.c?r1=1.66.2.13r2=1.66.2.14ty=u Index: php-src/ext/mnogosearch/php_mnogo.c diff -u php-src/ext/mnogosearch/php_mnogo.c:1.66.2.13 php-src/ext/mnogosearch/php_mnogo.c:1.66.2.14 --- php-src/ext/mnogosearch/php_mnogo.c:1.66.2.13 Sun Nov 28 15:03:28 2004 +++ php-src/ext/mnogosearch/php_mnogo.c Sun Nov 28 15:30:08 2004 @@ -1,5 +1,5 @@ /* $Source: /repository/php-src/ext/mnogosearch/php_mnogo.c,v $ */ -/* $Id: php_mnogo.c,v 1.66.2.13 2004/11/28 20:03:28 gluke Exp $ */ +/* $Id: php_mnogo.c,v 1.66.2.14 2004/11/28 20:30:08 gluke Exp $ */ /* +--+ @@ -77,7 +77,7 @@ #define UDM_PARAM_HLBEG19 #define UDM_PARAM_HLEND20 #define UDM_PARAM_SYNONYM 21 -#define UDM_PARAM_SEARCHD 22 /* unused */ +#define UDM_PARAM_SEARCHD 22 #define UDM_PARAM_QSTRING 23 #define UDM_PARAM_REMOTE_ADDR 24 #define UDM_PARAM_QUERY25 @@ -156,6 +156,11 @@ #if UDM_VERSION_ID = 30200 PHP_FE(udm_check_charset, NULL) +#if UDM_VERSION_ID == 30203 + PHP_FE(udm_open_stored, NULL) + PHP_FE(udm_check_stored,NULL) + PHP_FE(udm_close_stored,NULL) +#endif #if UDM_VERSION_ID = 30203 PHP_FE(udm_crc32, NULL) #endif @@ -163,16 +168,12 @@ PHP_FE(udm_parse_query_string, NULL) PHP_FE(udm_make_excerpt,NULL) PHP_FE(udm_set_agent_param_ex, NULL) - PHP_FE(udm_get_agent_param_ex, NULL) PHP_FE(udm_get_res_field_ex,NULL) #endif #if UDM_VERSION_ID = 30211 PHP_FE(udm_hash32, NULL) PHP_FE(udm_alloc_agent_array, NULL) #endif -#if UDM_VERSION_ID = 30216 - PHP_FE(udm_store_doc_cgi, NULL) -#endif #endif PHP_FE(udm_alloc_agent, NULL) @@ -316,6 +317,7 @@ REGISTER_LONG_CONSTANT(UDM_PARAM_HLEND, UDM_PARAM_HLEND,CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT(UDM_PARAM_SYNONYM, UDM_PARAM_SYNONYM,CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT(UDM_PARAM_SEARCHD, UDM_PARAM_SEARCHD,CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT(UDM_PARAM_STORED, UDM_PARAM_STORED,CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT(UDM_PARAM_GROUPBYSITE, UDM_PARAM_GROUPBYSITE,CONST_CS | CONST_PERSISTENT); @@ -429,38 +431,21 @@ } static char* MyRemoveHiLightDup(const char *s){ - size_t len=strlen(s)+1; - char *d, *res = (char*)emalloc(len); - - for(d=res; s[0]; s++) - { -switch(s[0]) -{ - case '\2': - case '\3': -break; - case '': -if (s[1] == '#') -{ - char *e; - int code= 0; - - for (e= (char *)s+2; (*e = '0') (*e = '9'); code= code*10 + e[0]-'0', e++); - if (*e == ';') - { -*d++= (code 128) ? code : '?'; -s= e; -break; - } -} -/* pass through */ - - default: -*d++=*s; -} - } - *d='\0'; - return res; + size_t len=strlen(s)+1; + char*res=malloc(len); + char*d; + + for(d=res;s[0];s++){ + switch(s[0]){ + case '\2': + case '\3': + break; + default: + *d++=*s; + } + } + *d='\0'; + return res; } /* {{{ proto int udm_alloc_agent(string dbaddr [, string dbmode]) @@ -923,6 +908,18 @@ #endif break; + case UDM_PARAM_SEARCHD: +#if UDM_VERSION_ID = 30203 + UdmSDCLientListAdd((Agent-Conf-sdcl),val); + { + size_t i; + for(i=0;iAgent-Conf-sdcl.nclients;i++){ + UdmSDCLientListAdd(Agent-sdcl,Agent-Conf-sdcl.Clients[i].addr); + } + } +#endif + break; + case UDM_PARAM_QSTRING: #if UDM_VERSION_ID = 30204 UdmVarListReplaceStr(Agent-Conf-Vars,QUERY_STRING,val); @@ -1214,45 +1211,40 @@ #endif case UDM_ISPELL_TYPE_AFFIX: -#if UDM_VERSION_ID 30200 +#if UDM_VERSION_ID 30200 Agent-Conf-ispell_mode = ~UDM_ISPELL_MODE_DB; + #if UDM_VERSION_ID 30111 Agent-Conf-ispell_mode = ~UDM_ISPELL_MODE_SERVER; #endif +
Re: [PHP-CVS] cvs: php-src(PHP_4_3) /ext/mnogosearch php_mnogo.c php_mnogo.h
Sergey Kartashoff wrote: ok, i am reverted the patch, sorry. Thanks. Ilia -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_4_3) /ext/mnogosearch php_mnogo.c
gluke Mon Dec 8 03:24:56 2003 EDT Modified files: (Branch: PHP_4_3) /php-src/ext/mnogosearchphp_mnogo.c Log: - A bug in Udm_Hash32 function was fixed. Index: php-src/ext/mnogosearch/php_mnogo.c diff -u php-src/ext/mnogosearch/php_mnogo.c:1.66.2.10 php-src/ext/mnogosearch/php_mnogo.c:1.66.2.11 --- php-src/ext/mnogosearch/php_mnogo.c:1.66.2.10 Wed Nov 12 02:52:56 2003 +++ php-src/ext/mnogosearch/php_mnogo.c Mon Dec 8 03:24:55 2003 @@ -1,5 +1,5 @@ /* $Source: /repository/php-src/ext/mnogosearch/php_mnogo.c,v $ */ -/* $Id: php_mnogo.c,v 1.66.2.10 2003/11/12 07:52:56 gluke Exp $ */ +/* $Id: php_mnogo.c,v 1.66.2.11 2003/12/08 08:24:55 gluke Exp $ */ /* +--+ @@ -1922,7 +1922,11 @@ str = Z_STRVAL_PP(yystr); hash32=UdmHash32((str),strlen(str)); +#if UDM_VERSION_ID = 30215 + snprintf(buf,sizeof(buf)-1,%i,hash32); +#else snprintf(buf,sizeof(buf)-1,%u,hash32); +#endif RETURN_STRING(buf,1); } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_4_3) /ext/mnogosearch php_mnogo.c
gluke Wed Nov 12 02:52:57 2003 EDT Modified files: (Branch: PHP_4_3) /php-src/ext/mnogosearchphp_mnogo.c Log: - A WORDINFO calculation in mnogosearch extension was fixed Index: php-src/ext/mnogosearch/php_mnogo.c diff -u php-src/ext/mnogosearch/php_mnogo.c:1.66.2.9 php-src/ext/mnogosearch/php_mnogo.c:1.66.2.10 --- php-src/ext/mnogosearch/php_mnogo.c:1.66.2.9Sat Nov 8 09:39:14 2003 +++ php-src/ext/mnogosearch/php_mnogo.c Wed Nov 12 02:52:56 2003 @@ -1,5 +1,5 @@ /* $Source: /usr/repository/php-src/ext/mnogosearch/php_mnogo.c,v $ */ -/* $Id: php_mnogo.c,v 1.66.2.9 2003/11/08 14:39:14 gluke Exp $ */ +/* $Id: php_mnogo.c,v 1.66.2.10 2003/11/12 07:52:56 gluke Exp $ */ /* +--+ @@ -2247,7 +2247,6 @@ } else if (Res-WWList.Word[i].origin == UDM_WORD_ORIGIN_QUERY) { sprintf(UDM_STREND(wordinfo),%s%s : %d / %d, (*wordinfo) ? , : , Res-WWList.Word[i].word, Res-WWList.Word[i].count, ccount); } else continue; - sprintf(UDM_STREND(wordinfo), / %d, ccount); } RETURN_STRING(wordinfo,1); } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_4_3) /ext/mnogosearch php_mnogo.c
gluke Sat Nov 8 09:39:15 2003 EDT Modified files: (Branch: PHP_4_3) /php-src/ext/mnogosearchphp_mnogo.c Log: - Mnogosearch extension wsa updated to include mnogosearch-3.2.16 features. Index: php-src/ext/mnogosearch/php_mnogo.c diff -u php-src/ext/mnogosearch/php_mnogo.c:1.66.2.8 php-src/ext/mnogosearch/php_mnogo.c:1.66.2.9 --- php-src/ext/mnogosearch/php_mnogo.c:1.66.2.8Sun Aug 31 02:58:56 2003 +++ php-src/ext/mnogosearch/php_mnogo.c Sat Nov 8 09:39:14 2003 @@ -1,5 +1,5 @@ /* $Source: /usr/repository/php-src/ext/mnogosearch/php_mnogo.c,v $ */ -/* $Id: php_mnogo.c,v 1.66.2.8 2003/08/31 06:58:56 gluke Exp $ */ +/* $Id: php_mnogo.c,v 1.66.2.9 2003/11/08 14:39:14 gluke Exp $ */ /* +--+ @@ -87,6 +87,8 @@ #define UDM_PARAM_DETECT_CLONES29 #define UDM_PARAM_SORT_ORDER 30 #define UDM_PARAM_RESULTS_LIMIT31 +#define UDM_PARAM_EXCERPT_SIZE 32 +#define UDM_PARAM_EXCERPT_PADDING 33 /* udm_add_search_limit constants */ #define UDM_LIMIT_URL 1 @@ -327,6 +329,9 @@ REGISTER_LONG_CONSTANT(UDM_PARAM_SORT_ORDER,UDM_PARAM_SORT_ORDER,CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT(UDM_PARAM_RESULTS_LIMIT,UDM_PARAM_RESULTS_LIMIT,CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT(UDM_PARAM_EXCERPT_SIZE,UDM_PARAM_EXCERPT_SIZE,CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT(UDM_PARAM_EXCERPT_PADDING,UDM_PARAM_EXCERPT_PADDING,CONST_CS | CONST_PERSISTENT); + /* udm_add_search_limit constants */ REGISTER_LONG_CONSTANT(UDM_LIMIT_CAT, UDM_LIMIT_CAT,CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT(UDM_LIMIT_URL, UDM_LIMIT_URL,CONST_CS | CONST_PERSISTENT); @@ -1108,6 +1113,17 @@ break; #endif + +#if UDM_VERSION_ID = 30216 + case UDM_PARAM_EXCERPT_SIZE: + UdmVarListReplaceStr(Agent-Conf-Vars,ExcerptSize,val); + + break; + case UDM_PARAM_EXCERPT_PADDING: + UdmVarListReplaceStr(Agent-Conf-Vars,ExcerptPadding,val); + + break; +#endif default: php_error_docref(NULL TSRMLS_CC, E_WARNING,Unknown agent session parameter); RETURN_FALSE; @@ -1684,11 +1700,22 @@ char*al; char*Excerpt; +#if UDM_VERSION_ID = 30216 + size_t ExcerptSize, ExcerptPadding; + + ExcerptSize = (size_t)UdmVarListFindInt(Agent-Conf-Vars, ExcerptSize, 256); + ExcerptPadding = (size_t)UdmVarListFindInt(Agent-Conf-Vars, ExcerptPadding, 40); +#endif + al = (char *)MyRemoveHiLightDup((const char *)(UdmVarListFindStr((Res-Doc[row].Sections), URL, ))); UdmVarListReplaceInt((Res-Doc[row].Sections), STORED_ID, UdmCRC32(al, strlen(al))); free(al); +#if UDM_VERSION_ID = 30216 + Excerpt = UdmExcerptDoc(Agent, Res, (Res-Doc[row]), ExcerptSize, ExcerptPadding); +#else Excerpt = UdmExcerptDoc(Agent, Res, (Res-Doc[row]), 256); +#endif if ((Excerpt != NULL) (strlen(Excerpt) 6)) { char *HlExcerpt = UdmHlConvert(Res-WWList, Excerpt, Agent-Conf-lcs, Agent-Conf-bcs); @@ -2218,7 +2245,7 @@ if (Res-WWList.Word[i].origin == UDM_WORD_ORIGIN_STOP) { sprintf(UDM_STREND(wordinfo),%s%s : stopword, (*wordinfo) ? , : , Res-WWList.Word[i].word); } else if (Res-WWList.Word[i].origin == UDM_WORD_ORIGIN_QUERY) { - sprintf(UDM_STREND(wordinfo),%s%s : %d, (*wordinfo) ? , : , Res-WWList.Word[i].word, Res-WWList.Word[i].count); + sprintf(UDM_STREND(wordinfo),%s%s : %d / %d, (*wordinfo) ? , : , Res-WWList.Word[i].word, Res-WWList.Word[i].count, ccount); } else continue; sprintf(UDM_STREND(wordinfo), / %d, ccount); } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php-src(PHP_4_3) /ext/mnogosearch php_mnogo.c
Hello Sergey, Saturday, November 8, 2003, 3:39:15 PM, you wrote: This looks like new features in a bugfix release. -- Best regards, Marcusmailto:[EMAIL PROTECTED] -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP-CVS] cvs: php-src(PHP_4_3) /ext/mnogosearch php_mnogo.c
Hi! MB This looks like new features in a bugfix release. This is compilation fixes if using with mnogosearch-3.2.16-CVS. We discussed about such mnogosearch module changes this July, and decided to permit such changes since they are cound not make harm while maintaining backwards compatilbility. -- Regards, Sergey aka gluke. -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP-CVS] cvs: php-src(PHP_4_3) /ext/mnogosearch php_mnogo.c
Hi! + REGISTER_LONG_CONSTANT(UDM_PARAM_RESULTS_LIMIT,UDM_PARAM_RESULTS_LIMIT,CONST_CS | CONST_PERSISTENT); JT Shouldn't that be wrapped inside the #if UDM_VERSION_ID = 30215 .. #endif too?? I think this is not nesessary, since constant declarations are local to extension and there is no harm if it is declared for earlier versions. JT Also, wouldn't it be much easier for you to put this extension into PECL? JT You could release new versions more often.. I thought abount that, but i still sure that putting extensions into php is much better for end-users (there no additional packages to worry about to find required extension). Possibly the best way is to duplicate extension in PECL and php both giving the users possibility to stay on the cutting edge with the favourite extension. This is only my opinion of course. -- Regards, Sergey aka gluke. -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP-CVS] cvs: php-src(PHP_4_3) /ext/mnogosearch php_mnogo.c
On Mon, 1 Sep 2003, Sergey Kartashoff wrote: + REGISTER_LONG_CONSTANT(UDM_PARAM_RESULTS_LIMIT,UDM_PARAM_RESULTS_LIMIT,CONST_CS | CONST_PERSISTENT); Shouldn't that be wrapped inside the #if UDM_VERSION_ID = 30215 .. #endif too?? I think this is not nesessary, since constant declarations are local to extension and there is no harm if it is declared for earlier versions. But is that constant _defined_ in earlier versions??? (speaking of UDM_PARAM_RESULTS_LIMIT, in the C side) --Jani -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[3]: [PHP-CVS] cvs: php-src(PHP_4_3) /ext/mnogosearch php_mnogo.c
Hi! Monday, September 1, 2003, 1:58:57 PM, you wrote: + REGISTER_LONG_CONSTANT(UDM_PARAM_RESULTS_LIMIT,UDM_PARAM_RESULTS_LIMIT,CONST_CS | CONST_PERSISTENT); Shouldn't that be wrapped inside the #if UDM_VERSION_ID = 30215 .. #endif too?? I think this is not nesessary, since constant declarations are local to extension and there is no harm if it is declared for earlier versions. JT But is that constant _defined_ in earlier versions??? JT (speaking of UDM_PARAM_RESULTS_LIMIT, in the C side) No, for earlier version there is no matter if this constant is defined or not. Value of this constant is defined in the beginning for all versions: #define UDM_PARAM_RESULTS_LIMIT 31 so registration of constant will not fail for earlier versions Mnogosearch extension has functions to determine which version of mnogosearch library is compiled with PHP and so, users can write their scripts to make use of this constant if library can deal with it. -- Regards, Sergey aka gluke. -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_4_3) /ext/mnogosearch php_mnogo.c
gluke Fri Jul 18 04:48:33 2003 EDT Modified files: (Branch: PHP_4_3) /php-src/ext/mnogosearchphp_mnogo.c Log: - Coredump in Udm_Find was fixed. Index: php-src/ext/mnogosearch/php_mnogo.c diff -u php-src/ext/mnogosearch/php_mnogo.c:1.66.2.5 php-src/ext/mnogosearch/php_mnogo.c:1.66.2.6 --- php-src/ext/mnogosearch/php_mnogo.c:1.66.2.5Tue Jul 8 10:00:57 2003 +++ php-src/ext/mnogosearch/php_mnogo.c Fri Jul 18 04:48:33 2003 @@ -1,5 +1,5 @@ /* $Source: /usr/repository/php-src/ext/mnogosearch/php_mnogo.c,v $ */ -/* $Id: php_mnogo.c,v 1.66.2.5 2003/07/08 14:00:57 gluke Exp $ */ +/* $Id: php_mnogo.c,v 1.66.2.6 2003/07/18 08:48:33 gluke Exp $ */ /* +--+ @@ -1895,6 +1895,7 @@ if (zend_get_parameters_ex(2, yyagent,yyquery)==FAILURE) { RETURN_FALSE; } + convert_to_string_ex(yyquery); } break; default: @@ -1902,7 +1903,6 @@ break; } ZEND_FETCH_RESOURCE(Agent, UDM_AGENT *, yyagent, id, mnoGoSearch-Agent, le_link); - convert_to_string_ex(yyquery); #if UDM_VERSION_ID 30200 if ((Res=UdmFind(Agent,UdmTolower(Z_STRVAL_PP(yyquery),Agent-charset { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_4_3) /ext/mnogosearch php_mnogo.c
gluke Fri Jul 18 05:15:04 2003 EDT Modified files: (Branch: PHP_4_3) /php-src/ext/mnogosearchphp_mnogo.c Log: - UDM_PARAM_SORT_ORDER has been added in Udm_Set_Agent_Param while using with mnogosearch-3.2.14+ to set order of search results. Index: php-src/ext/mnogosearch/php_mnogo.c diff -u php-src/ext/mnogosearch/php_mnogo.c:1.66.2.6 php-src/ext/mnogosearch/php_mnogo.c:1.66.2.7 --- php-src/ext/mnogosearch/php_mnogo.c:1.66.2.6Fri Jul 18 04:48:33 2003 +++ php-src/ext/mnogosearch/php_mnogo.c Fri Jul 18 05:15:04 2003 @@ -1,5 +1,5 @@ /* $Source: /usr/repository/php-src/ext/mnogosearch/php_mnogo.c,v $ */ -/* $Id: php_mnogo.c,v 1.66.2.6 2003/07/18 08:48:33 gluke Exp $ */ +/* $Id: php_mnogo.c,v 1.66.2.7 2003/07/18 09:15:04 gluke Exp $ */ /* +--+ @@ -85,6 +85,7 @@ #define UDM_PARAM_GROUPBYSITE 27 #define UDM_PARAM_SITEID 28 #define UDM_PARAM_DETECT_CLONES29 +#define UDM_PARAM_SORT_ORDER 30 /* udm_add_search_limit constants */ #define UDM_LIMIT_URL 1 @@ -322,6 +323,7 @@ REGISTER_LONG_CONSTANT(UDM_PARAM_QUERY, UDM_PARAM_QUERY,CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT(UDM_PARAM_SITEID, UDM_PARAM_SITEID,CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT(UDM_PARAM_DETECT_CLONES,UDM_PARAM_DETECT_CLONES,CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT(UDM_PARAM_SORT_ORDER,UDM_PARAM_SORT_ORDER,CONST_CS | CONST_PERSISTENT); /* udm_add_search_limit constants */ REGISTER_LONG_CONSTANT(UDM_LIMIT_CAT, UDM_LIMIT_CAT,CONST_CS | CONST_PERSISTENT); @@ -1080,6 +1082,13 @@ break; } + break; +#endif + +#if UDM_VERSION_ID = 30214 + case UDM_PARAM_SORT_ORDER: + UdmVarListReplaceStr(Agent-Conf-Vars,s,val); + break; #endif -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_4_3) /ext/mnogosearch php_mnogo.c
gluke Tue Jul 8 09:27:29 2003 EDT Modified files: (Branch: PHP_4_3) /php-src/ext/mnogosearchphp_mnogo.c Log: - Udm_Find function is fixed to be compatible with mnogosearch-3.2.13 Index: php-src/ext/mnogosearch/php_mnogo.c diff -u php-src/ext/mnogosearch/php_mnogo.c:1.66.2.3 php-src/ext/mnogosearch/php_mnogo.c:1.66.2.4 --- php-src/ext/mnogosearch/php_mnogo.c:1.66.2.3Mon Jun 30 13:44:19 2003 +++ php-src/ext/mnogosearch/php_mnogo.c Tue Jul 8 09:27:29 2003 @@ -1,5 +1,5 @@ /* $Source: /usr/repository/php-src/ext/mnogosearch/php_mnogo.c,v $ */ -/* $Id: php_mnogo.c,v 1.66.2.3 2003/06/30 17:44:19 gluke Exp $ */ +/* $Id: php_mnogo.c,v 1.66.2.4 2003/07/08 13:27:29 gluke Exp $ */ /* +--+ @@ -7,10 +7,10 @@ +--+ | Copyright (c) 1997-2003 The PHP Group| +--+ - | This source file is subject to version 2.02 of the PHP license, | + | This source file is subject to version 3.0 of the PHP license, | | that is bundled with this package in the file LICENSE, and is| - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | + | available through the world-wide-web at the following url: | + | http://www.php.net/license/3_0.txt. | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | [EMAIL PROTECTED] so we can mail you a copy immediately. | @@ -1883,6 +1883,14 @@ int id=-1; switch(ZEND_NUM_ARGS()){ +#if UDM_VERSION_ID = 30213 + case 1: { + if (zend_get_parameters_ex(1, yyagent)==FAILURE) { + RETURN_FALSE; + } + } + break; +#endif case 2: { if (zend_get_parameters_ex(2, yyagent,yyquery)==FAILURE) { RETURN_FALSE; @@ -1899,7 +1907,11 @@ #if UDM_VERSION_ID 30200 if ((Res=UdmFind(Agent,UdmTolower(Z_STRVAL_PP(yyquery),Agent-charset { #else +#if UDM_VERSION_ID = 30213 + if ((Res=UdmFind(Agent))) { +#else if ((Res=UdmFind(Agent,Z_STRVAL_PP(yyquery { +#endif #endif ZEND_REGISTER_RESOURCE(return_value,Res,le_res); } else { @@ -2381,7 +2393,6 @@ add_next_index_stringl(return_value, C.Category[i].name,strlen(C.Category[i].name),1); } } else { - free(buf); RETURN_FALSE; } } @@ -2456,7 +2467,6 @@ add_next_index_stringl(return_value, C.Category[i].name,strlen(C.Category[i].name),1); } } else { - free(buf); RETURN_FALSE; } } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_4_3) /ext/mnogosearch php_mnogo.c
gluke Tue Jul 8 10:00:57 2003 EDT Modified files: (Branch: PHP_4_3) /php-src/ext/mnogosearchphp_mnogo.c Log: - Output of UDM_PARAM_WORDINFO_ALL was fixed Index: php-src/ext/mnogosearch/php_mnogo.c diff -u php-src/ext/mnogosearch/php_mnogo.c:1.66.2.4 php-src/ext/mnogosearch/php_mnogo.c:1.66.2.5 --- php-src/ext/mnogosearch/php_mnogo.c:1.66.2.4Tue Jul 8 09:27:29 2003 +++ php-src/ext/mnogosearch/php_mnogo.c Tue Jul 8 10:00:57 2003 @@ -1,5 +1,5 @@ /* $Source: /usr/repository/php-src/ext/mnogosearch/php_mnogo.c,v $ */ -/* $Id: php_mnogo.c,v 1.66.2.4 2003/07/08 13:27:29 gluke Exp $ */ +/* $Id: php_mnogo.c,v 1.66.2.5 2003/07/08 14:00:57 gluke Exp $ */ /* +--+ @@ -2148,8 +2148,9 @@ *wordinfo = '\0'; for(i = 0; i Res-WWList.nwords; i++){ - if ((Res-WWList.Word[i].count 0) || (Res-WWList.Word[i].origin == UDM_WORD_ORIGIN_QUERY)) { - if(wordinfo[0]) strcat(wordinfo,, ); + if ((Res-WWList.Word[i].count 0) || + (Res-WWList.Word[i].origin == UDM_WORD_ORIGIN_QUERY)) { + if(wordinfo[0]) strcat(wordinfo,, ); sprintf(UDM_STREND(wordinfo), %s : %d, Res-WWList.Word[i].word, Res-WWList.Word[i].count); } else if (Res-WWList.Word[i].origin == UDM_WORD_ORIGIN_STOP) { if(wordinfo[0]) strcat(wordinfo,, ); @@ -2167,7 +2168,7 @@ #if UDM_VERSION_ID = 30204 case UDM_PARAM_WORDINFO_ALL: { - int len,i; + int len,i,j; for(len = i = 0; i Res-WWList.nwords; i++) len += Res-WWList.Word[i].len; { @@ -2177,23 +2178,19 @@ *wordinfo = '\0'; - for(i = 0; i Res-WWList.nwords; i++){ - if (Res-WWList.Word[i].order != corder) { - if(wordinfo[0]) { - sprintf(UDM_STREND(wordinfo), / %d, , ccount); - } - ccount = Res-WWList.Word[i].count; - if (Res-WWList.Word[i].origin == UDM_WORD_ORIGIN_STOP) { - sprintf(UDM_STREND(wordinfo), %s : stopword, Res-WWList.Word[i].word); - } else { - sprintf(UDM_STREND(wordinfo), %s : %d, Res-WWList.Word[i].word, Res-WWList.Word[i].count); - corder = Res-WWList.Word[i].order; - } - } else { - ccount += Res-WWList.Word[i].count; + for(i = 0; i Res-WWList.nwords; i++) { + corder = Res-WWList.Word[i].order; + ccount = 0; + for(j = 0; j Res-WWList.nwords; j++) { + if (Res-WWList.Word[j].order == corder) { + ccount += Res-WWList.Word[j].count; + } } - } - if (Res-WWList.nwords) { + if (Res-WWList.Word[i].origin == UDM_WORD_ORIGIN_STOP) { + sprintf(UDM_STREND(wordinfo),%s%s : stopword, (*wordinfo) ? , : , Res-WWList.Word[i].word); + } else if (Res-WWList.Word[i].origin == UDM_WORD_ORIGIN_QUERY) { + sprintf(UDM_STREND(wordinfo),%s%s : %d, (*wordinfo) ? , : , Res-WWList.Word[i].word, Res-WWList.Word[i].count); + } else continue; sprintf(UDM_STREND(wordinfo), / %d, ccount); } RETURN_STRING(wordinfo,1); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_4_3) /ext/mnogosearch php_mnogo.c
gluke Mon Jun 30 13:44:19 2003 EDT Modified files: (Branch: PHP_4_3) /php-src/ext/mnogosearchphp_mnogo.c Log: - A memory leaks at UdmCatPath and UdmCatList functions have been fixed. Index: php-src/ext/mnogosearch/php_mnogo.c diff -u php-src/ext/mnogosearch/php_mnogo.c:1.66.2.2 php-src/ext/mnogosearch/php_mnogo.c:1.66.2.3 --- php-src/ext/mnogosearch/php_mnogo.c:1.66.2.2Sat Jun 14 14:45:23 2003 +++ php-src/ext/mnogosearch/php_mnogo.c Mon Jun 30 13:44:19 2003 @@ -1,5 +1,5 @@ /* $Source: /usr/repository/php-src/ext/mnogosearch/php_mnogo.c,v $ */ -/* $Id: php_mnogo.c,v 1.66.2.2 2003/06/14 18:45:23 gluke Exp $ */ +/* $Id: php_mnogo.c,v 1.66.2.3 2003/06/30 17:44:19 gluke Exp $ */ /* +--+ @@ -2381,6 +2381,7 @@ add_next_index_stringl(return_value, C.Category[i].name,strlen(C.Category[i].name),1); } } else { + free(buf); RETURN_FALSE; } } @@ -2455,6 +2456,7 @@ add_next_index_stringl(return_value, C.Category[i].name,strlen(C.Category[i].name),1); } } else { + free(buf); RETURN_FALSE; } } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php