]> git.pld-linux.org Git - packages/php.git/blob - php-mnogosearch.patch
- don't use pcre functions in standard/aggregation functions if building pcre extensi...
[packages/php.git] / php-mnogosearch.patch
1 diff -ur php-4.2.2/ext/mnogosearch.orig/php_mnogo.c php-4.2.2/ext/mnogosearch/php_mnogo.c
2 --- php-4.2.2/ext/mnogosearch.orig/php_mnogo.c  Thu Feb 28 09:26:23 2002
3 +++ php-4.2.2/ext/mnogosearch/php_mnogo.c       Mon Jun 17 19:39:17 2002
4 @@ -1,5 +1,5 @@
5  /* $Source$ */
6 -/* $Id$ */
7 +/* $Id$ */
8  
9  /*
10     +----------------------------------------------------------------------+
11 @@ -77,6 +77,7 @@
12  #define UDM_PARAM_SEARCHD              22
13  #define UDM_PARAM_QSTRING              23
14  #define UDM_PARAM_REMOTE_ADDR          24
15 +#define UDM_PARAM_QUERY                        25
16  
17  /* udm_add_search_limit constants */
18  #define UDM_LIMIT_URL          1
19 @@ -118,6 +119,7 @@
20  #define UDM_PARAM_SEARCHTIME   259
21  #define UDM_PARAM_FIRST_DOC    260
22  #define UDM_PARAM_LAST_DOC     261
23 +#define UDM_PARAM_WORDINFO_ALL 262
24  
25  /* udm_load_ispell_data constants */
26  #define UDM_ISPELL_TYPE_AFFIX  1
27 @@ -135,16 +137,21 @@
28   */
29  function_entry mnogosearch_functions[] = {
30         PHP_FE(udm_api_version,         NULL)
31 +
32  #if UDM_VERSION_ID >= 30200                    
33         PHP_FE(udm_check_charset,       NULL)
34 -#endif
35 -
36 -#if UDM_VERSION_ID >= 30203                    
37 -       PHP_FE(udm_crc32,       NULL)
38 +#if UDM_VERSION_ID == 30203
39         PHP_FE(udm_open_stored, NULL)
40         PHP_FE(udm_check_stored,NULL)
41         PHP_FE(udm_close_stored,NULL)
42  #endif
43 +#if UDM_VERSION_ID >= 30203
44 +       PHP_FE(udm_crc32,       NULL)
45 +#endif
46 +#if UDM_VERSION_ID >= 30204
47 +       PHP_FE(udm_parse_query_string,NULL)
48 +#endif
49 +#endif
50  
51         PHP_FE(udm_alloc_agent,         NULL)
52         PHP_FE(udm_set_agent_param,     NULL)
53 @@ -197,14 +204,24 @@
54  static void _free_udm_agent(zend_rsrc_list_entry *rsrc TSRMLS_DC)
55  {
56         UDM_AGENT * Agent = (UDM_AGENT *)rsrc->ptr;
57 +#if UDM_VERSION_ID >= 30204
58 +       UdmEnvFree(Agent->Conf);
59 +       UdmAgentFree(Agent);
60 +#else
61         UdmFreeEnv(Agent->Conf);
62         UdmFreeAgent(Agent);
63 +#endif
64  }
65  
66  static void _free_udm_res(zend_rsrc_list_entry *rsrc TSRMLS_DC)
67  {
68         UDM_RESULT * Res = (UDM_RESULT *)rsrc->ptr;
69 -       UdmFreeResult(Res);     
70 +
71 +#if UDM_VERSION_ID >= 30204    
72 +       UdmResultFree(Res);
73 +#else
74 +       UdmFreeResult(Res);
75 +#endif
76  }
77  
78  /* {{{ PHP_MINIT_FUNCTION
79 @@ -278,6 +295,7 @@
80         
81         REGISTER_LONG_CONSTANT("UDM_PARAM_QSTRING",     UDM_PARAM_QSTRING,CONST_CS | CONST_PERSISTENT);
82         REGISTER_LONG_CONSTANT("UDM_PARAM_REMOTE_ADDR", UDM_PARAM_REMOTE_ADDR,CONST_CS | CONST_PERSISTENT);
83 +       REGISTER_LONG_CONSTANT("UDM_PARAM_QUERY",       UDM_PARAM_QUERY,CONST_CS | CONST_PERSISTENT);
84         
85         /* udm_add_search_limit constants */
86         REGISTER_LONG_CONSTANT("UDM_LIMIT_CAT",         UDM_LIMIT_CAT,CONST_CS | CONST_PERSISTENT);
87 @@ -290,6 +308,7 @@
88         REGISTER_LONG_CONSTANT("UDM_PARAM_FOUND",       UDM_PARAM_FOUND,CONST_CS | CONST_PERSISTENT);
89         REGISTER_LONG_CONSTANT("UDM_PARAM_NUM_ROWS",    UDM_PARAM_NUM_ROWS,CONST_CS | CONST_PERSISTENT);
90         REGISTER_LONG_CONSTANT("UDM_PARAM_WORDINFO",    UDM_PARAM_WORDINFO,CONST_CS | CONST_PERSISTENT);
91 +       REGISTER_LONG_CONSTANT("UDM_PARAM_WORDINFO_ALL",UDM_PARAM_WORDINFO_ALL,CONST_CS | CONST_PERSISTENT);
92         REGISTER_LONG_CONSTANT("UDM_PARAM_WORD_INFO",   UDM_PARAM_WORDINFO,CONST_CS | CONST_PERSISTENT);
93         REGISTER_LONG_CONSTANT("UDM_PARAM_SEARCHTIME",  UDM_PARAM_SEARCHTIME,CONST_CS | CONST_PERSISTENT);
94         REGISTER_LONG_CONSTANT("UDM_PARAM_SEARCH_TIME", UDM_PARAM_SEARCHTIME,CONST_CS | CONST_PERSISTENT);
95 @@ -399,19 +418,37 @@
96                                 }
97                                 convert_to_string_ex(yydbaddr);
98                                 dbaddr = Z_STRVAL_PP(yydbaddr);
99 -                               
100 +                       
101 +#if UDM_VERSION_ID >= 30204
102 +                               Env=UdmEnvInit(NULL);
103 +                               UdmVarListReplaceStr(&Env->Vars,"SyslogFacility","local7");
104 +                               UdmSetLogLevel(Env,0);
105 +                               UdmOpenLog("mnoGoSearch-php",Env,0);
106 +                               
107 +                               if(!memcmp(dbaddr,"searchd:",8)){
108 +                                       UDM_URL Url;
109 +                                       UdmURLParse(&Url,dbaddr);
110 +                                       UdmDBListAdd(&Env->sdcl,Url.hostinfo);
111 +                               }
112 +                               UdmVarListReplaceStr(&Env->Vars,"DBAddr",dbaddr);
113 +                               if(UDM_OK!=UdmDBSetAddr(Env->db,dbaddr,UDM_OPEN_MODE_READ)){
114 +                                   sprintf(Env->errstr,"Invalid DBAddr: '%s'",dbaddr);
115 +                                   Env->errcode=1;
116 +                                   php_error(E_WARNING,"Udm_Alloc_Agent: Invalid DBAddr");
117 +                                   RETURN_FALSE;
118 +                               }
119 +                               Agent=UdmAgentInit(NULL,Env,0);
120 +#elif UDM_VERSION_ID >= 30200
121                                 Env=UdmAllocEnv();
122 -                               
123 -#if UDM_VERSION_ID >= 30200
124                                 Env->vars=UdmAllocVarList();
125                                 Env->DBAddr=strdup(dbaddr);
126                                 UdmEnvSetDBMode(Env,"single");
127 +                               Agent=UdmAllocAgent(Env,0,UDM_OPEN_MODE_READ);
128  #else                          
129 +                               Env=UdmAllocEnv();
130                                 UdmEnvSetDBAddr(Env,dbaddr);
131 -#endif                                                 
132 -                                                               
133                                 Agent=UdmAllocAgent(Env,0,UDM_OPEN_MODE_READ);
134 -                               
135 +#endif                                                 
136                                 ZEND_REGISTER_RESOURCE(return_value,Agent,le_link);
137                         }
138                         break;
139 @@ -432,18 +469,37 @@
140                                 dbaddr = Z_STRVAL_PP(yydbaddr);
141                                 dbmode = Z_STRVAL_PP(yydbmode);
142                                 
143 -                               Env=UdmAllocEnv();                              
144 -#if UDM_VERSION_ID >= 30200
145 +#if UDM_VERSION_ID >= 30204
146 +                               Env=UdmEnvInit(NULL);
147 +                               UdmVarListReplaceStr(&Env->Vars,"SyslogFacility","local7");
148 +                               UdmSetLogLevel(Env,0);
149 +                               UdmOpenLog("mnoGoSearch-php",Env,0);
150 +
151 +                               if(!memcmp(dbaddr,"searchd:",8)){
152 +                                       UDM_URL Url;
153 +                                       UdmURLParse(&Url,dbaddr);
154 +                                       UdmDBListAdd(&Env->sdcl,Url.hostinfo);
155 +                               }
156 +                               UdmVarListReplaceStr(&Env->Vars,"DBAddr",dbaddr);
157 +                               if(UDM_OK!=UdmDBSetAddr(Env->db,dbaddr,UDM_OPEN_MODE_READ)){
158 +                                   sprintf(Env->errstr,"Invalid DBAddr: '%s'",dbaddr);
159 +                                   Env->errcode=1;
160 +                                   php_error(E_WARNING,"Udm_Alloc_Agent: Invalid DBAddr");
161 +                                   RETURN_FALSE;
162 +                               }
163 +                               Agent=UdmAgentInit(NULL,Env,0);
164 +#elif UDM_VERSION_ID >= 30200
165 +                               Env=UdmAllocEnv();
166                                 Env->vars=UdmAllocVarList();
167                                 Env->DBAddr=strdup(dbaddr);
168                                 UdmEnvSetDBMode(Env,dbmode);
169 -#else                          
170 +                               Agent=UdmAllocAgent(Env,0,UDM_OPEN_MODE_READ);
171 +#else
172 +                               Env=UdmAllocEnv();                              
173                                 UdmEnvSetDBAddr(Env,dbaddr);
174 -                               UdmEnvSetDBMode(Env,dbmode);                            
175 -#endif                                                 
176 -
177 +                               UdmEnvSetDBMode(Env,dbmode);
178                                 Agent=UdmAllocAgent(Env,0,UDM_OPEN_MODE_READ);
179 -                               
180 +#endif
181                                 ZEND_REGISTER_RESOURCE(return_value,Agent,le_link);
182                         }
183                         break;
184 @@ -485,66 +541,110 @@
185         
186         switch(var){
187                 case UDM_PARAM_PAGE_SIZE: 
188 +#if UDM_VERSION_ID >= 30204
189 +                       UdmVarListReplaceStr(&Agent->Conf->Vars,"ps",val);
190 +#else
191                         Agent->page_size=atoi(val);
192                         if(Agent->page_size<1)Agent->page_size=20;
193 -                       
194 +#endif
195                         break;
196                         
197                 case UDM_PARAM_PAGE_NUM: 
198 +#if UDM_VERSION_ID >= 30204
199 +                       UdmVarListReplaceStr(&Agent->Conf->Vars,"np",val);
200 +#else
201                         Agent->page_number=atoi(val);
202                         if(Agent->page_number<0)Agent->page_number=0;
203 -                       
204 +#endif
205                         break;
206 -                       
207 +
208                 case UDM_PARAM_SEARCH_MODE:
209                         switch (atoi(val)){
210                                         case UDM_MODE_ALL:
211 +#if UDM_VERSION_ID >= 30204
212 +                                               UdmVarListReplaceStr(&Agent->Conf->Vars,"m","all");
213 +#else
214                                                 Agent->search_mode=UDM_MODE_ALL;
215 +#endif
216                                                 break;
217                                                 
218                                         case UDM_MODE_ANY:
219 +#if UDM_VERSION_ID >= 30204
220 +                                               UdmVarListReplaceStr(&Agent->Conf->Vars,"m","any");
221 +#else
222                                                 Agent->search_mode=UDM_MODE_ANY;
223 +#endif
224                                                 break;
225                                                 
226                                         case UDM_MODE_BOOL: 
227 +#if UDM_VERSION_ID >= 30204
228 +                                               UdmVarListReplaceStr(&Agent->Conf->Vars,"m","all");
229 +#else
230                                                 Agent->search_mode=UDM_MODE_BOOL;
231 +#endif
232                                                 break;
233  
234                                         case UDM_MODE_PHRASE: 
235 +#if UDM_VERSION_ID >= 30200
236 +                                               php_error(E_WARNING,"Udm_Set_Agent_Param: Unknown search mode");
237 +                                               RETURN_FALSE;
238 +#else
239                                                 Agent->search_mode=UDM_MODE_PHRASE;
240 +#endif
241                                                 break;
242                                                 
243                                         default:
244 +#if UDM_VERSION_ID >= 30204
245 +                                               UdmVarListReplaceStr(&Agent->Conf->Vars,"m","all");
246 +#else
247                                                 Agent->search_mode=UDM_MODE_ALL;
248 -                                               
249 -                                               php_error(E_WARNING,"Udm_Set_Agent_Param: Unknown search mode");                                                
250 +#endif                                         
251 +                                               php_error(E_WARNING,"Udm_Set_Agent_Param: Unknown search mode");
252                                                 RETURN_FALSE;
253                                                 break;
254                         }
255 -                       
256                         break;
257  
258                 case UDM_PARAM_WORD_MATCH:
259                         switch (atoi(val)){
260                                         case UDM_MATCH_WORD:                                    
261 +#if UDM_VERSION_ID >= 30204
262 +                                               UdmVarListReplaceStr(&Agent->Conf->Vars,"wm","wrd");
263 +#else
264                                                 Agent->word_match=UDM_MATCH_WORD;
265 +#endif
266                                                 break;
267  
268                                         case UDM_MATCH_BEGIN:
269 +#if UDM_VERSION_ID >= 30204
270 +                                               UdmVarListReplaceStr(&Agent->Conf->Vars,"wm","beg");
271 +#else
272                                                 Agent->word_match=UDM_MATCH_BEGIN;
273 +#endif
274                                                 break;
275  
276                                         case UDM_MATCH_END:
277 +#if UDM_VERSION_ID >= 30204
278 +                                               UdmVarListReplaceStr(&Agent->Conf->Vars,"wm","end");
279 +#else
280                                                 Agent->word_match=UDM_MATCH_END;
281 +#endif
282                                                 break;
283  
284                                         case UDM_MATCH_SUBSTR:
285 +#if UDM_VERSION_ID >= 30204
286 +                                               UdmVarListReplaceStr(&Agent->Conf->Vars,"wm","sub");
287 +#else
288                                                 Agent->word_match=UDM_MATCH_SUBSTR;
289 +#endif
290                                                 break;
291                                                 
292                                         default:
293 +#if UDM_VERSION_ID >= 30204
294 +                                               UdmVarListReplaceStr(&Agent->Conf->Vars,"wm","wrd");
295 +#else
296                                                 Agent->word_match=UDM_MATCH_WORD;
297 -                                               
298 +#endif                                         
299                                                 php_error(E_WARNING,"Udm_Set_Agent_Param: Unknown word match mode");
300                                                 RETURN_FALSE;
301                                                 break;
302 @@ -553,9 +653,11 @@
303                 case UDM_PARAM_CACHE_MODE: 
304                         switch (atoi(val)){
305                                 case UDM_CACHE_ENABLED:
306 -#if UDM_VERSION_ID < 30200                             
307 +#if UDM_VERSION_ID < 30200
308                                         Agent->cache_mode=UDM_CACHE_ENABLED;
309 -#else                                  
310 +#elif UDM_VERSION_ID >= 30204
311 +                                       UdmVarListReplaceStr(&Agent->Conf->Vars,"Cache","yes");
312 +#else          
313                                         UdmReplaceStrVar(Agent->Conf->vars,"Cache","yes",UDM_VARSRC_GLOBAL);
314  #endif
315                                         break;
316 @@ -563,6 +665,8 @@
317                                 case UDM_CACHE_DISABLED:
318  #if UDM_VERSION_ID < 30200                                                             
319                                         Agent->cache_mode=UDM_CACHE_DISABLED;
320 +#elif UDM_VERSION_ID >= 30204
321 +                                       UdmVarListReplaceStr(&Agent->Conf->Vars,"Cache","no");
322  #else                                                                          
323                                         UdmReplaceStrVar(Agent->Conf->vars,"Cache","no",UDM_VARSRC_GLOBAL);
324  #endif
325 @@ -571,6 +675,8 @@
326                                 default:
327  #if UDM_VERSION_ID < 30200                                                                                             
328                                         Agent->cache_mode=UDM_CACHE_DISABLED;
329 +#elif UDM_VERSION_ID >= 30204
330 +                                       UdmVarListReplaceStr(&Agent->Conf->Vars,"Cache","no");
331  #else                                                                  
332                                         UdmReplaceStrVar(Agent->Conf->vars,"Cache","no",UDM_VARSRC_GLOBAL);
333  #endif                                         
334 @@ -586,6 +692,8 @@
335                                 case UDM_TRACK_ENABLED:
336  #if UDM_VERSION_ID < 30200                                                                                             
337                                         Agent->track_mode|=UDM_TRACK_QUERIES;
338 +#elif UDM_VERSION_ID >= 30204
339 +                                       UdmVarListReplaceStr(&Agent->Conf->Vars,"TrackQuery","yes");
340  #else
341                                         UdmReplaceStrVar(Agent->Conf->vars,"TrackQuery","yes",UDM_VARSRC_GLOBAL);
342  #endif
343 @@ -594,6 +702,8 @@
344                                 case UDM_TRACK_DISABLED:
345  #if UDM_VERSION_ID < 30200                                             
346                                         Agent->track_mode &= ~(UDM_TRACK_QUERIES);    
347 +#elif UDM_VERSION_ID >= 30204
348 +                                       UdmVarListReplaceStr(&Agent->Conf->Vars,"TrackQuery","no");
349  #else
350                                         UdmReplaceStrVar(Agent->Conf->vars,"TrackQuery","no",UDM_VARSRC_GLOBAL);
351  #endif
352 @@ -603,6 +713,8 @@
353                                 default:
354  #if UDM_VERSION_ID < 30200                                             
355                                         Agent->track_mode &= ~(UDM_TRACK_QUERIES);    
356 +#elif UDM_VERSION_ID >= 30204
357 +                                       UdmVarListReplaceStr(&Agent->Conf->Vars,"TrackQuery","no");
358  #else
359                                         UdmReplaceStrVar(Agent->Conf->vars,"TrackQuery","no",UDM_VARSRC_GLOBAL);
360  #endif                         
361 @@ -633,11 +745,12 @@
362                         break;
363  
364                 case UDM_PARAM_ISPELL_PREFIXES: 
365 -
366                         switch (atoi(val)){
367                                 case UDM_PREFIXES_ENABLED:
368  #if UDM_VERSION_ID < 30200                                                             
369                                         Agent->Conf->ispell_mode |= UDM_ISPELL_USE_PREFIXES;
370 +#elif UDM_VERSION_ID >= 30204
371 +                                       UdmVarListReplaceStr(&Agent->Conf->Vars,"IspellUsePrefixes","1");
372  #else
373                                         UdmAddIntVar(Agent->Conf->vars, "IspellUsePrefixes", 1, UDM_VARSRC_GLOBAL);                                     
374  #endif                                                         
375 @@ -646,6 +759,8 @@
376                                 case UDM_PREFIXES_DISABLED:
377  #if UDM_VERSION_ID < 30200                                                                                             
378                                         Agent->Conf->ispell_mode &= ~UDM_ISPELL_USE_PREFIXES;
379 +#elif UDM_VERSION_ID >= 30204
380 +                                       UdmVarListReplaceStr(&Agent->Conf->Vars,"IspellUsePrefixes","0");
381  #else
382                                         UdmAddIntVar(Agent->Conf->vars, "IspellUsePrefixes", 0, UDM_VARSRC_GLOBAL);                                             
383  #endif                                                                                                                                 
384 @@ -655,6 +770,8 @@
385                                 default:
386  #if UDM_VERSION_ID < 30200                                                             
387                                         Agent->Conf->ispell_mode |= UDM_ISPELL_USE_PREFIXES;
388 +#elif UDM_VERSION_ID >= 30204
389 +                                       UdmVarListReplaceStr(&Agent->Conf->Vars,"IspellUsePrefixes","0");
390  #else
391                                         UdmAddIntVar(Agent->Conf->vars, "IspellUsePrefixes", 1, UDM_VARSRC_GLOBAL);                                     
392  #endif                                                                                         
393 @@ -670,6 +787,12 @@
394  #if UDM_VERSION_ID < 30200                                             
395                         Agent->Conf->local_charset=UdmGetCharset(val);
396                         Agent->charset=Agent->Conf->local_charset;
397 +#elif UDM_VERSION_ID >= 30204
398 +                       UdmVarListReplaceStr(&Agent->Conf->Vars,"LocalCharset",val);
399 +                       {
400 +                           const char * charset=UdmVarListFindStr(&Agent->Conf->Vars,"LocalCharset","iso-8859-1");
401 +                           Agent->Conf->lcs=UdmGetCharSet(charset);
402 +                       }
403  #else
404                         Agent->Conf->local_charset=strdup(val);
405                         UdmReplaceStrVar(Agent->Conf->vars,"LocalCharset",val,UDM_VARSRC_GLOBAL);
406 @@ -679,29 +802,47 @@
407                         
408  #if UDM_VERSION_ID >= 30200
409                 case UDM_PARAM_BROWSER_CHARSET:
410 +#if UDM_VERSION_ID >= 30204
411 +                       UdmVarListReplaceStr(&Agent->Conf->Vars,"BrowserCharset",val);
412 +                       {
413 +                           const char * charset=UdmVarListFindStr(&Agent->Conf->Vars,"BrowserCharset","iso-8859-1");
414 +                           Agent->Conf->lcs=UdmGetCharSet(charset);
415 +                       }
416 +#else
417                         Agent->Conf->browser_charset=strdup(val);
418                         UdmReplaceStrVar(Agent->Conf->vars,"BrowserCharset",val,UDM_VARSRC_GLOBAL);
419 -                       
420 +#endif                 
421                         break;
422  
423                 case UDM_PARAM_HLBEG:
424 +#if UDM_VERSION_ID >= 30204
425 +                       UdmVarListReplaceStr(&Agent->Conf->Vars,"HlBeg",val);
426 +#else
427                         UdmReplaceStrVar(Agent->Conf->vars,"HlBeg",val,UDM_VARSRC_GLOBAL);
428 -                       
429 +#endif                 
430                         break;
431  
432                 case UDM_PARAM_HLEND:
433 -                       UdmReplaceStrVar(Agent->Conf->vars,"HlBeg",val,UDM_VARSRC_GLOBAL);
434 -                       
435 +#if UDM_VERSION_ID >= 30204
436 +                       UdmVarListReplaceStr(&Agent->Conf->Vars,"HlEnd",val);
437 +#else
438 +                       UdmReplaceStrVar(Agent->Conf->vars,"HlEnd",val,UDM_VARSRC_GLOBAL);
439 +#endif                 
440                         break;
441                         
442                 case UDM_PARAM_SYNONYM:
443                         if (UdmSynonymListLoad(Agent->Conf,val)) {
444                                 php_error(E_WARNING,Agent->Conf->errstr);
445                                 RETURN_FALSE;
446 +#if UDM_VERSION_ID >= 30204
447 +                       } else UdmSynonymListSort(&(Agent->Conf->Synonyms));
448 +#else
449                         } else UdmSynonymListSort(&(Agent->Conf->SynList));
450 +#endif                 
451                         break;
452                         
453                 case UDM_PARAM_SEARCHD:
454 +#if UDM_VERSION_ID <= 30203
455                         UdmSDCLientListAdd(&(Agent->Conf->sdcl),val);
456                         {
457                                 size_t i;
458 @@ -709,17 +850,24 @@
459                                         UdmSDCLientListAdd(&Agent->sdcl,Agent->Conf->sdcl.Clients[i].addr);
460                                 }
461                         }
462 -                       
463 +#endif                 
464                         break;
465  
466                 case UDM_PARAM_QSTRING:
467 +#if UDM_VERSION_ID >= 30204
468 +                       UdmVarListReplaceStr(&Agent->Conf->Vars,"QUERY_STRING",val);
469 +#else
470                         UdmReplaceStrVar(Agent->Conf->vars,"QUERY_STRING",val,UDM_VARSRC_GLOBAL);
471 -                       
472 +#endif                 
473                         break;
474  
475 +
476                 case UDM_PARAM_REMOTE_ADDR:
477 +#if UDM_VERSION_ID >= 30204
478 +                       UdmVarListReplaceStr(&Agent->Conf->Vars,"IP",val);
479 +#else
480                         UdmReplaceStrVar(Agent->Conf->vars,"IP",val,UDM_VARSRC_GLOBAL);
481 -                       
482 +#endif                 
483                         break;                  
484  #endif
485                         
486 @@ -731,7 +879,11 @@
487                         break;
488  
489                 case UDM_PARAM_STOPFILE: 
490 +#if UDM_VERSION_ID >= 30204
491 +                       if (UdmStopListLoad(Agent->Conf,val)) {
492 +#else
493                         if (UdmFileLoadStopList(Agent->Conf,val)) {
494 +#endif
495                                 php_error(E_WARNING,Agent->Conf->errstr);
496                                 RETURN_FALSE;
497                         }
498 @@ -740,6 +892,8 @@
499                 case UDM_PARAM_WEIGHT_FACTOR: 
500  #if UDM_VERSION_ID < 30200                                                                             
501                         Agent->weight_factor=strdup(val);
502 +#elif UDM_VERSION_ID >= 30204
503 +                       UdmVarListReplaceStr(&Agent->Conf->Vars,"wf",val);
504  #else
505                         UdmReplaceStrVar(Agent->Conf->vars,"wf",val,UDM_VARSRC_GLOBAL);
506                         {
507 @@ -763,23 +917,37 @@
508                         break;
509                         
510                 case UDM_PARAM_MIN_WORD_LEN: 
511 +#if UDM_VERSION_ID >= 30204
512 +                       Agent->Conf->WordParam.min_word_len=atoi(val);
513 +#else
514                         Agent->Conf->min_word_len=atoi(val);
515 -                           
516 +#endif                     
517                         break;
518                         
519                 case UDM_PARAM_MAX_WORD_LEN: 
520 +#if UDM_VERSION_ID >= 30204
521 +                       Agent->Conf->WordParam.max_word_len=atoi(val);
522 +#else
523                         Agent->Conf->max_word_len=atoi(val);
524 -                           
525 +#endif                     
526                         break;
527                         
528                 case UDM_PARAM_CROSS_WORDS: 
529                         switch (atoi(val)){
530                                 case UDM_CROSS_WORDS_ENABLED:
531 +#if UDM_VERSION_ID >= 30204
532 +                                       UdmVarListReplaceStr(&Agent->Conf->Vars,"CrossWords","yes");
533 +#else
534                                         Agent->Conf->use_crossword=UDM_CROSS_WORDS_ENABLED;
535 +#endif
536                                         break;
537                                         
538                                 case UDM_CROSS_WORDS_DISABLED:
539 +#if UDM_VERSION_ID >= 30204
540 +                                       UdmVarListReplaceStr(&Agent->Conf->Vars,"CrossWords","no");
541 +#else
542                                         Agent->Conf->use_crossword=UDM_CROSS_WORDS_DISABLED;
543 +#endif
544                                         break;
545                                         
546                                 default:
547 @@ -795,14 +963,22 @@
548                 case UDM_PARAM_VARDIR:
549  #if UDM_VERSION_ID < 30200
550                         udm_snprintf(Agent->Conf->vardir,sizeof(Agent->Conf->vardir)-1,"%s%s",val,UDMSLASHSTR);
551 +#elif UDM_VERSION_ID >= 30204
552 +                       UdmVarListReplaceStr(&Agent->Conf->Vars,"Vardir",val);
553 +                       snprintf(Agent->Conf->vardir,sizeof(Agent->Conf->vardir)-1,"%s%s",val,UDMSLASHSTR);
554  #else                  
555                         snprintf(Agent->Conf->vardir,sizeof(Agent->Conf->vardir)-1,"%s%s",val,UDMSLASHSTR);
556  #endif                 
557 -
558                         break;
559                         
560 +#if UDM_VERSION_ID >= 30204
561 +               case UDM_PARAM_QUERY:
562 +                       UdmVarListReplaceStr(&Agent->Conf->Vars,"q",val);
563 +
564 +                       break;
565 +#endif
566 +
567  #endif
568 -                       
569                 default:
570                         php_error(E_WARNING,"Udm_Set_Agent_Param: Unknown agent session parameter");
571                         RETURN_FALSE;
572 @@ -938,10 +1114,17 @@
573         }
574         
575         if (flag) {
576 +#if UDM_VERSION_ID >= 30204
577 +               if(Agent->Conf->Spells.nspell) {
578 +                       UdmSortDictionary(&Agent->Conf->Spells);
579 +                       UdmSortAffixes(&Agent->Conf->Affixes,&Agent->Conf->Spells);
580 +               }
581 +#else
582                 if(Agent->Conf->nspell) {
583                         UdmSortDictionary(Agent->Conf);
584                         UdmSortAffixes(Agent->Conf);
585                 }
586 +#endif
587         }
588         
589         RETURN_TRUE;
590 @@ -966,8 +1149,11 @@
591                         break;
592         }
593         ZEND_FETCH_RESOURCE(Agent, UDM_AGENT *, yyagent, -1, "mnoGoSearch-Agent", le_link);
594 -       
595 -#if UDM_VERSION_ID > 30111
596 +
597 +#if UDM_VERSION_ID >= 30204
598 +       UdmSpellListFree(&Agent->Conf->Spells);
599 +       UdmAffixListFree(&Agent->Conf->Affixes);
600 +#elif UDM_VERSION_ID > 30111
601         UdmFreeIspell(Agent->Conf);
602  #endif
603         
604 @@ -1005,26 +1191,40 @@
605         
606         switch(var){
607                 case UDM_LIMIT_URL: 
608 +#if UDM_VERSION_ID >= 30204                    
609 +                       UdmVarListAddStr(&Agent->Conf->Vars,"ul",val);
610 +#else
611                         UdmAddURLLimit(Agent->Conf,val);
612 -               
613 +#endif         
614                         break;
615                         
616                 case UDM_LIMIT_TAG: 
617 +#if UDM_VERSION_ID >= 30204                    
618 +                       UdmVarListAddStr(&Agent->Conf->Vars,"t",val);
619 +#else
620                         UdmAddTagLimit(Agent->Conf,val);
621 -               
622 +#endif         
623                         break;
624  
625                 case UDM_LIMIT_LANG: 
626 +#if UDM_VERSION_ID >= 30204                    
627 +                       UdmVarListAddStr(&Agent->Conf->Vars,"lang",val);
628 +#else
629                         UdmAddLangLimit(Agent->Conf,val);
630 -                       
631 +#endif                 
632                         break;
633  
634                 case UDM_LIMIT_CAT: 
635 +#if UDM_VERSION_ID >= 30204
636 +                       UdmVarListAddStr(&Agent->Conf->Vars,"cat",val);
637 +#else
638                         UdmAddCatLimit(Agent->Conf,val);
639 -                       
640 +#endif                 
641                         break;
642                         
643 -               case UDM_LIMIT_DATE: {
644 +               case UDM_LIMIT_DATE: 
645 +#if UDM_VERSION_ID < 30200                     
646 +                       {
647                         struct udm_stl_info_t stl_info = { 0, 0, 0 };
648                         
649                         if (val[0] == '>') {
650 @@ -1038,9 +1238,9 @@
651                         
652                         stl_info.t1=(time_t)(atol(val+1));
653                         UdmAddTimeLimit(Agent->Conf,&stl_info);
654 -                       
655 -                       break;
656                         }
657 +#endif
658 +                       break;
659                 default:
660                         php_error(E_WARNING,"Udm_Add_Search_Limit: Unknown search limit parameter");
661                         RETURN_FALSE;
662 @@ -1056,6 +1256,8 @@
663  {
664         pval ** yyagent;
665         UDM_AGENT * Agent;
666 +       int i;
667 +       
668         switch(ZEND_NUM_ARGS()){
669                 case 1: {
670                                 if (zend_get_parameters_ex(1, &yyagent)==FAILURE) {
671 @@ -1068,9 +1270,20 @@
672                         break;
673         }
674         ZEND_FETCH_RESOURCE(Agent, UDM_AGENT *, yyagent, -1, "mnoGoSearch-Agent", le_link);
675 -       
676 +#if UDM_VERSION_ID >= 30204    
677 +       for(i=0;i<Agent->Conf->Vars.nvars;i++){
678 +               if ((!strcasecmp("ul",Agent->Conf->Vars.Var[i].name))||
679 +                   (!strcasecmp("cat",Agent->Conf->Vars.Var[i].name))||
680 +                   (!strcasecmp("t",Agent->Conf->Vars.Var[i].name))||
681 +                   (!strcasecmp("lang",Agent->Conf->Vars.Var[i].name))) {
682 +                   UDM_FREE(Agent->Conf->Vars.Var[i].name);
683 +                   UDM_FREE(Agent->Conf->Vars.Var[i].val);
684 +                   Agent->Conf->Vars.nvars--;
685 +               }
686 +       }
687 +#else
688         UdmClearLimits(Agent->Conf);
689 -       
690 +#endif 
691         RETURN_TRUE;
692  }
693  /* }}} */
694 @@ -1141,7 +1354,9 @@
695         RETURN_STRING(buf,1);
696  }
697  /* }}} */
698 +#endif
699  
700 +#if UDM_VERSION_ID == 30203
701  /* {{{ proto int udm_open_stored(int agent, string storedaddr)
702     Open connection to stored  */
703  DLEXPORT PHP_FUNCTION(udm_open_stored)
704 @@ -1260,6 +1475,37 @@
705  /* }}} */
706  #endif
707  
708 +#if UDM_VERSION_ID >= 30204
709 +/* {{{ proto int udm_parse_query_string(int agent, string str)
710 +   Parses query string, initialises variables and search limits taken from it */
711 +DLEXPORT PHP_FUNCTION(udm_parse_query_string)
712 +{
713 +       pval ** yystr, ** yyagent;
714 +       char *str;
715 +       UDM_AGENT * Agent;
716 +       int id=-1;
717 +
718 +       switch(ZEND_NUM_ARGS()){
719 +               case 2: {
720 +                               if (zend_get_parameters_ex(2, &yyagent,&yystr)==FAILURE) {
721 +                                       RETURN_FALSE;
722 +                               }
723 +                       }
724 +                       break;
725 +               default:                                
726 +                       WRONG_PARAM_COUNT;
727 +                       break;
728 +       }
729 +       ZEND_FETCH_RESOURCE(Agent, UDM_AGENT *, yyagent, id, "mnoGoSearch-Agent", le_link);
730 +       convert_to_string_ex(yystr);
731 +       str = Z_STRVAL_PP(yystr);
732 +
733 +       UdmParseQueryString(Agent,&Agent->Conf->Vars,str);
734 +       RETURN_TRUE;
735 +}
736 +/* }}} */
737 +#endif
738 +
739  /* {{{ proto int udm_find(int agent, string query)
740     Perform search */
741  DLEXPORT PHP_FUNCTION(udm_find)
742 @@ -1283,7 +1529,7 @@
743         ZEND_FETCH_RESOURCE(Agent, UDM_AGENT *, yyagent, id, "mnoGoSearch-Agent", le_link);
744         convert_to_string_ex(yyquery);
745         
746 -#if UDM_VERSION_ID < 30200             
747 +#if UDM_VERSION_ID < 30200
748         if ((Res=UdmFind(Agent,UdmTolower(Z_STRVAL_PP(yyquery),Agent->charset)))) {
749  #else
750         if ((Res=UdmFind(Agent,Z_STRVAL_PP(yyquery)))) {
751 @@ -1323,64 +1569,124 @@
752         if(row<Res->num_rows){
753                 switch(field){
754                         case UDM_FIELD_URL:             
755 +#if UDM_VERSION_ID >= 30204
756 +                               RETURN_STRING((char *)UdmVarListFindStr(&Res->Doc[row].Sections,"URL",""),1);
757 +#else
758                                 RETURN_STRING((Res->Doc[row].url)?(Res->Doc[row].url):"",1);
759 +#endif
760                                 break;
761                                 
762                         case UDM_FIELD_CONTENT:         
763 +#if UDM_VERSION_ID >= 30204
764 +                               RETURN_STRING((char *)UdmVarListFindStr(&(Res->Doc[row].Sections),"Content-Type",""),1);
765 +#else
766                                 RETURN_STRING((Res->Doc[row].content_type)?(Res->Doc[row].content_type):"",1);
767 +#endif
768                                 break;
769                                 
770                         case UDM_FIELD_TITLE:           
771 +#if UDM_VERSION_ID >= 30204
772 +                               RETURN_STRING((char *)UdmVarListFindStr(&(Res->Doc[row].Sections),"Title",""),1);
773 +#else
774                                 RETURN_STRING((Res->Doc[row].title)?(Res->Doc[row].title):"",1);
775 +#endif
776                                 break;
777                                 
778                         case UDM_FIELD_KEYWORDS:        
779 +#if UDM_VERSION_ID >= 30204
780 +                               RETURN_STRING((char *)UdmVarListFindStr(&(Res->Doc[row].Sections),"Meta.Keywords",""),1);
781 +#else
782                                 RETURN_STRING((Res->Doc[row].keywords)?(Res->Doc[row].keywords):"",1);
783 +#endif
784                                 break;
785                                 
786                         case UDM_FIELD_DESC:            
787 +#if UDM_VERSION_ID >= 30204
788 +                               RETURN_STRING((char *)UdmVarListFindStr(&(Res->Doc[row].Sections),"Meta.Description",""),1);
789 +#else
790                                 RETURN_STRING((Res->Doc[row].description)?(Res->Doc[row].description):"",1);
791 +#endif
792                                 break;
793                                 
794                         case UDM_FIELD_TEXT:            
795 +#if UDM_VERSION_ID >= 30204
796 +                               RETURN_STRING((char *)UdmVarListFindStr(&(Res->Doc[row].Sections),"Body",""),1);
797 +#else
798                                 RETURN_STRING((Res->Doc[row].text)?(Res->Doc[row].text):"",1);
799 +#endif
800                                 break;
801                                 
802                         case UDM_FIELD_SIZE:            
803 +#if UDM_VERSION_ID >= 30204
804 +                               RETURN_LONG(UdmVarListFindInt(&(Res->Doc[row].Sections),"Content-Length",0));
805 +#else
806                                 RETURN_LONG((Res->Doc[row].size));
807 +#endif
808                                 break;
809                                 
810 -                       case UDM_FIELD_URLID:           
811 +                       case UDM_FIELD_URLID:
812 +#if UDM_VERSION_ID >= 30204
813 +                               RETURN_LONG(UdmVarListFindInt(&(Res->Doc[row].Sections),"ID",0));
814 +#else
815                                 RETURN_LONG((Res->Doc[row].url_id));
816 +#endif
817                                 break;
818                                 
819                         case UDM_FIELD_RATING:          
820 +#if UDM_VERSION_ID >= 30204
821 +                               RETURN_STRING((char *)UdmVarListFindStr(&(Res->Doc[row].Sections),"Score",""),1);
822 +#else
823                                 RETURN_LONG((Res->Doc[row].rating));
824 +#endif
825                                 break;
826                                 
827                         case UDM_FIELD_MODIFIED:        
828 +#if UDM_VERSION_ID >= 30204
829 +                               RETURN_LONG(UdmVarListFindInt(&(Res->Doc[row].Sections),"Last-Modified",0));
830 +#else
831                                 RETURN_LONG((Res->Doc[row].last_mod_time));
832 +#endif
833                                 break;
834  
835                         case UDM_FIELD_ORDER:   
836 +#if UDM_VERSION_ID >= 30204
837 +                               RETURN_LONG(UdmVarListFindInt(&(Res->Doc[row].Sections),"Order",0));
838 +#else
839                                 RETURN_LONG((Res->Doc[row].order));
840 +#endif
841                                 break;
842                                 
843                         case UDM_FIELD_CRC:     
844 +#if UDM_VERSION_ID >= 30204
845 +                               RETURN_LONG(UdmVarListFindInt(&(Res->Doc[row].Sections),"crc32",0));
846 +#else
847                                 RETURN_LONG((Res->Doc[row].crc32));
848 +#endif
849                                 break;
850                                 
851                         case UDM_FIELD_CATEGORY:                
852 +#if UDM_VERSION_ID >= 30204
853 +                               RETURN_STRING((char *)UdmVarListFindStr(&(Res->Doc[row].Sections),"Category",""),1);
854 +#else
855                                 RETURN_STRING((Res->Doc[row].category)?(Res->Doc[row].category):"",1);
856 +#endif
857                                 break;
858  
859  #if UDM_VERSION_ID >= 30203            
860                         case UDM_FIELD_LANG:            
861 +#if UDM_VERSION_ID >= 30204
862 +                               RETURN_STRING((char *)UdmVarListFindStr(&(Res->Doc[row].Sections),"Content-Language",""),1);
863 +#else
864                                 RETURN_STRING((Res->Doc[row].lang)?(Res->Doc[row].lang):"",1);
865 +#endif
866                                 break;
867  
868                         case UDM_FIELD_CHARSET:         
869 +#if UDM_VERSION_ID >= 30204
870 +                               RETURN_STRING((char *)UdmVarListFindStr(&(Res->Doc[row].Sections),"Charset",""),1);
871 +#else
872                                 RETURN_STRING((Res->Doc[row].charset)?(Res->Doc[row].charset):"",1);
873 +#endif
874                                 break;
875  #endif
876                                 
877 @@ -1426,9 +1732,73 @@
878                         RETURN_LONG(Res->total_found);
879                         break;
880                 
881 -               case UDM_PARAM_WORDINFO:        
882 +               case UDM_PARAM_WORDINFO: 
883 +#if UDM_VERSION_ID >= 30204
884 +                       {
885 +                           int len,i;
886 +                           for(len = i = 0; i < Res->WWList.nwords; i++) 
887 +                               len += Res->WWList.Word[i].len;
888 +                           {   
889 +                               size_t wsize=(1+len*15)*sizeof(char);
890 +                               char *wordinfo = (char*) malloc(wsize);
891 +                               int corder = -1, ccount = 0;
892 +         
893 +                               *wordinfo = '\0';
894 +         
895 +                               for(i = 0; i < Res->WWList.nwords; i++){
896 +                                   if ((Res->WWList.Word[i].count > 0) || (Res->WWList.Word[i].origin == UDM_WORD_ORIGIN_QUERY)) {
897 +                                   if(wordinfo[0]) strcat(wordinfo,", ");
898 +                                       sprintf(UDM_STREND(wordinfo)," %s : %d", Res->WWList.Word[i].word, Res->WWList.Word[i].count);
899 +                                   } else if (Res->WWList.Word[i].origin == UDM_WORD_ORIGIN_STOP) {
900 +                                       if(wordinfo[0]) strcat(wordinfo,", ");
901 +                                       sprintf(UDM_STREND(wordinfo)," %s : stopword", Res->WWList.Word[i].word);
902 +                                   }
903 +                               }
904 +                               RETURN_STRING(wordinfo,1);
905 +                           }
906 +                       }
907 +#else
908                         RETURN_STRING((Res->wordinfo)?(Res->wordinfo):"",1);
909 +#endif
910 +                       break;
911 +
912 +#if UDM_VERSION_ID >= 30204
913 +               case UDM_PARAM_WORDINFO_ALL: 
914 +                       {
915 +                           int len,i;
916 +                           for(len = i = 0; i < Res->WWList.nwords; i++) 
917 +                               len += Res->WWList.Word[i].len;
918 +                           {   
919 +                               size_t wsize=(1+len*15)*sizeof(char);
920 +                               char *wordinfo = (char*) malloc(wsize);
921 +                               int corder = -1, ccount = 0;
922 +         
923 +                               *wordinfo = '\0';
924 +                               
925 +                               for(i = 0; i < Res->WWList.nwords; i++){
926 +                                   if (Res->WWList.Word[i].order != corder) {
927 +                                       if(wordinfo[0]) {
928 +                                           sprintf(UDM_STREND(wordinfo)," / %d, ", ccount);
929 +                                       }
930 +                                       ccount = Res->WWList.Word[i].count;
931 +                                       if (Res->WWList.Word[i].origin == UDM_WORD_ORIGIN_STOP) {
932 +                                           sprintf(UDM_STREND(wordinfo)," %s : stopword", Res->WWList.Word[i].word);
933 +                                       } else {
934 +                                           sprintf(UDM_STREND(wordinfo)," %s : %d", Res->WWList.Word[i].word, Res->WWList.Word[i].count);
935 +                                           corder = Res->WWList.Word[i].order; 
936 +                                       }
937 +                                   } else {
938 +                                       ccount += Res->WWList.Word[i].count;
939 +                                   }
940 +                               }
941 +                               if (Res->WWList.nwords) {
942 +                                   sprintf(UDM_STREND(wordinfo)," / %d", ccount);
943 +                               }
944 +                               RETURN_STRING(wordinfo,1);
945 +                           }
946 +                       }
947                         break;
948 +#endif
949                         
950                 case UDM_PARAM_SEARCHTIME:      
951                         RETURN_DOUBLE(((double)Res->work_time)/1000);
952 @@ -1516,7 +1886,11 @@
953                         break;
954         }
955         ZEND_FETCH_RESOURCE(Agent, UDM_AGENT *, yyagent, -1, "mnoGoSearch-Agent", le_link);
956 +#if UDM_VERSION_ID >= 30204
957 +       RETURN_LONG(UdmEnvErrCode(Agent->Conf));
958 +#else
959         RETURN_LONG(UdmDBErrorCode(Agent->db));
960 +#endif
961  }
962  /* }}} */
963  
964 @@ -1539,7 +1913,11 @@
965                         break;
966         }
967         ZEND_FETCH_RESOURCE(Agent, UDM_AGENT *, yyagent, -1, "mnoGoSearch-Agent", le_link);
968 +#if UDM_VERSION_ID >= 30204
969 +       RETURN_STRING((UdmEnvErrMsg(Agent->Conf))?(UdmEnvErrMsg(Agent->Conf)):"",1);
970 +#else
971         RETURN_STRING((UdmDBErrorMsg(Agent->db))?(UdmDBErrorMsg(Agent->db)):"",1);
972 +#endif
973  }
974  /* }}} */
975  
976 @@ -1577,7 +1955,14 @@
977         convert_to_string_ex(yycat);
978         cat = Z_STRVAL_PP(yycat);
979  
980 +#if UDM_VERSION_ID >= 30204
981 +       if (NULL==(c=(UDM_CATEGORY *)malloc(sizeof(UDM_CATEGORY)))) RETURN_FALSE;
982 +       if (NULL==(c->Category=malloc(sizeof(UDM_CATITEM)))) RETURN_FALSE;
983 +       strncpy(c->addr,cat,sizeof(c->addr)-1);
984 +       if(UdmCatAction(Agent,c,UDM_CAT_ACTION_LIST,Agent->Conf->db)){
985 +#else
986         if((c=UdmCatList(Agent,cat))){
987 +#endif
988                 if (array_init(return_value)==FAILURE) {
989                         RETURN_FALSE;
990                 }
991 @@ -1586,15 +1971,30 @@
992                         RETURN_FALSE;
993                 }
994                 
995 +#if UDM_VERSION_ID >= 30204
996 +               {
997 +                   int i;
998 +                   for(i==0;i<c->ncategories;i++){                     
999 +                       snprintf(buf, UDMSTRSIZ, "%s%s",c->Category[i].link[0]?"@ ":"", c->Category[i].name);                            
1000 +                       add_next_index_string(return_value, c->Category[i].link[0]?c->Category[i].link:c->Category[i].path, 1);
1001 +                       add_next_index_string(return_value, buf, 1);
1002 +                       c++;
1003 +                   }
1004 +               }
1005 +#else
1006                 while(c->rec_id){                       
1007                         snprintf(buf, UDMSTRSIZ, "%s%s",c->link[0]?"@ ":"", c->name);                            
1008                         add_next_index_string(return_value, c->link[0]?c->link:c->path, 1);
1009                         add_next_index_string(return_value, buf, 1);
1010                         c++;
1011                 }
1012 -               
1013 +#endif         
1014                 free(buf);
1015 -       } else {
1016 +#if UDM_VERSION_ID >= 30204    
1017 +               free(c->Category);
1018 +               free(c);
1019 +#endif
1020 +} else {
1021                 RETURN_FALSE;
1022         }
1023  }
1024 @@ -1626,7 +2026,14 @@
1025         convert_to_string_ex(yycat);
1026         cat = Z_STRVAL_PP(yycat);
1027  
1028 +#if UDM_VERSION_ID >= 30204
1029 +       if (NULL==(c=(UDM_CATEGORY *)malloc(sizeof(UDM_CATEGORY)))) RETURN_FALSE;
1030 +       if (NULL==(c->Category=malloc(sizeof(UDM_CATITEM)))) RETURN_FALSE;
1031 +       strncpy(c->addr,cat,sizeof(c->addr)-1);
1032 +       if(UdmCatAction(Agent,c,UDM_CAT_ACTION_PATH,Agent->Conf->db)){
1033 +#else
1034         if((c=UdmCatPath(Agent,cat))){
1035 +#endif
1036                 if (array_init(return_value)==FAILURE) {
1037                         RETURN_FALSE;
1038                 }
1039 @@ -1635,14 +2042,29 @@
1040                         RETURN_FALSE;
1041                 }
1042                 
1043 +#if UDM_VERSION_ID >= 30204
1044 +               {
1045 +                   int i;
1046 +                   for(i==0;i<c->ncategories;i++){                     
1047 +                       snprintf(buf, UDMSTRSIZ, "%s%s",c->Category[i].link[0]?"@ ":"", c->Category[i].name);
1048 +                       add_next_index_string(return_value, c->Category[i].link[0]?c->Category[i].link:c->Category[i].path, 1);
1049 +                       add_next_index_string(return_value, buf, 1);
1050 +                       c++;
1051 +                   }
1052 +               }
1053 +#else
1054                 while(c->rec_id){                       
1055                         snprintf(buf, UDMSTRSIZ, "%s%s",c->link[0]?"@ ":"", c->name);                            
1056                         add_next_index_string(return_value, c->link[0]?c->link:c->path, 1);
1057                         add_next_index_string(return_value, buf, 1);
1058                         c++;
1059                 }
1060 -               
1061 +#endif         
1062                 free(buf);
1063 +#if UDM_VERSION_ID >= 30204    
1064 +               free(c->Category);
1065 +               free(c);
1066 +#endif
1067         } else {
1068                 RETURN_FALSE;
1069         }
1070 @@ -1670,7 +2092,11 @@
1071                         break;
1072         }
1073         ZEND_FETCH_RESOURCE(Agent, UDM_AGENT *, yyagent, id, "mnoGoSearch-Agent", le_link);
1074 +#if UDM_VERSION_ID >= 30204
1075 +       RETURN_LONG(UdmURLAction(Agent,NULL,UDM_URL_ACTION_DOCCOUNT,Agent->Conf->db));
1076 +#else
1077         RETURN_LONG(UdmGetDocCount(Agent));
1078 +#endif
1079  }
1080  /* }}} */
1081  #endif
1082 diff -ur php-4.2.2/ext/mnogosearch.orig/php_mnogo.h php-4.2.2/ext/mnogosearch/php_mnogo.h
1083 --- php-4.2.2/ext/mnogosearch.orig/php_mnogo.h  Thu Feb 28 09:26:23 2002
1084 +++ php-4.2.2/ext/mnogosearch/php_mnogo.h       Thu Jun  6 07:45:45 2002
1085 @@ -1,5 +1,5 @@
1086  /* $Source$ */
1087 -/* $Id$ */
1088 +/* $Id$ */
1089  
1090  /* 
1091     +----------------------------------------------------------------------+
1092 @@ -57,14 +57,18 @@
1093  DLEXPORT PHP_FUNCTION(udm_api_version);
1094  #if UDM_VERSION_ID >= 30200
1095  DLEXPORT PHP_FUNCTION(udm_check_charset);
1096 -#endif
1097 -
1098 -#if UDM_VERSION_ID >= 30203
1099 -DLEXPORT PHP_FUNCTION(udm_crc32);
1100 +#if UDM_VERSION_ID == 30203
1101  DLEXPORT PHP_FUNCTION(udm_open_stored);
1102  DLEXPORT PHP_FUNCTION(udm_check_stored);
1103  DLEXPORT PHP_FUNCTION(udm_close_stored);
1104  #endif
1105 +#if UDM_VERSION_ID >= 30203
1106 +DLEXPORT PHP_FUNCTION(udm_crc32);
1107 +#endif
1108 +#if UDM_VERSION_ID >= 30204
1109 +DLEXPORT PHP_FUNCTION(udm_parse_query_string);
1110 +#endif
1111 +#endif
1112  
1113  DLEXPORT PHP_FUNCTION(udm_alloc_agent);
1114  DLEXPORT PHP_FUNCTION(udm_set_agent_param);
This page took 0.219106 seconds and 3 git commands to generate.