summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Kartashoff <gluke@php.net>2004-11-28 20:03:05 +0000
committerSergey Kartashoff <gluke@php.net>2004-11-28 20:03:05 +0000
commit1907f0ab8b54c4caa02cc4fa93bbfd2d4a46bc2a (patch)
tree98e8b6b3814b84aad081e6735acd4ec4235233f3
parentdbc0bb7514a0ea2143d3b175728412b056b59357 (diff)
downloadphp-git-1907f0ab8b54c4caa02cc4fa93bbfd2d4a46bc2a.tar.gz
- MnoGoSearch extension updated to fix compilation issues with
mnogosearch-3.2.25+
-rw-r--r--ext/mnogosearch/php_mnogo.c30
1 files changed, 20 insertions, 10 deletions
diff --git a/ext/mnogosearch/php_mnogo.c b/ext/mnogosearch/php_mnogo.c
index e88ed4201a..a54b8765a3 100644
--- a/ext/mnogosearch/php_mnogo.c
+++ b/ext/mnogosearch/php_mnogo.c
@@ -1214,43 +1214,48 @@ DLEXPORT PHP_FUNCTION(udm_load_ispell_data)
#endif
case UDM_ISPELL_TYPE_AFFIX:
-#if UDM_VERSION_ID < 30200
+#if UDM_VERSION_ID < 30200
Agent->Conf->ispell_mode &= ~UDM_ISPELL_MODE_DB;
-
#if UDM_VERSION_ID > 30111
Agent->Conf->ispell_mode &= ~UDM_ISPELL_MODE_SERVER;
#endif
-
if (UdmImportAffixes(Agent->Conf,val1,val2,NULL,0)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING,"Cannot load affix file %s",val2);
RETURN_FALSE;
}
-#else
+#elif UDM_VERSION_ID < 30225
if (UdmImportAffixes(Agent->Conf,val1,charset,val2)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING,"Cannot load affix file %s",val2);
RETURN_FALSE;
}
-
+#else
+ if(UdmAffixListListAdd(&Agent->Conf->Affixes,val1,charset,val2)) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING,"Cannot load affix file %s",val2);
+ RETURN_FALSE;
+ }
#endif
break;
case UDM_ISPELL_TYPE_SPELL:
#if UDM_VERSION_ID < 30200
Agent->Conf->ispell_mode &= ~UDM_ISPELL_MODE_DB;
-
#if UDM_VERSION_ID > 30111
Agent->Conf->ispell_mode &= ~UDM_ISPELL_MODE_SERVER;
#endif
-
if (UdmImportDictionary(Agent->Conf,val1,val2,1,"")) {
php_error_docref(NULL TSRMLS_CC, E_WARNING,"Cannot load spell file %s",val2);
RETURN_FALSE;
}
-#else
+#elif UDM_VERSION_ID < 30225
if (UdmImportDictionary(Agent->Conf,val1,charset,val2,0,"")) {
php_error_docref(NULL TSRMLS_CC, E_WARNING,"Cannot load spell file %s",val2);
RETURN_FALSE;
}
+#else
+ if(UdmSpellListListAdd(&Agent->Conf->Spells,val1,charset,val2)) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING,"Cannot load spell file %s",val2);
+ RETURN_FALSE;
+ }
#endif
break;
@@ -1262,6 +1267,7 @@ DLEXPORT PHP_FUNCTION(udm_load_ispell_data)
}
if (flag) {
+#if UDM_VERSION_ID < 30225
#if UDM_VERSION_ID >= 30204
if(Agent->Conf->Spells.nspell) {
UdmSortDictionary(&Agent->Conf->Spells);
@@ -1273,6 +1279,7 @@ DLEXPORT PHP_FUNCTION(udm_load_ispell_data)
UdmSortAffixes(Agent->Conf);
}
#endif
+#endif
}
RETURN_TRUE;
@@ -1297,8 +1304,11 @@ DLEXPORT PHP_FUNCTION(udm_free_ispell_data)
break;
}
ZEND_FETCH_RESOURCE(Agent, UDM_AGENT *, yyagent, -1, "mnoGoSearch-Agent", le_link);
-
-#if UDM_VERSION_ID >= 30204
+
+#if UDM_VERSION_ID >= 30225
+ UdmSpellListListFree(&Agent->Conf->Spells);
+ UdmAffixListListFree(&Agent->Conf->Affixes);
+#elif UDM_VERSION_ID >= 30204
UdmSpellListFree(&Agent->Conf->Spells);
UdmAffixListFree(&Agent->Conf->Affixes);
#elif UDM_VERSION_ID > 30111