]> git.pld-linux.org Git - packages/php.git/commitdiff
- removed dl-zlib patch (only unnecessary and breaking chunks were left)
authorJakub Bogusz <qboosh@pld-linux.org>
Sun, 13 Jul 2003 00:43:57 +0000 (00:43 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
- replaced mnogosearch-php-extension-1.68 by mnogosearch-update patch
  (newer update for mnogosearch up to 3.2.13 taken from PHP_4_3 cvs branch)

Changed files:
    php-mnogosearch-php-extension-1.68.patch -> 1.3
    php-mnogosearch-update.patch -> 1.1
    php.spec -> 1.271

php-mnogosearch-php-extension-1.68.patch [deleted file]
php-mnogosearch-update.patch [new file with mode: 0644]
php.spec

diff --git a/php-mnogosearch-php-extension-1.68.patch b/php-mnogosearch-php-extension-1.68.patch
deleted file mode 100644 (file)
index 6d08207..0000000
+++ /dev/null
@@ -1,189 +0,0 @@
-diff -urN php-4.3.1.org/ext/mnogosearch/php_mnogo.c php-4.3.1/ext/mnogosearch/php_mnogo.c
---- php-4.3.1.org/ext/mnogosearch/php_mnogo.c  Mon Feb 24 21:42:43 2003
-+++ php-4.3.1/ext/mnogosearch/php_mnogo.c      Mon Dec 16 20:17:09 2002
-@@ -1,5 +1,5 @@
- /* $Source$ */
--/* $Id$ */
-+/* $Id$ */
- /*
-    +----------------------------------------------------------------------+
-@@ -163,6 +163,8 @@
- #if UDM_VERSION_ID >= 30204
-       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_res_field_ex,    NULL)
- #endif
- #endif
-@@ -466,7 +468,9 @@
-                               UdmVarListReplaceStr(&Env->Vars,"DBAddr",dbaddr);
-                               if(UDM_OK!=UdmDBSetAddr(Env->db,dbaddr,UDM_OPEN_MODE_READ)){
-                                   sprintf(Env->errstr,"Invalid DBAddr: '%s'",dbaddr);
-+#if UDM_VERSION_ID <= 30207
-                                   Env->errcode=1;
-+#endif
-                                   php_error(E_WARNING,"%s(): Invalid DBAddr", get_active_function_name(TSRMLS_C));
-                                   RETURN_FALSE;
-                               }
-@@ -517,7 +521,9 @@
-                               UdmVarListReplaceStr(&Env->Vars,"DBAddr",dbaddr);
-                               if(UDM_OK!=UdmDBSetAddr(Env->db,dbaddr,UDM_OPEN_MODE_READ)){
-                                   sprintf(Env->errstr,"Invalid DBAddr: '%s'",dbaddr);
-+#if UDM_VERSION_ID <= 30207
-                                   Env->errcode=1;
-+#endif
-                                   php_error(E_WARNING,"%s(): Invalid DBAddr", get_active_function_name(TSRMLS_C));
-                                   RETURN_FALSE;
-                               }
-@@ -997,6 +1003,8 @@
-               case UDM_PARAM_VARDIR:
- #if UDM_VERSION_ID < 30200
-                       udm_snprintf(Agent->Conf->vardir,sizeof(Agent->Conf->vardir)-1,"%s%s",val,UDMSLASHSTR);
-+#elif UDM_VERSION_ID >= 30208
-+                      UdmVarListReplaceStr(&Agent->Conf->Vars,"Vardir",val);
- #elif UDM_VERSION_ID >= 30204
-                       UdmVarListReplaceStr(&Agent->Conf->Vars,"Vardir",val);
-                       snprintf(Agent->Conf->vardir,sizeof(Agent->Conf->vardir)-1,"%s%s",val,UDMSLASHSTR);
-@@ -1665,6 +1673,106 @@
-       RETURN_TRUE;
- }
- /* }}} */
-+
-+/* {{{ proto int udm_set_agent_param_ex(int agent, string var, string val)
-+   Set mnoGoSearch agent session parameters extended */
-+DLEXPORT PHP_FUNCTION(udm_set_agent_param_ex)
-+{
-+      pval **yyagent, **yyvar, **yyval;
-+      char *val, *var;
-+      UDM_AGENT * Agent;
-+
-+      switch(ZEND_NUM_ARGS()){
-+      
-+              case 3:                 
-+                      if(zend_get_parameters_ex(3,&yyagent,&yyvar,&yyval)==FAILURE){
-+                              RETURN_FALSE;
-+                      }
-+                      convert_to_string_ex(yyvar);
-+                      convert_to_string_ex(yyval);
-+                      ZEND_FETCH_RESOURCE(Agent, UDM_AGENT *, yyagent, -1, "mnoGoSearch-agent", le_link);
-+                      var = Z_STRVAL_PP(yyvar);
-+                      val = Z_STRVAL_PP(yyval);
-+                      
-+                      break;
-+                      
-+              default:
-+                      WRONG_PARAM_COUNT;
-+                      break;
-+      }
-+      
-+      UdmVarListReplaceStr(&Agent->Conf->Vars,var,val);
-+      
-+      if (!strcasecmp(var,"LocalCharset")) {
-+              const char * charset=UdmVarListFindStr(&Agent->Conf->Vars,"LocalCharset","iso-8859-1");
-+              Agent->Conf->lcs=UdmGetCharSet(charset);
-+      } else if (!strcasecmp(var,"BrowserCharset")) {
-+              const char * charset=UdmVarListFindStr(&Agent->Conf->Vars,"BrowserCharset","iso-8859-1");
-+              Agent->Conf->bcs=UdmGetCharSet(charset);
-+      } else if (!strcasecmp(var,"Synonym")) {
-+              if (UdmSynonymListLoad(Agent->Conf,val)) {
-+                      php_error(E_WARNING, "%s(): %s", get_active_function_name(TSRMLS_C),Agent->Conf->errstr);
-+                      RETURN_FALSE;
-+              } else UdmSynonymListSort(&(Agent->Conf->Synonyms));
-+      } else if (!strcasecmp(var,"Stopwordfile")) {
-+              if (UdmStopListLoad(Agent->Conf,val)) {
-+                      php_error(E_WARNING, "%s(): %s", Agent->Conf->errstr, get_active_function_name(TSRMLS_C));
-+                      RETURN_FALSE;
-+              }
-+      } else if (!strcasecmp(var,"MinWordLen")) {
-+              Agent->Conf->WordParam.min_word_len=atoi(val);
-+      } else if (!strcasecmp(var,"MaxWordLen")) {
-+              Agent->Conf->WordParam.max_word_len=atoi(val);
-+#if UDM_VERSION_ID <= 30207
-+      } else if (!strcasecmp(var,"VarDir")) {
-+              snprintf(Agent->Conf->vardir,sizeof(Agent->Conf->vardir)-1,"%s%s",val,UDMSLASHSTR);
-+#endif
-+      }
-+
-+      RETURN_TRUE;
-+}
-+
-+/* {{{ proto string udm_get_res_field_ex(int res, int row, string field)
-+   Fetch mnoGoSearch result field */
-+DLEXPORT PHP_FUNCTION(udm_get_res_field_ex)
-+{
-+      pval **yyres, **yyrow_num, **yyfield_name;
-+
-+      UDM_RESULT * Res;
-+      int row;
-+      char *field;
-+      
-+      switch(ZEND_NUM_ARGS()){
-+              case 3: {
-+                              if (zend_get_parameters_ex(3, &yyres,&yyrow_num,&yyfield_name)==FAILURE){
-+                                      RETURN_FALSE;
-+                              }
-+                              convert_to_string_ex(yyrow_num);
-+                              convert_to_string_ex(yyfield_name);
-+                              field = Z_STRVAL_PP(yyfield_name);
-+                              row = atoi(Z_STRVAL_PP(yyrow_num));
-+                      }
-+                      break;
-+              default:
-+                      WRONG_PARAM_COUNT;
-+                      break;
-+      }
-+      
-+      ZEND_FETCH_RESOURCE(Res, UDM_RESULT *, yyres, -1, "mnoGoSearch-Result", le_res);
-+      if(row<Res->num_rows){
-+              if (!strcasecmp(field,"URL")) {
-+                  char        *al;
-+                  al = (char *)MyRemoveHiLightDup((const char *)(UdmVarListFindStr(&(Res->Doc[row].Sections), field, "")));
-+                  UdmVarListReplaceStr(&Res->Doc[row].Sections,field,al);
-+                  free(al);
-+              }
-+              RETURN_STRING((char *)UdmVarListFindStr(&Res->Doc[row].Sections,field,""),1);
-+      } else {
-+              php_error(E_WARNING,"%s(): row number too large", get_active_function_name(TSRMLS_C));
-+              RETURN_FALSE;
-+      }
-+}
-+/* }}} */
- #endif
- /* {{{ proto int udm_find(int agent, string query)
-@@ -2071,7 +2179,13 @@
-                       break;
-       }
-       ZEND_FETCH_RESOURCE(Agent, UDM_AGENT *, yyagent, -1, "mnoGoSearch-Agent", le_link);
--#if UDM_VERSION_ID >= 30204
-+#if UDM_VERSION_ID >= 30208
-+      if (UdmEnvErrMsg(Agent->Conf) && strlen(UdmEnvErrMsg(Agent->Conf))) {
-+          RETURN_LONG(1);
-+      } else {
-+          RETURN_LONG(0);
-+      }
-+#elif UDM_VERSION_ID >= 30204
-       RETURN_LONG(UdmEnvErrCode(Agent->Conf));
- #else
-       RETURN_LONG(UdmDBErrorCode(Agent->db));
-diff -urN php-4.3.1.org/ext/mnogosearch/php_mnogo.h php-4.3.1/ext/mnogosearch/php_mnogo.h
---- php-4.3.1.org/ext/mnogosearch/php_mnogo.h  Mon Feb 24 21:42:43 2003
-+++ php-4.3.1/ext/mnogosearch/php_mnogo.h      Sun Nov 24 20:39:46 2002
-@@ -1,5 +1,5 @@
- /* $Source$ */
--/* $Id$ */
-+/* $Id$ */
- /* 
-    +----------------------------------------------------------------------+
-@@ -68,6 +68,8 @@
- #if UDM_VERSION_ID >= 30204
- DLEXPORT PHP_FUNCTION(udm_parse_query_string);
- DLEXPORT PHP_FUNCTION(udm_make_excerpt);
-+DLEXPORT PHP_FUNCTION(udm_set_agent_param_ex);
-+DLEXPORT PHP_FUNCTION(udm_get_res_field_ex);
- #endif
- #endif
diff --git a/php-mnogosearch-update.patch b/php-mnogosearch-update.patch
new file mode 100644 (file)
index 0000000..2289162
--- /dev/null
@@ -0,0 +1,743 @@
+Index: php-src/ext/mnogosearch/php_mnogo.c
+===================================================================
+RCS file: /repository/php-src/ext/mnogosearch/php_mnogo.c,v
+retrieving revision 1.66.2.1
+retrieving revision 1.66.2.5
+diff -u -r1.66.2.1 -r1.66.2.5
+--- php-src/ext/mnogosearch/php_mnogo.c        31 Dec 2002 16:34:55 -0000      1.66.2.1
++++ php-src/ext/mnogosearch/php_mnogo.c        8 Jul 2003 14:00:57 -0000       1.66.2.5
+@@ -1,5 +1,5 @@
+ /* $Source$ */
+-/* $Id$ */
++/* $Id$ */
+ /*
+    +----------------------------------------------------------------------+
+@@ -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          |
+    | license@php.net so we can mail you a copy immediately.               |
+@@ -163,6 +163,12 @@
+ #if UDM_VERSION_ID >= 30204
+       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_res_field_ex,    NULL)
++#endif
++#if UDM_VERSION_ID >= 30211
++      PHP_FE(udm_hash32,              NULL)
++      PHP_FE(udm_alloc_agent_array,   NULL)
+ #endif
+ #endif
+@@ -456,7 +462,7 @@
+                               UdmVarListReplaceStr(&Env->Vars,"SyslogFacility","local7");
+                               UdmSetLogLevel(Env,0);
+                               UdmOpenLog("mnoGoSearch-php",Env,0);
+-
++#if UDM_VERSION_ID <= 30210
+                               if(!memcmp(dbaddr,"searchd:",8)){
+                                       UDM_URL Url;
+                                       UdmURLParse(&Url,dbaddr);
+@@ -464,13 +470,18 @@
+                               }
+                               
+                               UdmVarListReplaceStr(&Env->Vars,"DBAddr",dbaddr);
++                              
+                               if(UDM_OK!=UdmDBSetAddr(Env->db,dbaddr,UDM_OPEN_MODE_READ)){
+                                   sprintf(Env->errstr,"Invalid DBAddr: '%s'",dbaddr);
++#if UDM_VERSION_ID <= 30207
+                                   Env->errcode=1;
+-                                  php_error(E_WARNING,"%s(): Invalid DBAddr", get_active_function_name(TSRMLS_C));
++#endif
++                                  php_error_docref(NULL TSRMLS_CC, E_WARNING,"Invalid DBAddr");
+                                   RETURN_FALSE;
+                               }
+-                              
++#else
++                              UdmDBListAdd(&Env->dbl,dbaddr, UDM_OPEN_MODE_WRITE);
++#endif
+                               Agent=UdmAgentInit(NULL,Env,0);
+ #elif UDM_VERSION_ID >= 30200
+                               Env=UdmAllocEnv();
+@@ -508,7 +519,7 @@
+                               UdmVarListReplaceStr(&Env->Vars,"SyslogFacility","local7");
+                               UdmSetLogLevel(Env,0);
+                               UdmOpenLog("mnoGoSearch-php",Env,0);
+-
++#if UDM_VERSION_ID <= 30210
+                               if(!memcmp(dbaddr,"searchd:",8)){
+                                       UDM_URL Url;
+                                       UdmURLParse(&Url,dbaddr);
+@@ -517,10 +528,15 @@
+                               UdmVarListReplaceStr(&Env->Vars,"DBAddr",dbaddr);
+                               if(UDM_OK!=UdmDBSetAddr(Env->db,dbaddr,UDM_OPEN_MODE_READ)){
+                                   sprintf(Env->errstr,"Invalid DBAddr: '%s'",dbaddr);
++#if UDM_VERSION_ID <= 30207
+                                   Env->errcode=1;
+-                                  php_error(E_WARNING,"%s(): Invalid DBAddr", get_active_function_name(TSRMLS_C));
++#endif
++                                  php_error_docref(NULL TSRMLS_CC, E_WARNING,"Invalid DBAddr");
+                                   RETURN_FALSE;
+                               }
++#else
++                              UdmDBListAdd(&Env->dbl,dbaddr, UDM_OPEN_MODE_WRITE);
++#endif
+                               Agent=UdmAgentInit(NULL,Env,0);
+ #elif UDM_VERSION_ID >= 30200
+                               Env=UdmAllocEnv();
+@@ -620,7 +636,7 @@
+                                       case UDM_MODE_PHRASE: 
+ #if UDM_VERSION_ID >= 30200
+-                                              php_error(E_WARNING,"%s(): Unknown search mode", get_active_function_name(TSRMLS_C));
++                                              php_error_docref(NULL TSRMLS_CC, E_WARNING,"Unknown search mode");
+                                               RETURN_FALSE;
+ #else
+                                               Agent->search_mode=UDM_MODE_PHRASE;
+@@ -633,7 +649,7 @@
+ #else
+                                               Agent->search_mode=UDM_MODE_ALL;
+ #endif                                                
+-                                              php_error(E_WARNING,"%s(): Unknown search mode", get_active_function_name(TSRMLS_C));
++                                              php_error_docref(NULL TSRMLS_CC, E_WARNING,"Unknown search mode");
+                                               RETURN_FALSE;
+                                               break;
+                       }
+@@ -679,7 +695,7 @@
+ #else
+                                               Agent->word_match=UDM_MATCH_WORD;
+ #endif                                                
+-                                              php_error(E_WARNING,"%s(): Unknown word match mode", get_active_function_name(TSRMLS_C));
++                                              php_error_docref(NULL TSRMLS_CC, E_WARNING,"Unknown word match mode");
+                                               RETURN_FALSE;
+                                               break;
+                       }
+@@ -714,7 +730,7 @@
+ #else                                                                 
+                                       UdmReplaceStrVar(Agent->Conf->vars,"Cache","no",UDM_VARSRC_GLOBAL);
+ #endif                                                
+-                                      php_error(E_WARNING,"%s(): Unknown cache mode", get_active_function_name(TSRMLS_C));
++                                      php_error_docref(NULL TSRMLS_CC, E_WARNING,"Unknown cache mode");
+                                       RETURN_FALSE;
+                                       break;
+                       }
+@@ -752,7 +768,7 @@
+ #else
+                                       UdmReplaceStrVar(Agent->Conf->vars,"TrackQuery","no",UDM_VARSRC_GLOBAL);
+ #endif                                
+-                                      php_error(E_WARNING,"%s(): Unknown track mode", get_active_function_name(TSRMLS_C));
++                                      php_error_docref(NULL TSRMLS_CC, E_WARNING,"Unknown track mode");
+                                       RETURN_FALSE;
+                                       break;
+                       }
+@@ -771,7 +787,7 @@
+                                       break;
+                                       
+                               default:
+-                                      php_error(E_WARNING,"%s(): Unknown phrase mode", get_active_function_name(TSRMLS_C));
++                                      php_error_docref(NULL TSRMLS_CC, E_WARNING,"Unknown phrase mode");
+                                       RETURN_FALSE;
+                                       break;
+                       }
+@@ -809,7 +825,7 @@
+ #else
+                                       UdmAddIntVar(Agent->Conf->vars, "IspellUsePrefixes", 1, UDM_VARSRC_GLOBAL);                                     
+ #endif                                                                                                
+-                                      php_error(E_WARNING,"%s(): Unknown ispell prefixes mode", get_active_function_name(TSRMLS_C));
++                                      php_error_docref(NULL TSRMLS_CC, E_WARNING,"Unknown ispell prefixes mode");
+                                       RETURN_FALSE;
+                                       break;
+                       }
+@@ -866,7 +882,7 @@
+                       
+               case UDM_PARAM_SYNONYM:
+                       if (UdmSynonymListLoad(Agent->Conf,val)) {
+-                              php_error(E_WARNING, "%s(): %s", get_active_function_name(TSRMLS_C),Agent->Conf->errstr);
++                              php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s",Agent->Conf->errstr);
+                               RETURN_FALSE;
+ #if UDM_VERSION_ID >= 30204
+                       } else UdmSynonymListSort(&(Agent->Conf->Synonyms));
+@@ -918,7 +934,7 @@
+ #else
+                       if (UdmFileLoadStopList(Agent->Conf,val)) {
+ #endif
+-                              php_error(E_WARNING, "%s(): %s", Agent->Conf->errstr, get_active_function_name(TSRMLS_C));
++                              php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", Agent->Conf->errstr);
+                               RETURN_FALSE;
+                       }
+                       break;
+@@ -985,7 +1001,7 @@
+                                       break;
+                                       
+                               default:
+-                                      php_error(E_WARNING,"%s(): Unknown crosswords mode", get_active_function_name(TSRMLS_C));
++                                      php_error_docref(NULL TSRMLS_CC, E_WARNING,"Unknown crosswords mode");
+                                       RETURN_FALSE;
+                                       break;
+                       }
+@@ -997,6 +1013,8 @@
+               case UDM_PARAM_VARDIR:
+ #if UDM_VERSION_ID < 30200
+                       udm_snprintf(Agent->Conf->vardir,sizeof(Agent->Conf->vardir)-1,"%s%s",val,UDMSLASHSTR);
++#elif UDM_VERSION_ID >= 30208
++                      UdmVarListReplaceStr(&Agent->Conf->Vars,"Vardir",val);
+ #elif UDM_VERSION_ID >= 30204
+                       UdmVarListReplaceStr(&Agent->Conf->Vars,"Vardir",val);
+                       snprintf(Agent->Conf->vardir,sizeof(Agent->Conf->vardir)-1,"%s%s",val,UDMSLASHSTR);
+@@ -1032,7 +1050,7 @@
+                                       break;
+                                       
+                               default:
+-                                      php_error(E_WARNING,"%s(): Unknown groupbysite mode", get_active_function_name(TSRMLS_C));
++                                      php_error_docref(NULL TSRMLS_CC, E_WARNING,"Unknown groupbysite mode");
+                                       RETURN_FALSE;
+                                       break;
+                       }
+@@ -1057,7 +1075,7 @@
+                                       break;
+                                       
+                               default:
+-                                      php_error(E_WARNING,"%s(): Unknown clones mode", get_active_function_name(TSRMLS_C));
++                                      php_error_docref(NULL TSRMLS_CC, E_WARNING,"Unknown clones mode");
+                                       RETURN_FALSE;
+                                       break;
+                       }
+@@ -1066,7 +1084,7 @@
+ #endif
+               default:
+-                      php_error(E_WARNING,"%s(): Unknown agent session parameter", get_active_function_name(TSRMLS_C));
++                      php_error_docref(NULL TSRMLS_CC, E_WARNING,"Unknown agent session parameter");
+                       RETURN_FALSE;
+                       break;
+       }
+@@ -1160,12 +1178,12 @@
+ #endif
+                       
+                       if (UdmImportAffixes(Agent->Conf,val1,val2,NULL,0)) {
+-                              php_error(E_WARNING,"%s(): Cannot load affix file %s", get_active_function_name(TSRMLS_C),val2);
++                              php_error_docref(NULL TSRMLS_CC, E_WARNING,"Cannot load affix file %s",val2);
+                               RETURN_FALSE;
+                       }
+ #else
+                       if (UdmImportAffixes(Agent->Conf,val1,charset,val2)) {
+-                              php_error(E_WARNING,"%s(): Cannot load affix file %s", get_active_function_name(TSRMLS_C),val2);
++                              php_error_docref(NULL TSRMLS_CC, E_WARNING,"Cannot load affix file %s",val2);
+                               RETURN_FALSE;
+                       }
+     
+@@ -1181,12 +1199,12 @@
+ #endif
+                       
+                       if (UdmImportDictionary(Agent->Conf,val1,val2,1,"")) {
+-                              php_error(E_WARNING,"%s(): Cannot load spell file %s", get_active_function_name(TSRMLS_C),val2);
++                              php_error_docref(NULL TSRMLS_CC, E_WARNING,"Cannot load spell file %s",val2);
+                               RETURN_FALSE;
+                       }
+ #else
+                       if (UdmImportDictionary(Agent->Conf,val1,charset,val2,0,"")) {
+-                              php_error(E_WARNING,"%s(): Cannot load spell file %s", get_active_function_name(TSRMLS_C),val2);
++                              php_error_docref(NULL TSRMLS_CC, E_WARNING,"Cannot load spell file %s",val2);
+                               RETURN_FALSE;
+                       }
+ #endif
+@@ -1194,7 +1212,7 @@
+               default:
+-                      php_error(E_WARNING,"%s(): Unknown ispell type parameter", get_active_function_name(TSRMLS_C));
++                      php_error_docref(NULL TSRMLS_CC, E_WARNING,"Unknown ispell type parameter");
+                       RETURN_FALSE;
+                       break;
+       }
+@@ -1328,7 +1346,7 @@
+                               Z_TYPE(stl_info)=2;
+                               stl_info.t2=(time_t)(atol(edate+1));
+                       } else {
+-                              php_error(E_WARNING,"%s(): Incorrect date limit format", get_active_function_name(TSRMLS_C));
++                              php_error_docref(NULL TSRMLS_CC, E_WARNING,"Incorrect date limit format");
+                               RETURN_FALSE;
+                       }                       
+                       
+@@ -1338,7 +1356,7 @@
+ #endif
+                       break;
+               default:
+-                      php_error(E_WARNING,"%s(): Unknown search limit parameter", get_active_function_name(TSRMLS_C));
++                      php_error_docref(NULL TSRMLS_CC, E_WARNING,"Unknown search limit parameter");
+                       RETURN_FALSE;
+                       break;
+       }
+@@ -1647,24 +1665,212 @@
+               
+               Excerpt = UdmExcerptDoc(Agent, Res, &(Res->Doc[row]), 256);
+               
+-              if (Excerpt != NULL) {
++              if ((Excerpt != NULL) && (strlen(Excerpt) > 6)) {
+                       char *HlExcerpt = UdmHlConvert(&Res->WWList, Excerpt, Agent->Conf->lcs, Agent->Conf->bcs);
+-                      UdmVarListReplaceInt(&(Res->Doc[row].Sections),"ST",1);
+                       UdmVarListReplaceStr(&(Res->Doc[row].Sections),"Body",HlExcerpt);
+                       UDM_FREE(HlExcerpt);
++              }
++              if (Excerpt != NULL && (UdmVarListFindStr(&(Res->Doc[row].Sections), "Z", NULL) == NULL)) {
++                      UdmVarListReplaceInt(&(Res->Doc[row].Sections),"ST",1);
+                       UDM_FREE(Excerpt);
+               } else {
+                       UdmVarListReplaceInt(&(Res->Doc[row].Sections),"ST",0);
+                       RETURN_FALSE;
+               }
+       }else{
+-              php_error(E_WARNING,"%s(): row number too large", get_active_function_name(TSRMLS_C));
++              php_error_docref(NULL TSRMLS_CC, E_WARNING,"row number too large");
+               RETURN_FALSE;
+       }
+       
+       RETURN_TRUE;
+ }
+ /* }}} */
++
++/* {{{ proto int udm_set_agent_param_ex(int agent, string var, string val)
++   Set mnoGoSearch agent session parameters extended */
++DLEXPORT PHP_FUNCTION(udm_set_agent_param_ex)
++{
++      pval **yyagent, **yyvar, **yyval;
++      char *val, *var;
++      UDM_AGENT * Agent;
++
++      switch(ZEND_NUM_ARGS()){
++      
++              case 3:                 
++                      if(zend_get_parameters_ex(3,&yyagent,&yyvar,&yyval)==FAILURE){
++                              RETURN_FALSE;
++                      }
++                      convert_to_string_ex(yyvar);
++                      convert_to_string_ex(yyval);
++                      ZEND_FETCH_RESOURCE(Agent, UDM_AGENT *, yyagent, -1, "mnoGoSearch-agent", le_link);
++                      var = Z_STRVAL_PP(yyvar);
++                      val = Z_STRVAL_PP(yyval);
++                      
++                      break;
++                      
++              default:
++                      WRONG_PARAM_COUNT;
++                      break;
++      }
++      
++      UdmVarListReplaceStr(&Agent->Conf->Vars,var,val);
++      
++      if (!strcasecmp(var,"LocalCharset")) {
++              const char * charset=UdmVarListFindStr(&Agent->Conf->Vars,"LocalCharset","iso-8859-1");
++              Agent->Conf->lcs=UdmGetCharSet(charset);
++      } else if (!strcasecmp(var,"BrowserCharset")) {
++              const char * charset=UdmVarListFindStr(&Agent->Conf->Vars,"BrowserCharset","iso-8859-1");
++              Agent->Conf->bcs=UdmGetCharSet(charset);
++      } else if (!strcasecmp(var,"Synonym")) {
++              if (UdmSynonymListLoad(Agent->Conf,val)) {
++                      php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s",Agent->Conf->errstr);
++                      RETURN_FALSE;
++              } else UdmSynonymListSort(&(Agent->Conf->Synonyms));
++      } else if (!strcasecmp(var,"Stopwordfile")) {
++              if (UdmStopListLoad(Agent->Conf,val)) {
++                      php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", Agent->Conf->errstr);
++                      RETURN_FALSE;
++              }
++      } else if (!strcasecmp(var,"MinWordLen")) {
++              Agent->Conf->WordParam.min_word_len=atoi(val);
++      } else if (!strcasecmp(var,"MaxWordLen")) {
++              Agent->Conf->WordParam.max_word_len=atoi(val);
++#if UDM_VERSION_ID <= 30207
++      } else if (!strcasecmp(var,"VarDir")) {
++              snprintf(Agent->Conf->vardir,sizeof(Agent->Conf->vardir)-1,"%s%s",val,UDMSLASHSTR);
++#endif
++      }
++
++      RETURN_TRUE;
++}
++
++/* {{{ proto string udm_get_res_field_ex(int res, int row, string field)
++   Fetch mnoGoSearch result field */
++DLEXPORT PHP_FUNCTION(udm_get_res_field_ex)
++{
++      pval **yyres, **yyrow_num, **yyfield_name;
++
++      UDM_RESULT * Res;
++      int row;
++      char *field;
++      
++      switch(ZEND_NUM_ARGS()){
++              case 3: {
++                              if (zend_get_parameters_ex(3, &yyres,&yyrow_num,&yyfield_name)==FAILURE){
++                                      RETURN_FALSE;
++                              }
++                              convert_to_string_ex(yyrow_num);
++                              convert_to_string_ex(yyfield_name);
++                              field = Z_STRVAL_PP(yyfield_name);
++                              row = atoi(Z_STRVAL_PP(yyrow_num));
++                      }
++                      break;
++              default:
++                      WRONG_PARAM_COUNT;
++                      break;
++      }
++      
++      ZEND_FETCH_RESOURCE(Res, UDM_RESULT *, yyres, -1, "mnoGoSearch-Result", le_res);
++      if(row<Res->num_rows){
++              if (!strcasecmp(field,"URL")) {
++                  char        *al;
++                  al = (char *)MyRemoveHiLightDup((const char *)(UdmVarListFindStr(&(Res->Doc[row].Sections), field, "")));
++                  UdmVarListReplaceStr(&Res->Doc[row].Sections,field,al);
++                  free(al);
++              }
++              RETURN_STRING((char *)UdmVarListFindStr(&Res->Doc[row].Sections,field,""),1);
++      } else {
++              php_error_docref(NULL TSRMLS_CC, E_WARNING,"row number too large");
++              RETURN_FALSE;
++      }
++}
++/* }}} */
++#endif
++
++#if UDM_VERSION_ID >= 30211
++/* {{{ proto int udm_alloc_agent_array(array dbaddr)
++   Allocate mnoGoSearch session */
++DLEXPORT PHP_FUNCTION(udm_alloc_agent_array)
++{
++      switch(ZEND_NUM_ARGS()){
++
++              case 1: {
++                              pval **yydbaddr;
++                              zval **tmp;
++                              char *dbaddr;
++                              UDM_ENV   * Env;
++                              UDM_AGENT * Agent;
++                              HashPosition   pos;
++                              
++                              if(zend_get_parameters_ex(1,&yydbaddr)==FAILURE){
++                                      RETURN_FALSE;
++                              }
++                              
++                              if (Z_TYPE_PP(yydbaddr) != IS_ARRAY) {
++                                      php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument DBAddr must be an array.");
++                                      RETURN_FALSE;
++                              }
++                              convert_to_array_ex(yydbaddr);
++                              
++                              Env=UdmEnvInit(NULL);
++                              UdmVarListReplaceStr(&Env->Vars,"SyslogFacility","local7");
++                              UdmSetLogLevel(Env,0);
++                              UdmOpenLog("mnoGoSearch-php",Env,0);
++                              
++                              zend_hash_internal_pointer_reset_ex(HASH_OF(*yydbaddr), &pos);
++                              
++                              while (zend_hash_get_current_data_ex(HASH_OF(*yydbaddr), (void **)&tmp, &pos) == SUCCESS) {
++                                  convert_to_string_ex(tmp);
++                                  dbaddr = Z_STRVAL_PP(tmp);
++                                  UdmDBListAdd(&Env->dbl,dbaddr, UDM_OPEN_MODE_WRITE);
++                                  
++                                  zend_hash_move_forward_ex(HASH_OF(*yydbaddr), &pos);
++                              }
++                              
++                              Agent=UdmAgentInit(NULL,Env,0);
++                              ZEND_REGISTER_RESOURCE(return_value,Agent,le_link);
++                      }
++                      break;
++                      
++              default:
++                      WRONG_PARAM_COUNT;
++                      break;
++      }
++}
++/* }}} */
++
++/* {{{ proto int udm_hash32(int agent, string str)
++   Return Hash32 checksum of gived string */
++DLEXPORT PHP_FUNCTION(udm_hash32)
++{
++      pval ** yystr, ** yyagent;
++      char *str;
++      udmhash32_t hash32;
++      char buf[32];
++      UDM_AGENT * Agent;
++      int id=-1;
++
++      switch(ZEND_NUM_ARGS()){
++              case 2: {
++                              if (zend_get_parameters_ex(2, &yyagent,&yystr)==FAILURE) {
++                                      RETURN_FALSE;
++                              }
++                      }
++                      break;
++              default:                                
++                      WRONG_PARAM_COUNT;
++                      break;
++      }
++      ZEND_FETCH_RESOURCE(Agent, UDM_AGENT *, yyagent, id, "mnoGoSearch-Agent", le_link);
++      convert_to_string_ex(yystr);
++      str = Z_STRVAL_PP(yystr);
++
++      hash32=UdmHash32((str),strlen(str));
++      snprintf(buf,sizeof(buf)-1,"%u",hash32);
++      
++      RETURN_STRING(buf,1);
++}
++/* }}} */
+ #endif
+ /* {{{ proto int udm_find(int agent, string query)
+@@ -1677,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;
+@@ -1693,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 {
+@@ -1876,12 +2094,12 @@
+ #endif
+                               
+                       default: 
+-                              php_error(E_WARNING,"%s(): Unknown mnoGoSearch field name", get_active_function_name(TSRMLS_C));
++                              php_error_docref(NULL TSRMLS_CC, E_WARNING,"Unknown mnoGoSearch field name");
+                               RETURN_FALSE;
+                               break;
+               }
+       }else{
+-              php_error(E_WARNING,"%s(): row number too large", get_active_function_name(TSRMLS_C));
++              php_error_docref(NULL TSRMLS_CC, E_WARNING,"row number too large");
+               RETURN_FALSE;
+       }
+ }
+@@ -1926,13 +2144,13 @@
+                           {   
+                               size_t wsize=(1+len*15)*sizeof(char);
+                               char *wordinfo = (char*) malloc(wsize);
+-                              int corder = -1, ccount = 0;
+         
+                               *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,", ");
+@@ -1950,33 +2168,29 @@
+ #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;
+                           {   
+                               size_t wsize=(1+len*15)*sizeof(char);
+                               char *wordinfo = (char*) malloc(wsize);
+-                              int corder = -1, ccount = 0;
++                              int corder = (size_t)-1, ccount = 0;
+         
+                               *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);
+@@ -1998,7 +2212,7 @@
+                       break;
+               default:
+-                      php_error(E_WARNING,"%s(): Unknown mnoGoSearch param name", get_active_function_name(TSRMLS_C));
++                      php_error_docref(NULL TSRMLS_CC, E_WARNING,"Unknown mnoGoSearch param name");
+                       RETURN_FALSE;
+                       break;
+       }
+@@ -2071,7 +2285,13 @@
+                       break;
+       }
+       ZEND_FETCH_RESOURCE(Agent, UDM_AGENT *, yyagent, -1, "mnoGoSearch-Agent", le_link);
+-#if UDM_VERSION_ID >= 30204
++#if UDM_VERSION_ID >= 30208
++      if (UdmEnvErrMsg(Agent->Conf) && strlen(UdmEnvErrMsg(Agent->Conf))) {
++          RETURN_LONG(1);
++      } else {
++          RETURN_LONG(0);
++      }
++#elif UDM_VERSION_ID >= 30204
+       RETURN_LONG(UdmEnvErrCode(Agent->Conf));
+ #else
+       RETURN_LONG(UdmDBErrorCode(Agent->db));
+@@ -2147,13 +2367,15 @@
+ #if UDM_VERSION_ID >= 30204
+       bzero(&C,sizeof(C));
+       strncpy(C.addr,cat,sizeof(C.addr)-1);
++#if UDM_VERSION_ID <= 30210
+       if(!UdmCatAction(Agent,&C,UDM_CAT_ACTION_LIST,Agent->Conf->db)){
+ #else
++      if(UDM_OK == UdmCatAction(Agent,&C,UDM_CAT_ACTION_LIST)){
++#endif
++#else
+       if((c=UdmCatList(Agent,cat))){
+ #endif
+-              if (array_init(return_value)==FAILURE) {
+-                      RETURN_FALSE;
+-              }
++              array_init(return_value);
+               
+               if (!(buf=calloc(1,UDMSTRSIZ+1))) {
+                       RETURN_FALSE;
+@@ -2164,11 +2386,9 @@
+                   int i;
+                   if (C.ncategories) {
+                       for(i=0;i<C.ncategories;i++){
+-                          snprintf(buf, UDMSTRSIZ, "%s%s",C.Category[i].link[0]?"@ ":"", C.Category[i].name);
+-                          add_next_index_string(return_value, C.Category[i].link[0]?C.Category[i].link:C.Category[i].path, 1);
+-                          add_next_index_string(return_value, buf, 1);
++                          add_next_index_stringl(return_value, C.Category[i].path,strlen(C.Category[i].path),1);
++                          add_next_index_stringl(return_value, C.Category[i].name,strlen(C.Category[i].name),1);
+                       }
+-                      free(C.Category);
+                   } else {
+                       RETURN_FALSE;
+                   }
+@@ -2221,13 +2441,15 @@
+ #if UDM_VERSION_ID >= 30204
+       bzero(&C,sizeof(C));
+       strncpy(C.addr,cat,sizeof(C.addr)-1);
++#if UDM_VERSION_ID <= 30210
+       if(!UdmCatAction(Agent,&C,UDM_CAT_ACTION_PATH,Agent->Conf->db)){
+ #else
++      if(UDM_OK == UdmCatAction(Agent,&C,UDM_CAT_ACTION_PATH)){
++#endif
++#else
+       if((c=UdmCatPath(Agent,cat))){
+ #endif
+-              if (array_init(return_value)==FAILURE) {
+-                      RETURN_FALSE;
+-              }
++              array_init(return_value);
+               
+               if (!(buf=calloc(1,UDMSTRSIZ+1))) {
+                       RETURN_FALSE;
+@@ -2238,11 +2460,9 @@
+                   int i;
+                   if (C.ncategories) {
+                       for(i=0;i<C.ncategories;i++){                   
+-                          snprintf(buf, UDMSTRSIZ, "%s%s",C.Category[i].link[0]?"@ ":"", C.Category[i].name);
+-                          add_next_index_string(return_value, C.Category[i].link[0]?C.Category[i].link:C.Category[i].path, 1);
+-                          add_next_index_string(return_value, buf, 1);
++                          add_next_index_stringl(return_value, C.Category[i].path,strlen(C.Category[i].path),1);
++                          add_next_index_stringl(return_value, C.Category[i].name,strlen(C.Category[i].name),1);
+                       }
+-                      free(C.Category);
+                   } else {
+                       RETURN_FALSE;
+                   }
+@@ -2284,7 +2504,11 @@
+       }
+       ZEND_FETCH_RESOURCE(Agent, UDM_AGENT *, yyagent, id, "mnoGoSearch-Agent", le_link);
+ #if UDM_VERSION_ID >= 30204
++#if UDM_VERSION_ID <= 30210
+       if (!Agent->doccount) UdmURLAction(Agent,NULL,UDM_URL_ACTION_DOCCOUNT,Agent->Conf->db);
++#else
++      if (!Agent->doccount) UdmURLAction(Agent,NULL,UDM_URL_ACTION_DOCCOUNT);
++#endif
+       RETURN_LONG(Agent->doccount);
+ #else
+       RETURN_LONG(UdmGetDocCount(Agent));
+Index: php-src/ext/mnogosearch/php_mnogo.h
+===================================================================
+RCS file: /repository/php-src/ext/mnogosearch/php_mnogo.h,v
+retrieving revision 1.19.4.2
+retrieving revision 1.19.4.3
+diff -u -r1.19.4.2 -r1.19.4.3
+--- php-src/ext/mnogosearch/php_mnogo.h        19 Apr 2003 05:10:27 -0000      1.19.4.2
++++ php-src/ext/mnogosearch/php_mnogo.h        14 Jun 2003 18:45:23 -0000      1.19.4.3
+@@ -1,5 +1,5 @@
+ /* $Source$ */
+-/* $Id$ */
++/* $Id$ */
+ /* 
+    +----------------------------------------------------------------------+
+@@ -27,8 +27,6 @@
+ #if HAVE_MNOGOSEARCH
+-#undef HAVE_PGSQL
+-#undef HAVE_MYSQL
+ #include <udm_config.h>
+ #include <udmsearch.h>
+@@ -70,6 +68,12 @@
+ #if UDM_VERSION_ID >= 30204
+ DLEXPORT PHP_FUNCTION(udm_parse_query_string);
+ DLEXPORT PHP_FUNCTION(udm_make_excerpt);
++DLEXPORT PHP_FUNCTION(udm_set_agent_param_ex);
++DLEXPORT PHP_FUNCTION(udm_get_res_field_ex);
++#endif
++#if UDM_VERSION_ID >= 30211
++DLEXPORT PHP_FUNCTION(udm_hash32);
++DLEXPORT PHP_FUNCTION(udm_alloc_agent_array);
+ #endif
+ #endif
index 4a291c71f2bd6eba83199213f05a1398b00d71d1..921c0c28438e4fa520a2dd9bda1e444ad57bb2d5 100644 (file)
--- a/php.spec
+++ b/php.spec
@@ -90,7 +90,7 @@ Patch11:      %{name}-mcal-shared-lib.patch
 Patch12:       %{name}-msession-shared-lib.patch
 Patch13:       %{name}-build_modules.patch
 Patch14:       %{name}-sapi-ini-file.patch
-Patch15:       %{name}-dl-zlib.patch
+
 Patch16:       %{name}-no-metaccld.patch
 Patch17:       %{name}-session-unregister.patch
 Patch18:       %{name}-ini.patch
@@ -100,7 +100,7 @@ Patch21:    %{name}-libtool.patch
 Patch22:       %{name}-allow-db31.patch
 Patch23:       %{name}-threads-acfix.patch
 Patch24:       %{name}-tsrmlsfetchgcc2.patch
-Patch25:       %{name}-mnogosearch-php-extension-1.68.patch
+Patch25:       %{name}-mnogosearch-update.patch
 Patch26:       %{name}-pear-install.patch
 Patch27:       %{name}-zlib.patch
 Icon:          php4.gif
@@ -1310,7 +1310,7 @@ Repozytorium Aplikacji.
 %patch12 -p1
 %patch13 -p1
 %patch14 -p1
-#%patch15 -p1
+
 %patch16 -p1
 %patch17 -p1
 cp php.ini-dist php.ini
This page took 0.921599 seconds and 4 git commands to generate.