[PHP] ssl in socket functions

2007-10-04 Thread Sergey Ignatenko
Hello guys,

I have one small question and would greatly appreciate if you resolve
it.

Can I create ssl connection through the socket functions (not
fsockopen)?

Thanking in advance,

Sergey Ignatenko.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] time zone problem

2005-08-31 Thread Sergey
Hi!
I some problem:
I have visitor's IP, country and  city. I need to define his GMT offset. 
Have you such database GMT's offsets.
I found many such list in Google but many countries has different GMT's 
(Russia - 7!).
Any idea? 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: splitting CSV rows into multiple SQL inserts?

2005-06-22 Thread Sergey
You can insert file data in DB first, using LOAD DATA INTO FILE, after it'll 
be easy to manipulate this DB table with a help of php-script.

Vince LaMonica [EMAIL PROTECTED] ???/ ?  ?: 
news:[EMAIL PROTECTED]
I sent this note off to the php-db list last night, but the more I thought 
about it, the more I figured this was a general looping question rather 
than a mysql-specific one.

 I am attempting to take a CSV file that has order header and line item 
 data on each line and split it into mulitple insert queries into a mysql 
 db. Each line in the CSV file may only be one order, though it is common 
 for there to be more than one item ordered, so I need to be able to loop 
 to insert the line item values into the proper line item table. I also 
 need to build a counter for a value that is not provided in the CVS for 
 each line item.

 Here is a sample of a few lines of the CSV:

 1110,6/20/2005,Jan Doe,1234 Spring 
 St.,Anytown,PA,17033,0618456990,22.50,1,The Sample Book
 1114,6/22/2005,Jon Smith,888 Main St.,Big 
 City,CA,92648,009444,19.95,1,Coloring Book
 1114,6/22/2005,Jon Smith,888 Main St.,Big 
 City,CA,92648,9834119933,4.40,1,Picture Book
 1114,6/22/2005,Jon Smith,888 Main St.,Big 
 City,CA,92648,948922,59.99,4,Coffee Book

 In the above file, the last 4 fields [item_num, cost, quantity, title] 
 belong in a line_items table. The first number, the order_number, also 
 goes into the line_items table, as well as the order_header table. The 
 contact info for each customer also goes into the order_header table. I do 
 not want duplicate entries in the order_header table, so I can't just to a 
 simple loop through each line in the text file and do an insert. I need to 
 be able to group an order by the order_number [the 1st field] and insert 
 the correct number of rows in both tables. I also need to create a counter 
 per order showing which line item number each item is. Eg: the Coloring 
 Book would be assigned a 1, the Picture book a 2, and the Coffee Book a 3 
 for order #1114. The Sample Book in order #1110 would be given a 1, since 
 it is the first [and only] item in that order.

 I have been successful in assigning each value to a varable and looping 
 through the file via:

 while ($line = fgets($fp,1024))
  {
   $i++;
   if ($i  1) { // using 1 because CSV includes a header row
  list($order_number, ...) = csv_explode($line);

 [i am using an Excel generated CSV with double quotes around each value 
 and so i have a csv_explode function setup to properly extract each value; 
 also the real CSV has about 2 dozen fields - i just cut it down to its 
 basics for the example here]

 Doing 2 inserts here and closing the loop is obviously not the answer, 
 since I get duplicate header rows, and I haven't built a counter for the 
 line_item's table's line counter field. The primary key in the line item 
 table is a combo of the order_number and the line_counter. Each fresh 
 order_number needs to reset the line_counter to 1, until all line items 
 for that order are inserted.

 I am having difficulty figuring out how to loop through the CSV to do the 
 inserts and create a line item counter. Any tips?

 TIA,

 /vjl/ 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: editor in WEB PAGE

2005-06-21 Thread Sergey
I used KTML
http://www.interaktonline.com/Products/KTML/Overview/

Denyl Meneses Guillén [EMAIL PROTECTED] ???/ ?  
?: news:[EMAIL PROTECTED]
Hello
I want to use a RTF editor within a web page like the Hotmail or Yahoo where 
when writing the content of the email him can be put format like Bold, 
fonts, etc.
 I'll like to find how to do.
Thanks for your helps

Denyl.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: editor in WEB PAGE

2005-06-21 Thread Sergey
I used KTML
http://www.interaktonline.com/Products/KTML/Overview/

Denyl Meneses Guillén [EMAIL PROTECTED] ???/ ? 
?: news:[EMAIL PROTECTED]
Hello
I want to use a RTF editor within a web page like the Hotmail or Yahoo where
when writing the content of the email him can be put format like Bold,
fonts, etc.
 I'll like to find how to do.
Thanks for your helps

Denyl.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: file upload

2005-06-21 Thread Sergey
use $HTTP_POST_FILES for older php versions

Han [EMAIL PROTECTED] ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ × ÎÏ×ÏÓÔÑÈ 
ÓÌÅÄÕÀÝÅÅ: 
news:[EMAIL PROTECTED]
 Hello,

 I'm having a problem with a file upload. The following works on one server 
 I use : -

 ---
 function add_me(){
 global $filename;
 global $maxFileSize;
 global $yourdirectory;

 // put this in a file that is called by your webpage with a form
 // use the form file input type and call it 'file'

   $maxFileSize =  204800;
   $filename = $_FILES['file']['tmp_name'];
 echo f is .$filename;

   if (file_exists($filename))
   {
// open the file
   $handle = fopen($filename, r);

// 1. read the file in line by line
   while (!feof($handle))
{
  $buffer = fgets($handle, 4096);

 // if you were reading a text file you can
 // do any operations on each line as you go here
   }


// 2. otherwise just read the whole file
// in one go, e.g. for an image.
 $buffer = fgets($handle, 4096);

// then you can write to the database or
// do whatever with it here

// close the file
   fclose($handle);
   }


 $uploaddir = '/home/folder1/htdocs/folder2/'.myfolder.'/';
 echo BRYYY .$uploaddir;

 $uploadfile2 = $_FILES['file']['tmp_name'];
 $uploadfile2 = preg_replace(/\/tmp\//, , $uploadfile2);

 $uploadfile = $uploaddir . $uploadfile2 ..gif;


 //$$uploadfile2 =~ s/\/[a-zA-Z]\///g;

 //print pre;
 if (move_uploaded_file($_FILES['file']['tmp_name'], $uploadfile)) {
   print File is valid, and was successfully uploaded. ;
 } else {
   print Possible file upload attack!  Here's some debugging info:\n;
 }
 //print /pre$uploadfile;

 chmod($uploadfile,0777);

 --

 But when I use this same code on a different server, it doesn't work as 
 there seem to be no $_FILES['file']['tmp_name'].
 Is $_FILES['file']['tmp_name'] something configured by the server (I'm 
 using Apache on a Linux system), or something default within PHP itself?


 Han. 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Merging Duplicate array items

2005-06-21 Thread Sergey
U may use array_unique() function

Joe Harman [EMAIL PROTECTED] ???/ ?  ?: 
news:[EMAIL PROTECTED]
Hello, I've been trying to figure out on how I could evaluated this
array and combine like items... here is the array.. it represents a
shopping cart contents.. you'll notice that the first array is the
same as the third... what I am trying to do is combine the quantity of
the first array and the third... I am not asking from someone to
program this for me... just for someone to give me a heads up on if
there is a array function I could use. Thanks for any help!

- array example 

$ARY_cart[] = array( 'product_id' = '123',
'sku' = 'DFBag-12',
'quantity' = '2',
'product_name' = 'Dog Food',
'unit' = '12 lbs. Bag',
'price' = '12.05'
);
$ARY_cart[] = array( 'product_id' = '224',
'sku' = 'cFBag-6',
'quantity' = '1',
'product_name' = 'Cat Food',
'unit' = '8 lbs. Bag',
'price' = '4.25'
);
$ARY_cart[] = array( 'product_id' = '123',
'sku' = 'DFBag-12',
'quantity' = '24',
'product_name' = 'Dog Food',
'unit' = '12 lbs. Bag',
'price' = '12.05'
);


-- 
Joe Harman
-
Do not go where the path may lead, go instead where there is no path
and leave a trail. - Ralph Waldo Emerson 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Merging Duplicate array items

2005-06-21 Thread Sergey
U may use array_unique() function

Joe Harman [EMAIL PROTECTED] ???/ ?  ?:
news:[EMAIL PROTECTED]
Hello, I've been trying to figure out on how I could evaluated this
array and combine like items... here is the array.. it represents a
shopping cart contents.. you'll notice that the first array is the
same as the third... what I am trying to do is combine the quantity of
the first array and the third... I am not asking from someone to
program this for me... just for someone to give me a heads up on if
there is a array function I could use. Thanks for any help!

- array example 

$ARY_cart[] = array( 'product_id' = '123',
'sku' = 'DFBag-12',
'quantity' = '2',
'product_name' = 'Dog Food',
'unit' = '12 lbs. Bag',
'price' = '12.05'
);
$ARY_cart[] = array( 'product_id' = '224',
'sku' = 'cFBag-6',
'quantity' = '1',
'product_name' = 'Cat Food',
'unit' = '8 lbs. Bag',
'price' = '4.25'
);
$ARY_cart[] = array( 'product_id' = '123',
'sku' = 'DFBag-12',
'quantity' = '24',
'product_name' = 'Dog Food',
'unit' = '12 lbs. Bag',
'price' = '12.05'
);


-- 
Joe Harman
-
Do not go where the path may lead, go instead where there is no path
and leave a trail. - Ralph Waldo Emerson

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: How to print variable name and contents

2005-06-16 Thread Sergey
You can use $$var constuction, what display name of $var

function my_trace($var){
echo $$var.'='.$var.'br';
 }

nntp.charter.net [EMAIL PROTECTED] /   
: news:[EMAIL PROTECTED]
I want to write a trace procedure and call it with variable names, and I am 
having trouble with the syntax.  My goal is to have a procedure that will 
echo lines such as:

 Trace: $myvar=the contents of $myvar

 My attempt that didn't work is to write a function:

 function my_trace($m){
   echo (\nbrTRACE: $m = );
   eval(\$t=\$m\;);
   echo($t.br\n);
 }

 and call it with statements like:

 my_trace(\$my_var);
 my_trace(\$_ENV[\COMPUTERNAME\]);

 What am I doing wrong, and how should this be done?  Also, should I post 
 to a different group?

 Thanks,
 Gil Grodsky
 [EMAIL PROTECTED] 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] incrementing a register global

2005-06-16 Thread Sergey
You try to increment value of a var! to change it name u have to add $i to 
it's name like this
foreach($i=1;$i=$boxes;$i++){
  echo $_GET['name'].$i;
}

foreach ($_GET as $var_name=$var_value)
{
$i++;
echo $var_mane.$i;
}

if I correctly understand u
Jay Blanchard [EMAIL PROTECTED] ???/ ? 
 ?: news:[EMAIL PROTECTED]
[snip]
I dont know it this is possible, but here it goes.  Hopefully I cac
explain
it well enough for someone to understand.

I am posting data to a php script.  I have several variables that are
the
same except the number at the end is different.  So the url of the
called
script will be something like:

http://www.something.com/test.php?name1=Samname2=Billname3=Joe

On my script I am using substr() and strrchr() to get the number of last

variable:

$names = substr(strrchr($_SERVER['QUERY_STRING'],),7,1);

I am then trying to run a loop to call each variable and just print it
on
the screen:

for($i=1;$i=$boxes;$i++){
  echo $_GET['name'].$i;
}

This is where my problem is.  And I dont know if this is even possible,
but
if you look at the echo line in the loop I am trying to add the number
of $i
to the register global.  I dont get an error in doing this, but when I
run
the script I get the number of $i instead of the value of $_GET['name1']

Like I said, I hope I explained this good enough for someone to know
what I
am trying to do.  If anyone has any suggestions or comments about doing
something like this please let me know.
[/snip]

Your terminology is a little mixed-up, you are not dealing with a
'register global' you are dealing with a variable and an array. If you
will do this...

print_r($_GET); You will see am array. then you can do something like
this..(without the substring manipulation above)

for($i = 0; $i  count($_GET); $i++){
echo $_GET[$i] . \n;
} 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: unable to load php_gd2.dll

2005-06-15 Thread Sergey
Check a conformity of php and gd versions. I had same problem, I donload
Nusphere Techplat and took its php_gd2.dll. I can send u one if u want
ddiffa [EMAIL PROTECTED] ???/ ?  ?:
news:[EMAIL PROTECTED]
 Okay I at loss.  I have tried but i can seem to get the
 php_gd2.dll to work properly.  Any help this is what i have
 done so far.

 I have in my php.ini file,

 ; Directory in which the loadable extensions (modules)
 reside.
 extension_dir = C:\PHP\extensions

 I have also uncommented the

 extension = php_gd2.dll

 I have in the c:\php\extension folder the php_gd2.dll

 I have restarted IIS but still nothing

 I am using Window XP $ 2000 with IIS 5.0 but still nothing

 Please help
 Disieyi

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] problem: readdir returns old (cached) directory listing

2002-10-03 Thread sergey

After calling unlink for a specific file in a directory on a Linux system,
the file is deleted but subsequent calls to readdir return
old directory listing until the script finishes. The next time
I execute the script, it does not list the deleted file.
But I need to reread directory just after calling unlink.
I couldn't find any information regarding this behavior of readdir.
I also tried clearstatcache() but without success.

Can anyone help?




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-CVS] cvs: php4 /ext/mnogosearch php_mnogo.c test.php

2001-03-02 Thread Sergey Kartashoff

gluke   Fri Mar  2 03:41:34 2001 EDT

  Modified files:  
/php4/ext/mnogosearch   php_mnogo.c test.php 
  Log:
  UDM_ISPELL_TYPE_SERVER parameter in udm_load_ispell_data has been added
  to work with ispell server. This feature is available starting from 
  mnoGoSearch 3.1.12 or later. Fixed Udm_Free_Ispell_Data(). Example updated.
  
  
Index: php4/ext/mnogosearch/php_mnogo.c
diff -u php4/ext/mnogosearch/php_mnogo.c:1.22 php4/ext/mnogosearch/php_mnogo.c:1.23
--- php4/ext/mnogosearch/php_mnogo.c:1.22   Thu Mar  1 06:51:11 2001
+++ php4/ext/mnogosearch/php_mnogo.cFri Mar  2 03:41:34 2001
@@ -1,5 +1,5 @@
 /* $Source: /local/repository/php4/ext/mnogosearch/php_mnogo.c,v $ */
-/* $Id: php_mnogo.c,v 1.22 2001/03/01 14:51:11 gluke Exp $ */
+/* $Id: php_mnogo.c,v 1.23 2001/03/02 11:41:34 gluke Exp $ */
 
 /*
+--+
@@ -643,6 +643,10 @@

case UDM_ISPELL_TYPE_AFFIX: 
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(E_WARNING,"Udm_Load_Ispell_Data: Cannot load 
affix file %s",val2);
@@ -654,16 +658,28 @@
case UDM_ISPELL_TYPE_SPELL: 
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(E_WARNING,"Udm_Load_Ispell_Data: Cannot load 
spell file %s",val2);
RETURN_FALSE;
}

break;
-   
+
+#if UDM_VERSION_ID  30111
+
case UDM_ISPELL_TYPE_SERVER:
+   Agent-Conf-ispell_mode = ~UDM_ISPELL_MODE_DB;
+   Agent-Conf-ispell_mode |=  UDM_ISPELL_MODE_SERVER;
+   
+   Agent-Conf-spellhost = strdup(val1);

break;
+   
+#endif
 
default:
php_error(E_WARNING,"Udm_Load_Ispell_Data: Unknown ispell type 
parameter");
@@ -702,7 +718,9 @@
}
ZEND_FETCH_RESOURCE(Agent, UDM_AGENT *, yyagent, -1, "mnoGoSearch-Agent", 
le_link);

-   /* UdmClearIspellData(Agent-Conf); */
+#if UDM_VERSION_ID  30111
+   UdmFreeIspell(Agent-Conf);
+#endif

RETURN_TRUE;
 }
Index: php4/ext/mnogosearch/test.php
diff -u php4/ext/mnogosearch/test.php:1.18 php4/ext/mnogosearch/test.php:1.19
--- php4/ext/mnogosearch/test.php:1.18  Thu Mar  1 06:51:11 2001
+++ php4/ext/mnogosearch/test.php   Fri Mar  2 03:41:34 2001
@@ -1,6 +1,6 @@
 !-- 
 $Source: /local/repository/php4/ext/mnogosearch/test.php,v $
-$Id: test.php,v 1.18 2001/03/01 14:51:11 gluke Exp $ 
+$Id: test.php,v 1.19 2001/03/02 11:41:34 gluke Exp $ 
 --
 
 html
@@ -59,10 +59,14 @@
 
 // if ((! 
Udm_Load_Ispell_Data($udm,UDM_ISPELL_TYPE_AFFIX,'en','/opt/udm/ispell/en.aff',0)) ||
 // (! 
Udm_Load_Ispell_Data($udm,UDM_ISPELL_TYPE_SPELL,'en','/opt/udm/ispell/en.dict',1))) {
-// printf("Error #%d: '%s'\n",Udm_Errno($udm),Udm_Error($udm));
+// printf("Error loading ispell data from filesbr\n");
 // exit;
 // }
 
+   if (! Udm_Load_Ispell_Data($udm,UDM_ISPELL_TYPE_SERVER,'','',1)) {
+   printf("Error loading ispell data from serverbr\n");
+   exit;
+   }
 
 // Stage 3: add search limits
 // Udm_Add_Search_Limit($udm,UDM_LIMIT_URL,"http://www.mydomain.com/%");



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-CVS] cvs: php4 /ext/mnogosearch test.php

2001-03-02 Thread Sergey Kartashoff

gluke   Fri Mar  2 03:43:26 2001 EDT

  Modified files:  
/php4/ext/mnogosearch   test.php 
  Log:
  # mnoGoSearch example fix
  
  
Index: php4/ext/mnogosearch/test.php
diff -u php4/ext/mnogosearch/test.php:1.19 php4/ext/mnogosearch/test.php:1.20
--- php4/ext/mnogosearch/test.php:1.19  Fri Mar  2 03:41:34 2001
+++ php4/ext/mnogosearch/test.php   Fri Mar  2 03:43:26 2001
@@ -1,6 +1,6 @@
 !-- 
 $Source: /local/repository/php4/ext/mnogosearch/test.php,v $
-$Id: test.php,v 1.19 2001/03/02 11:41:34 gluke Exp $ 
+$Id: test.php,v 1.20 2001/03/02 11:43:26 gluke Exp $ 
 --
 
 html
@@ -63,10 +63,10 @@
 // exit;
 // }
 
-   if (! Udm_Load_Ispell_Data($udm,UDM_ISPELL_TYPE_SERVER,'','',1)) {
-   printf("Error loading ispell data from serverbr\n");
-   exit;
-   }
+// if (! Udm_Load_Ispell_Data($udm,UDM_ISPELL_TYPE_SERVER,'','',1)) {
+// printf("Error loading ispell data from serverbr\n");
+// exit;
+// }
 
 // Stage 3: add search limits
 // Udm_Add_Search_Limit($udm,UDM_LIMIT_URL,"http://www.mydomain.com/%");



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-CVS] cvs: php4 /ext/mnogosearch README

2001-03-02 Thread Sergey Kartashoff

gluke   Fri Mar  2 04:14:20 2001 EDT

  Modified files:  
/php4/ext/mnogosearch   README 
  Log:
  # TODO updates in mnoGoSearch module README
  
  
Index: php4/ext/mnogosearch/README
diff -u php4/ext/mnogosearch/README:1.6 php4/ext/mnogosearch/README:1.7
--- php4/ext/mnogosearch/README:1.6 Thu Feb 22 05:02:37 2001
+++ php4/ext/mnogosearch/README Fri Mar  2 04:14:20 2001
@@ -1,5 +1,5 @@
 $Source: /local/repository/php4/ext/mnogosearch/README,v $
-$Id: README,v 1.6 2001/02/22 13:02:37 gluke Exp $
+$Id: README,v 1.7 2001/03/02 12:14:20 gluke Exp $
 
 mnoGoSearch extension module for PHP4.
 
@@ -13,8 +13,7 @@
   TODO
   
 
-1. Implement all mnoGoSearch functions and update module
-   accoding to the latest version of mnoGoSearch.
+1. Implement native ispell functions. 
 
-2. Test with more databases. Currently tested with MySQL.
-Actually it should work fine with other supported databases.
+2. Implement indexing functions of the library.
+   For example retrieving, parsing, checking of the URL and so on...



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-CVS] cvs: php4 /ext/mnogosearch php_mnogo.c

2001-03-01 Thread Sergey Kartashoff

gluke   Thu Mar  1 03:38:17 2001 EDT

  Modified files:  
/php4/ext/mnogosearch   php_mnogo.c 
  Log:
  Added UdmFreeEnv call to mnoGoSearch link list destructor to 
  free memory allocated for environment.
  
  
Index: php4/ext/mnogosearch/php_mnogo.c
diff -u php4/ext/mnogosearch/php_mnogo.c:1.18 php4/ext/mnogosearch/php_mnogo.c:1.19
--- php4/ext/mnogosearch/php_mnogo.c:1.18   Fri Feb 23 02:34:49 2001
+++ php4/ext/mnogosearch/php_mnogo.cThu Mar  1 03:38:17 2001
@@ -1,5 +1,5 @@
 /* $Source: /local/repository/php4/ext/mnogosearch/php_mnogo.c,v $ */
-/* $Id: php_mnogo.c,v 1.18 2001/02/23 10:34:49 gluke Exp $ */
+/* $Id: php_mnogo.c,v 1.19 2001/03/01 11:38:17 gluke Exp $ */
 
 /*
+--+
@@ -140,6 +140,7 @@
 
 static void _free_udm_agent(zend_rsrc_list_entry *rsrc){
UDM_AGENT * Agent = (UDM_AGENT *)rsrc-ptr;
+   UdmFreeEnv(Agent-Conf);
UdmFreeAgent(Agent);
 }
 
@@ -325,7 +326,7 @@
Env=UdmAllocEnv();  
UdmEnvSetDBAddr(Env,dbaddr);
UdmEnvSetDBMode(Env,dbmode);   
 
-   Agent=UdmAllocAgent(Env,0,UDM_OPEN_MODE_READ); 
 
+   Agent=UdmAllocAgent(Env,0,UDM_OPEN_MODE_READ);

ZEND_REGISTER_RESOURCE(return_value,Agent,le_link);
}



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-CVS] cvs: php4 /ext/mnogosearch php_mnogo.c php_mnogo.h test.php

2001-03-01 Thread Sergey Kartashoff

gluke   Thu Mar  1 05:26:25 2001 EDT

  Modified files:  
/php4/ext/mnogosearch   php_mnogo.c php_mnogo.h test.php 
  Log:
  Udm_Get_Doc_Count function from mnoGoSearch 3.1.11 has been added.
  mnoGoSearch library version printing in phpinfo() has been added.
  Example updated.
  
  
Index: php4/ext/mnogosearch/php_mnogo.c
diff -u php4/ext/mnogosearch/php_mnogo.c:1.19 php4/ext/mnogosearch/php_mnogo.c:1.20
--- php4/ext/mnogosearch/php_mnogo.c:1.19   Thu Mar  1 03:38:17 2001
+++ php4/ext/mnogosearch/php_mnogo.cThu Mar  1 05:26:25 2001
@@ -1,5 +1,5 @@
 /* $Source: /local/repository/php4/ext/mnogosearch/php_mnogo.c,v $ */
-/* $Id: php_mnogo.c,v 1.19 2001/03/01 11:38:17 gluke Exp $ */
+/* $Id: php_mnogo.c,v 1.20 2001/03/01 13:26:25 gluke Exp $ */
 
 /*
+--+
@@ -117,6 +117,10 @@

PHP_FE(udm_free_res,NULL)
PHP_FE(udm_free_agent,  NULL)
+
+#if UDM_VERSION_ID  30110
+   PHP_FE(udm_get_doc_count,   NULL)
+#endif

{NULL, NULL, NULL}
 };
@@ -275,8 +279,13 @@
 
 DLEXPORT PHP_MINFO_FUNCTION(mnogosearch)
 {
+   char buf[32];
+   
php_info_print_table_start();
php_info_print_table_row(2, "mnoGoSearch Support", "enabled" );
+   
+   sprintf(buf,"%d", UDM_VERSION_ID);
+   php_info_print_table_row(2, "mnoGoSearch library version", buf );
php_info_print_table_end();
 }
 
@@ -1033,6 +1042,33 @@
RETURN_STRING(UdmDBErrorMsg(Agent-db),1);
 }
 /* }}} */
+
+
+#if UDM_VERSION_ID  30110
+/* {{{ proto int udm_get_doc_count(int agent)
+   Get total number of documents in database */
+DLEXPORT PHP_FUNCTION(udm_get_doc_count)
+{
+   pval ** yyagent;
+   UDM_AGENT * Agent;
+   int id=-1;
+
+   switch(ZEND_NUM_ARGS()){
+   case 1: {
+   if (zend_get_parameters_ex(1, yyagent)==FAILURE) {
+   RETURN_FALSE;
+   }
+   }
+   break;
+   default:
+   WRONG_PARAM_COUNT;
+   break;
+   }
+   ZEND_FETCH_RESOURCE(Agent, UDM_AGENT *, yyagent, id, "mnoGoSearch-Agent", 
+le_link);
+   RETURN_LONG(UdmGetDocCount(Agent));
+}
+/* }}} */
+#endif
 
 
 #endif
Index: php4/ext/mnogosearch/php_mnogo.h
diff -u php4/ext/mnogosearch/php_mnogo.h:1.6 php4/ext/mnogosearch/php_mnogo.h:1.7
--- php4/ext/mnogosearch/php_mnogo.h:1.6Fri Feb 23 02:34:49 2001
+++ php4/ext/mnogosearch/php_mnogo.hThu Mar  1 05:26:25 2001
@@ -1,5 +1,5 @@
 /* $Source: /local/repository/php4/ext/mnogosearch/php_mnogo.h,v $ */
-/* $Id: php_mnogo.h,v 1.6 2001/02/23 10:34:49 gluke Exp $ */
+/* $Id: php_mnogo.h,v 1.7 2001/03/01 13:26:25 gluke Exp $ */
 
 /* 
+--+
@@ -27,6 +27,9 @@
 
 #if HAVE_MNOGOSEARCH
 
+#include udm_config.h
+#include udmsearch.h
+
 extern zend_module_entry mnogosearch_module_entry;
 #define mnogosearch_module_ptr mnogosearch_module_entry
 
@@ -64,6 +67,10 @@
 
 DLEXPORT PHP_FUNCTION(udm_free_res);
 DLEXPORT PHP_FUNCTION(udm_free_agent);
+
+#if UDM_VERSION_ID  30110
+DLEXPORT PHP_FUNCTION(udm_get_doc_count);
+#endif
 
 #else
 
Index: php4/ext/mnogosearch/test.php
diff -u php4/ext/mnogosearch/test.php:1.14 php4/ext/mnogosearch/test.php:1.15
--- php4/ext/mnogosearch/test.php:1.14  Fri Feb 23 02:53:06 2001
+++ php4/ext/mnogosearch/test.php   Thu Mar  1 05:26:25 2001
@@ -1,6 +1,6 @@
 !-- 
 $Source: /local/repository/php4/ext/mnogosearch/test.php,v $
-$Id: test.php,v 1.14 2001/02/23 10:53:06 gluke Exp $ 
+$Id: test.php,v 1.15 2001/03/01 13:26:25 gluke Exp $ 
 --
 
 html
@@ -23,6 +23,8 @@
 // DBMode is optional, "single" by default
 
$udm=Udm_Alloc_Agent("mysql://udm:udm@localhost/udm/",'single');
+   
+   print  "Total number of urls in database: ".Udm_Get_Doc_Count($udm)."br\n";

 // Stage 2: set search parameters
 



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-CVS] cvs: php4 / NEWS

2001-03-01 Thread Sergey Kartashoff

gluke   Thu Mar  1 05:44:05 2001 EDT

  Modified files:  
/php4   NEWS 
  Log:
  # Corrected NEWS entry about mnoGoSearch extension.
  
  
Index: php4/NEWS
diff -u php4/NEWS:1.600 php4/NEWS:1.601
--- php4/NEWS:1.600 Mon Feb 26 07:20:53 2001
+++ php4/NEWS   Thu Mar  1 05:44:04 2001
@@ -48,8 +48,7 @@
 - Major change of the php pdf api. It could break some functions though
   backwards compatibility was tried to maintain. Adding some still
   missing functions as well. (Uwe)
-- Added mnoGoSearch extension. (Sergey K)
-  This module currently at the alpha state, but it can be used already.
+- Added mnoGoSearch extension - http://search.mnogo.ru (Sergey K)
 - Allow url encoding in DB usernames and passwords (Stig, PEAR)
 - Added raiseError and setErrorHandling methods to PEAR class (Stig, PEAR)
 - Added support for converting images from JPG/PNG on the fly with the GD



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-CVS] cvs: php4 /ext/mnogosearch test.php

2001-03-01 Thread Sergey Kartashoff

gluke   Thu Mar  1 06:18:06 2001 EDT

  Modified files:  
/php4/ext/mnogosearch   test.php 
  Log:
  # mnoGoSearch example updated.
  
  
Index: php4/ext/mnogosearch/test.php
diff -u php4/ext/mnogosearch/test.php:1.16 php4/ext/mnogosearch/test.php:1.17
--- php4/ext/mnogosearch/test.php:1.16  Thu Mar  1 05:38:38 2001
+++ php4/ext/mnogosearch/test.php   Thu Mar  1 06:18:06 2001
@@ -1,14 +1,11 @@
 !-- 
 $Source: /local/repository/php4/ext/mnogosearch/test.php,v $
-$Id: test.php,v 1.16 2001/03/01 13:38:38 gluke Exp $ 
+$Id: test.php,v 1.17 2001/03/01 14:18:06 gluke Exp $ 
 --
 
 html
 body
 
-mnoGoSearch API version: ? echo Udm_Api_Version(); ?
-br
-
 form method=post
 input type=text size=30 name=q value="? echo htmlspecialchars(stripslashes($q)); 
?"
 input type=submit value=" Search ! "
@@ -27,7 +24,9 @@
 
$udm=Udm_Alloc_Agent("mysql://udm:udm@localhost/udm/",'single');

-   print  "Total number of urls in database: ".Udm_Get_Doc_Count($udm)."br\n";
+   if (Udm_Api_Version() = 30111) {
+   print  "Total number of urls in database: 
+".Udm_Get_Doc_Count($udm)."br\n";
+   }

 // Stage 2: set search parameters
 



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-CVS] cvs: php4 /ext/mnogosearch php_mnogo.c test.php

2001-03-01 Thread Sergey Kartashoff

gluke   Thu Mar  1 06:51:11 2001 EDT

  Modified files:  
/php4/ext/mnogosearch   php_mnogo.c test.php 
  Log:
  UDM_PARAM_CROSS_WORDS mnoGoSearch extension session parameter has been
  added to use crosswords available since version 3.1.11 of mnogosearch.
  Example updated.
  
  
Index: php4/ext/mnogosearch/php_mnogo.c
diff -u php4/ext/mnogosearch/php_mnogo.c:1.21 php4/ext/mnogosearch/php_mnogo.c:1.22
--- php4/ext/mnogosearch/php_mnogo.c:1.21   Thu Mar  1 05:38:38 2001
+++ php4/ext/mnogosearch/php_mnogo.cThu Mar  1 06:51:11 2001
@@ -1,5 +1,5 @@
 /* $Source: /local/repository/php4/ext/mnogosearch/php_mnogo.c,v $ */
-/* $Id: php_mnogo.c,v 1.21 2001/03/01 13:38:38 gluke Exp $ */
+/* $Id: php_mnogo.c,v 1.22 2001/03/01 14:51:11 gluke Exp $ */
 
 /*
+--+
@@ -58,6 +58,7 @@
 #define UDM_PARAM_MIN_WORD_LEN 12
 #define UDM_PARAM_MAX_WORD_LEN 13
 #define UDM_PARAM_ISPELL_PREFIXES  14
+#define UDM_PARAM_CROSS_WORDS  15
 
 /* udm_add_search_limit constants */
 #define UDM_LIMIT_URL  1
@@ -78,6 +79,10 @@
 #define UDM_PREFIXES_ENABLED   1
 #define UDM_PREFIXES_DISABLED  0
 
+/* crosswords modes */
+#define UDM_CROSS_WORDS_ENABLED 1
+#define UDM_CROSS_WORDS_DISABLED 0
+
 /* udm_get_res_param constants */
 #define UDM_PARAM_NUM_ROWS 256
 #define UDM_PARAM_FOUND257
@@ -205,6 +210,9 @@
REGISTER_LONG_CONSTANT("UDM_PARAM_PREFIXES",
UDM_PARAM_ISPELL_PREFIXES,CONST_CS | CONST_PERSISTENT); 
REGISTER_LONG_CONSTANT("UDM_PARAM_PREFIX",  
UDM_PARAM_ISPELL_PREFIXES,CONST_CS | CONST_PERSISTENT);

+   REGISTER_LONG_CONSTANT("UDM_PARAM_CROSS_WORDS", UDM_PARAM_CROSS_WORDS,CONST_CS 
+| CONST_PERSISTENT);
+   REGISTER_LONG_CONSTANT("UDM_PARAM_CROSSWORDS",  UDM_PARAM_CROSS_WORDS,CONST_CS 
+| CONST_PERSISTENT); 
+   
/* udm_add_search_limit constants */
REGISTER_LONG_CONSTANT("UDM_LIMIT_CAT", UDM_LIMIT_CAT,CONST_CS | 
CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_LIMIT_URL", UDM_LIMIT_URL,CONST_CS | 
CONST_PERSISTENT);
@@ -240,6 +248,12 @@
REGISTER_LONG_CONSTANT("UDM_PHRASE_ENABLED",UDM_PHRASE_ENABLED,CONST_CS | 
CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_PHRASE_DISABLED",   UDM_PHRASE_DISABLED,CONST_CS | 
CONST_PERSISTENT);

+   /* crosswords mode params */
+   
+REGISTER_LONG_CONSTANT("UDM_CROSS_WORDS_ENABLED",UDM_CROSS_WORDS_ENABLED,CONST_CS | 
+CONST_PERSISTENT);
+   
+REGISTER_LONG_CONSTANT("UDM_CROSSWORDS_ENABLED",UDM_CROSS_WORDS_ENABLED,CONST_CS | 
+CONST_PERSISTENT);   
+   
+REGISTER_LONG_CONSTANT("UDM_CROSS_WORDS_DISABLED",UDM_CROSS_WORDS_DISABLED,CONST_CS | 
+CONST_PERSISTENT);
+   
+REGISTER_LONG_CONSTANT("UDM_CROSSWORDS_DISABLED",UDM_CROSS_WORDS_DISABLED,CONST_CS | 
+CONST_PERSISTENT);
+   
/* prefixes mode params */
REGISTER_LONG_CONSTANT("UDM_PREFIXES_ENABLED",  UDM_PREFIXES_ENABLED,CONST_CS 
| CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_PREFIX_ENABLED",UDM_PREFIXES_ENABLED,CONST_CS 
| CONST_PERSISTENT);
@@ -551,6 +565,28 @@
Agent-Conf-max_word_len=atoi(val);

break;
+   
+#if UDM_VERSION_ID  30110
+
+   case UDM_PARAM_CROSS_WORDS: 
+   switch (atoi(val)){
+   case UDM_CROSS_WORDS_ENABLED:
+   
+Agent-Conf-use_crossword=UDM_CROSS_WORDS_ENABLED;
+   break;
+   
+   case UDM_CROSS_WORDS_DISABLED:
+   
+Agent-Conf-use_crossword=UDM_CROSS_WORDS_DISABLED;
+   break;
+   
+   default:
+   php_error(E_WARNING,"Udm_Set_Agent_Param: 
+Unknown crosswords mode");
+   RETURN_FALSE;
+   break;
+   }
+   
+   break;
+   
+#endif

default:
php_error(E_WARNING,"Udm_Set_Agent_Param: Unknown agent 
session parameter");
Index: php4/ext/mnogosearch/test.php
diff -u php4/ext/mnogosearch/test.php:1.17 php4/ext/mnogosearch/test.php:1.18
--- php4/ext/mnogosearch/test.php:1.17  Thu Mar  1 06:18:06 2001
+++ php4/ext/mnogosearch/test.php   Thu Mar  1 06:51:11 2001
@@ -1,6 +1,6 @@
 !-- 
 $Source: /local/repository/php4/ext/mnogosearch/test.php,v $
-$Id: test.php,v 1.17 2001/03/01 14:18:06 gluke Exp $ 
+$Id: test.php,v 1.18 2001/03/01 14:51:11 gluke Exp $ 
 --
 
 html
@@ -47,6 +47,10 @@

[PHP-CVS] cvs: php4 /ext/mnogosearch php_mnogo.c php_mnogo.h

2001-02-23 Thread Sergey Kartashoff

gluke   Fri Feb 23 02:34:49 2001 EDT

  Modified files:  
/php4/ext/mnogosearch   php_mnogo.c php_mnogo.h 
  Log:
  Added ispell loading routines and date search limits in mnogosearch module.
  
  

Index: php4/ext/mnogosearch/php_mnogo.c
diff -u php4/ext/mnogosearch/php_mnogo.c:1.17 php4/ext/mnogosearch/php_mnogo.c:1.18
--- php4/ext/mnogosearch/php_mnogo.c:1.17   Thu Feb 22 02:40:43 2001
+++ php4/ext/mnogosearch/php_mnogo.cFri Feb 23 02:34:49 2001
@@ -1,5 +1,5 @@
 /* $Source: /local/repository/php4/ext/mnogosearch/php_mnogo.c,v $ */
-/* $Id: php_mnogo.c,v 1.17 2001/02/22 10:40:43 gluke Exp $ */
+/* $Id: php_mnogo.c,v 1.18 2001/02/23 10:34:49 gluke Exp $ */
 
 /*
+--+
@@ -44,26 +44,27 @@
 #define UDM_FIELD_CRC  12
 
 /* udm_set_agent_param constants */
-#define UDM_PARAM_PAGE_SIZE1
-#define UDM_PARAM_PAGE_NUM 2
-#define UDM_PARAM_SEARCH_MODE  3
-#define UDM_PARAM_CACHE_MODE   4
-#define UDM_PARAM_TRACK_MODE   5
-#define UDM_PARAM_CHARSET  6
-#define UDM_PARAM_STOPTABLE7
-#define UDM_PARAM_STOPFILE 8
-#define UDM_PARAM_WEIGHT_FACTOR9
-#define UDM_PARAM_WORD_MATCH   10
-#define UDM_PARAM_PHRASE_MODE  11
-#define UDM_PARAM_MIN_WORD_LEN 12
-#define UDM_PARAM_MAX_WORD_LEN 13
-#define UDM_PARAM_ISPELL_MODE  14
+#define UDM_PARAM_PAGE_SIZE1
+#define UDM_PARAM_PAGE_NUM 2
+#define UDM_PARAM_SEARCH_MODE  3
+#define UDM_PARAM_CACHE_MODE   4
+#define UDM_PARAM_TRACK_MODE   5
+#define UDM_PARAM_CHARSET  6
+#define UDM_PARAM_STOPTABLE7
+#define UDM_PARAM_STOPFILE 8
+#define UDM_PARAM_WEIGHT_FACTOR9
+#define UDM_PARAM_WORD_MATCH   10
+#define UDM_PARAM_PHRASE_MODE  11
+#define UDM_PARAM_MIN_WORD_LEN 12
+#define UDM_PARAM_MAX_WORD_LEN 13
+#define UDM_PARAM_ISPELL_PREFIXES  14
 
 /* udm_add_search_limit constants */
 #define UDM_LIMIT_URL  1
 #define UDM_LIMIT_TAG  2
 #define UDM_LIMIT_LANG 3
 #define UDM_LIMIT_CAT  4
+#define UDM_LIMIT_DATE 5
 
 /* track modes */
 #define UDM_TRACK_ENABLED  1
@@ -73,6 +74,10 @@
 #define UDM_PHRASE_ENABLED 1
 #define UDM_PHRASE_DISABLED0
 
+/* prefix modes */
+#define UDM_PREFIXES_ENABLED   1
+#define UDM_PREFIXES_DISABLED  0
+
 /* udm_get_res_param constants */
 #define UDM_PARAM_NUM_ROWS 256
 #define UDM_PARAM_FOUND257
@@ -81,6 +86,12 @@
 #define UDM_PARAM_FIRST_DOC260
 #define UDM_PARAM_LAST_DOC 261
 
+/* udm_load_ispell_data constants */
+#define UDM_ISPELL_TYPE_AFFIX  1
+#define UDM_ISPELL_TYPE_SPELL  2
+#define UDM_ISPELL_TYPE_DB 3
+#define UDM_ISPELL_TYPE_SERVER 4
+
 /* True globals, no need for thread safety */
 static int le_link,le_res;
 
@@ -91,6 +102,9 @@
PHP_FE(udm_alloc_agent, NULL)
PHP_FE(udm_set_agent_param, NULL)

+   PHP_FE(udm_load_ispell_data,NULL)
+   PHP_FE(udm_free_ispell_data,NULL)
+   
PHP_FE(udm_add_search_limit,NULL)
PHP_FE(udm_clear_search_limits, NULL)

@@ -158,28 +172,38 @@
/* udm_set_agent_param constants */
REGISTER_LONG_CONSTANT("UDM_PARAM_PAGE_SIZE",   UDM_PARAM_PAGE_SIZE,CONST_CS | 
CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_PARAM_PAGE_NUM",UDM_PARAM_PAGE_NUM,CONST_CS | 
CONST_PERSISTENT);
+   
REGISTER_LONG_CONSTANT("UDM_PARAM_SEARCH_MODE", UDM_PARAM_SEARCH_MODE,CONST_CS 
| CONST_PERSISTENT); 
REGISTER_LONG_CONSTANT("UDM_PARAM_CACHE_MODE",  UDM_PARAM_CACHE_MODE,CONST_CS 
| CONST_PERSISTENT);  
REGISTER_LONG_CONSTANT("UDM_PARAM_TRACK_MODE",  UDM_PARAM_TRACK_MODE,CONST_CS 
| CONST_PERSISTENT);  
+   REGISTER_LONG_CONSTANT("UDM_PARAM_PHRASE_MODE", UDM_PARAM_PHRASE_MODE,CONST_CS 
+| CONST_PERSISTENT); 
+   
REGISTER_LONG_CONSTANT("UDM_PARAM_CHARSET", UDM_PARAM_CHARSET,CONST_CS | 
CONST_PERSISTENT); 
+   
REGISTER_LONG_CONSTANT("UDM_PARAM_STOPTABLE",   UDM_PARAM_STOPTABLE,CONST_CS | 
CONST_PERSISTENT);   
REGISTER_LONG_CONSTANT("UDM_PARAM_STOP_TABLE",  UDM_PARAM_STOPTABLE,CONST_CS | 
CONST_PERSISTENT);   
REGISTER_LONG_CONSTANT("UDM_PARAM_STOPFILE",UDM_PARAM_STOPFILE,CONST_CS | 
CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_PARAM_STOP_FILE",   UDM_PARAM_STOPFILE,CONST_CS | 
CONST_PERSISTENT);
+   

REGISTER_LONG_CONSTANT("UDM_PARAM_WEIGHT_FACTOR",UDM_PARAM_WEIGHT_FACTOR,CONST_CS | 
CONST_PERSISTENT);
-   REGISTER_LONG_CONSTANT("UDM_PARAM_WORD_MATCH",  UDM_PARAM_WORD_MATCH,CONST_CS 
| CONST_PERSISTENT);
-   REGISTER_LONG_CONSTANT("UDM_PARAM_PHRASE_MODE", UDM_PARAM_PHRASE_MODE,CONST_CS 
| CONST_PERSISTENT); 
+   REGISTER_LONG_CONSTANT("UDM_PARAM_WORD_MATCH",  UDM_PARAM_WORD_MATCH,CONST_CS 
+| CONST_PERSISTENT);  
+   


[PHP-CVS] cvs: php4 /ext/mnogosearch test.php

2001-02-23 Thread Sergey Kartashoff

gluke   Fri Feb 23 02:53:06 2001 EDT

  Modified files:  
/php4/ext/mnogosearch   test.php 
  Log:
  mnogosearch example updated.
  
  
Index: php4/ext/mnogosearch/test.php
diff -u php4/ext/mnogosearch/test.php:1.13 php4/ext/mnogosearch/test.php:1.14
--- php4/ext/mnogosearch/test.php:1.13  Thu Feb 22 02:40:43 2001
+++ php4/ext/mnogosearch/test.php   Fri Feb 23 02:53:06 2001
@@ -1,6 +1,6 @@
 !-- 
 $Source: /local/repository/php4/ext/mnogosearch/test.php,v $
-$Id: test.php,v 1.13 2001/02/22 10:40:43 gluke Exp $ 
+$Id: test.php,v 1.14 2001/02/23 10:53:06 gluke Exp $ 
 --
 
 html
@@ -22,7 +22,7 @@
 // Stage 1: allocate UdmSearch agent, set DBAddr and DBMode
 // DBMode is optional, "single" by default
 
-   $udm=Udm_Alloc_Agent("mysql://udm:udm@localhost/udm/",'crc-multi');
+   $udm=Udm_Alloc_Agent("mysql://udm:udm@localhost/udm/",'single');

 // Stage 2: set search parameters
 
@@ -38,21 +38,30 @@
 // Udm_Set_Agent_Param($udm,UDM_PARAM_STOPTABLE,"stopword");
 // Udm_Set_Agent_Param($udm,UDM_PARAM_STOPFILE,"stop.txt");
Udm_Set_Agent_Param($udm,UDM_PARAM_WEIGHT_FACTOR,"F9421");
-   Udm_Set_Agent_Param($udm,UDM_PARAM_WORD_MATCH,UDM_MATCH_SUBSTR);
+   Udm_Set_Agent_Param($udm,UDM_PARAM_WORD_MATCH,UDM_MATCH_WORD);
Udm_Set_Agent_Param($udm,UDM_PARAM_PHRASE_MODE,UDM_PHRASE_DISABLED);
Udm_Set_Agent_Param($udm,UDM_PARAM_MIN_WORD_LEN,2);
-   Udm_Set_Agent_Param($udm,UDM_PARAM_MAX_WORD_LEN,5);
-   
-   if (!Udm_Set_Agent_Param($udm,UDM_PARAM_ISPELL_MODE,UDM_ISPELL_MODE_DB)) {
-   printf("Error #%d: '%s'\n",$errno,Udm_Error($udm));
-   exit;
-   }
+   Udm_Set_Agent_Param($udm,UDM_PARAM_MAX_WORD_LEN,16);
+   Udm_Set_Agent_Param($udm,UDM_PARAM_PREFIX,UDM_PREFIX_DISABLED);
 
+// if (! Udm_Load_Ispell_Data($udm,UDM_ISPELL_TYPE_DB,'','',1)) {
+// printf("Error #%d: '%s'\n",Udm_Errno($udm),Udm_Error($udm));
+// exit;
+// }
+
+// if ((! 
+Udm_Load_Ispell_Data($udm,UDM_ISPELL_TYPE_AFFIX,'en','/opt/udm/ispell/en.aff',0)) ||
+// (! 
+Udm_Load_Ispell_Data($udm,UDM_ISPELL_TYPE_SPELL,'en','/opt/udm/ispell/en.dict',1))) {
+// printf("Error #%d: '%s'\n",Udm_Errno($udm),Udm_Error($udm));
+// exit;
+// }
+
+
 // Stage 3: add search limits
 // Udm_Add_Search_Limit($udm,UDM_LIMIT_URL,"http://www.mydomain.com/%");
 // Udm_Add_Search_Limit($udm,UDM_LIMIT_TAG,"01");
 // Udm_Add_Search_Limit($udm,UDM_LIMIT_CAT,"01");
 // Udm_Add_Search_Limit($udm,UDM_LIMIT_LANG,"en");
+// Udm_Add_Search_Limit($udm,UDM_LIMIT_DATE,"908012006");
 
 //  Udm_Clear_Search_Limits($udm);

@@ -79,8 +88,8 @@
 
printf("Searchtime: ".$searchtime."\n\n");
 
-   printf("Documents %d(%d)-%d(%d) from %d total found; %s\n\n",
-   $first,$first_doc,$first+$rows-1,$last_doc,$total,$wordinfo);
+   printf("Documents %d-%d from %d total found; %s\n\n",
+   $first_doc,$last_doc,$total,$wordinfo);
 
// Fetch all rows
for($i=0;$i$rows;$i++){
@@ -102,8 +111,11 @@
// Free result
Udm_Free_Res($res);
}
+
+//Stage 6: free ispell data if loaded before
+// Udm_Free_Ispell_Data($udm);
 
-//Stage 6: free UdmSearch agent
+//Stage 7: free UdmSearch agent
 
Udm_Free_Agent($udm);
 ?



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-CVS] cvs: php4 /ext/mnogosearch php_mnogo.c test.php

2001-02-20 Thread Sergey Kartashoff

gluke   Tue Feb 20 03:29:15 2001 EDT

  Modified files:  
/php4/ext/mnogosearch   php_mnogo.c test.php 
  Log:
  Phrase search support has been added to mnogosearch extenstion. 
  Min_word_len and Max_word_len support has been added to mnogosearch
  extension. Example updated.
  
  
Index: php4/ext/mnogosearch/php_mnogo.c
diff -u php4/ext/mnogosearch/php_mnogo.c:1.15 php4/ext/mnogosearch/php_mnogo.c:1.16
--- php4/ext/mnogosearch/php_mnogo.c:1.15   Thu Feb 15 03:50:48 2001
+++ php4/ext/mnogosearch/php_mnogo.cTue Feb 20 03:29:15 2001
@@ -1,5 +1,5 @@
 /* $Source: /local/repository/php4/ext/mnogosearch/php_mnogo.c,v $ */
-/* $Id: php_mnogo.c,v 1.15 2001/02/15 11:50:48 gluke Exp $ */
+/* $Id: php_mnogo.c,v 1.16 2001/02/20 11:29:15 gluke Exp $ */
 
 /*
+--+
@@ -54,6 +54,9 @@
 #define UDM_PARAM_STOPFILE 8
 #define UDM_PARAM_WEIGHT_FACTOR9
 #define UDM_PARAM_WORD_MATCH   10
+#define UDM_PARAM_PHRASE_MODE  11
+#define UDM_PARAM_MIN_WORD_LEN 12
+#define UDM_PARAM_MAX_WORD_LEN 13
 
 /* udm_add_search_limit constants */
 #define UDM_LIMIT_URL  1
@@ -65,6 +68,10 @@
 #define UDM_TRACK_ENABLED  1
 #define UDM_TRACK_DISABLED 0
 
+/* phrase modes */
+#define UDM_PHRASE_ENABLED 1
+#define UDM_PHRASE_DISABLED0
+
 /* udm_get_res_param constants */
 #define UDM_PARAM_NUM_ROWS 256
 #define UDM_PARAM_FOUND257
@@ -160,6 +167,11 @@
REGISTER_LONG_CONSTANT("UDM_PARAM_STOP_FILE",   UDM_PARAM_STOPFILE,CONST_CS | 
CONST_PERSISTENT);

REGISTER_LONG_CONSTANT("UDM_PARAM_WEIGHT_FACTOR",UDM_PARAM_WEIGHT_FACTOR,CONST_CS | 
CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_PARAM_WORD_MATCH",  UDM_PARAM_WORD_MATCH,CONST_CS 
| CONST_PERSISTENT);
+   REGISTER_LONG_CONSTANT("UDM_PARAM_PHRASE_MODE", UDM_PARAM_PHRASE_MODE,CONST_CS 
+| CONST_PERSISTENT); 
+   
+REGISTER_LONG_CONSTANT("UDM_PARAM_MAX_WORD_LEN",UDM_PARAM_MAX_WORD_LEN,CONST_CS | 
+CONST_PERSISTENT);
+   REGISTER_LONG_CONSTANT("UDM_PARAM_MAX_WORDLEN",UDM_PARAM_MAX_WORD_LEN,CONST_CS 
+| CONST_PERSISTENT); 
+   
+REGISTER_LONG_CONSTANT("UDM_PARAM_MIN_WORD_LEN",UDM_PARAM_MIN_WORD_LEN,CONST_CS | 
+CONST_PERSISTENT);
+   REGISTER_LONG_CONSTANT("UDM_PARAM_MIN_WORDLEN",UDM_PARAM_MIN_WORD_LEN,CONST_CS 
+| CONST_PERSISTENT); 

/* udm_add_search_limit constants */
REGISTER_LONG_CONSTANT("UDM_LIMIT_CAT", UDM_LIMIT_CAT,CONST_CS | 
CONST_PERSISTENT);
@@ -181,6 +193,7 @@
REGISTER_LONG_CONSTANT("UDM_MODE_ALL",  UDM_MODE_ALL,CONST_CS | 
CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_MODE_ANY",  UDM_MODE_ANY,CONST_CS | 
CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_MODE_BOOL", UDM_MODE_BOOL,CONST_CS | 
CONST_PERSISTENT);
+   REGISTER_LONG_CONSTANT("UDM_MODE_PHRASE",   UDM_MODE_PHRASE,CONST_CS | 
+CONST_PERSISTENT);
 
/* search cache params */
REGISTER_LONG_CONSTANT("UDM_CACHE_ENABLED", UDM_CACHE_ENABLED,CONST_CS | 
CONST_PERSISTENT);
@@ -190,6 +203,10 @@
REGISTER_LONG_CONSTANT("UDM_TRACK_ENABLED", UDM_TRACK_ENABLED,CONST_CS | 
CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_TRACK_DISABLED",UDM_TRACK_DISABLED,CONST_CS | 
CONST_PERSISTENT);

+   /* phrase mode params */
+   REGISTER_LONG_CONSTANT("UDM_PHRASE_ENABLED",UDM_PHRASE_ENABLED,CONST_CS | 
+CONST_PERSISTENT);
+   REGISTER_LONG_CONSTANT("UDM_PHRASE_DISABLED",   UDM_PHRASE_DISABLED,CONST_CS | 
+CONST_PERSISTENT);
+   
/* word match mode params */
REGISTER_LONG_CONSTANT("UDM_MATCH_WORD",UDM_MATCH_WORD,CONST_CS | 
CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_MATCH_BEGIN",   UDM_MATCH_BEGIN,CONST_CS | 
CONST_PERSISTENT);
@@ -333,6 +350,10 @@
case UDM_MODE_BOOL: 
Agent-search_mode=UDM_MODE_BOOL;
break;
+
+   case UDM_MODE_PHRASE: 
+   Agent-search_mode=UDM_MODE_PHRASE;
+   break;

default:

php_error(E_WARNING,"Udm_Set_Agent_Param: Unknown search mode");
@@ -404,7 +425,25 @@
}

break;
+   
+   case UDM_PARAM_PHRASE_MODE: 
+   switch (atoi(val)){
+   case UDM_PHRASE_ENABLED:
+   Agent-Conf-use_phrases=UDM_PHRASE_ENABLED;
+   break;
+   
+   case UDM_PHRASE_DISABLED:
+ 

[PHP-CVS] cvs: php4 /ext/mnogosearch php_mnogo.c test.php

2001-02-15 Thread Sergey Kartashoff

gluke   Thu Feb 15 03:50:49 2001 EDT

  Modified files:  
/php4/ext/mnogosearch   php_mnogo.c test.php 
  Log:
  Added thow new mnoGoSearch agent session parameters:
  UDM_PARAM_WEIGHT_FACTOR and UDM_PARAM_WORD_MATCH.
  
  
Index: php4/ext/mnogosearch/php_mnogo.c
diff -u php4/ext/mnogosearch/php_mnogo.c:1.14 php4/ext/mnogosearch/php_mnogo.c:1.15
--- php4/ext/mnogosearch/php_mnogo.c:1.14   Wed Feb 14 06:27:45 2001
+++ php4/ext/mnogosearch/php_mnogo.cThu Feb 15 03:50:48 2001
@@ -1,5 +1,5 @@
 /* $Source: /local/repository/php4/ext/mnogosearch/php_mnogo.c,v $ */
-/* $Id: php_mnogo.c,v 1.14 2001/02/14 14:27:45 gluke Exp $ */
+/* $Id: php_mnogo.c,v 1.15 2001/02/15 11:50:48 gluke Exp $ */
 
 /*
+--+
@@ -52,6 +52,8 @@
 #define UDM_PARAM_CHARSET  6
 #define UDM_PARAM_STOPTABLE7
 #define UDM_PARAM_STOPFILE 8
+#define UDM_PARAM_WEIGHT_FACTOR9
+#define UDM_PARAM_WORD_MATCH   10
 
 /* udm_add_search_limit constants */
 #define UDM_LIMIT_URL  1
@@ -59,6 +61,7 @@
 #define UDM_LIMIT_LANG 3
 #define UDM_LIMIT_CAT  4
 
+/* track modes */
 #define UDM_TRACK_ENABLED  1
 #define UDM_TRACK_DISABLED 0
 
@@ -155,6 +158,8 @@
REGISTER_LONG_CONSTANT("UDM_PARAM_STOP_TABLE",  UDM_PARAM_STOPTABLE,CONST_CS | 
CONST_PERSISTENT);   
REGISTER_LONG_CONSTANT("UDM_PARAM_STOPFILE",UDM_PARAM_STOPFILE,CONST_CS | 
CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_PARAM_STOP_FILE",   UDM_PARAM_STOPFILE,CONST_CS | 
CONST_PERSISTENT);
+   
+REGISTER_LONG_CONSTANT("UDM_PARAM_WEIGHT_FACTOR",UDM_PARAM_WEIGHT_FACTOR,CONST_CS | 
+CONST_PERSISTENT);
+   REGISTER_LONG_CONSTANT("UDM_PARAM_WORD_MATCH",  UDM_PARAM_WORD_MATCH,CONST_CS 
+| CONST_PERSISTENT);

/* udm_add_search_limit constants */
REGISTER_LONG_CONSTANT("UDM_LIMIT_CAT", UDM_LIMIT_CAT,CONST_CS | 
CONST_PERSISTENT);
@@ -184,6 +189,12 @@
/* track mode params */
REGISTER_LONG_CONSTANT("UDM_TRACK_ENABLED", UDM_TRACK_ENABLED,CONST_CS | 
CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_TRACK_DISABLED",UDM_TRACK_DISABLED,CONST_CS | 
CONST_PERSISTENT);
+   
+   /* word match mode params */
+   REGISTER_LONG_CONSTANT("UDM_MATCH_WORD",UDM_MATCH_WORD,CONST_CS | 
+CONST_PERSISTENT);
+   REGISTER_LONG_CONSTANT("UDM_MATCH_BEGIN",   UDM_MATCH_BEGIN,CONST_CS | 
+CONST_PERSISTENT);
+   REGISTER_LONG_CONSTANT("UDM_MATCH_SUBSTR",  UDM_MATCH_SUBSTR,CONST_CS | 
+CONST_PERSISTENT);
+   REGISTER_LONG_CONSTANT("UDM_MATCH_END", UDM_MATCH_END,CONST_CS | 
+CONST_PERSISTENT);
 
return SUCCESS;
 }
@@ -330,7 +341,33 @@
}

break;
+
+   case UDM_PARAM_WORD_MATCH:
+   switch (atoi(val)){
+   case UDM_MATCH_WORD:
+   Agent-word_match=UDM_MATCH_WORD;
+   break;
+
+   case UDM_MATCH_BEGIN:
+   Agent-word_match=UDM_MATCH_BEGIN;
+   break;
+
+   case UDM_MATCH_END:
+   Agent-word_match=UDM_MATCH_END;
+   break;
+
+   case UDM_MATCH_SUBSTR:
+   Agent-word_match=UDM_MATCH_SUBSTR;
+   break;
+   
+   default:
+   
+php_error(E_WARNING,"Udm_Set_Agent_Param: Unknown word match mode");
+   RETURN_FALSE;
+   break;
+   }

+   break;
+   
case UDM_PARAM_CACHE_MODE: 
switch (atoi(val)){
case UDM_CACHE_ENABLED:
@@ -385,6 +422,11 @@
php_error(E_WARNING,Agent-Conf-errstr);
RETURN_FALSE;
}
+   
+   break;
+   
+   case UDM_PARAM_WEIGHT_FACTOR: 
+   Agent-weight_factor=strdup(val);

break;

Index: php4/ext/mnogosearch/test.php
diff -u php4/ext/mnogosearch/test.php:1.10 php4/ext/mnogosearch/test.php:1.11
--- php4/ext/mnogosearch/test.php:1.10  Fri Feb  9 05:29:19 2001
+++ php4/ext/mnogosearch/test.php   Thu Feb 15 

[PHP-CVS] cvs: php4 /ext/mnogosearch config.m4 php_mnogo.c

2001-02-14 Thread Sergey Kartashoff

gluke   Wed Feb 14 06:27:46 2001 EDT

  Modified files:  
/php4/ext/mnogosearch   config.m4 php_mnogo.c 
  Log:
  Added mnogosearch version checking into config.m4.
  Some proto fixes.
  
  
Index: php4/ext/mnogosearch/config.m4
diff -u php4/ext/mnogosearch/config.m4:1.3 php4/ext/mnogosearch/config.m4:1.4
--- php4/ext/mnogosearch/config.m4:1.3  Mon Feb  5 06:00:35 2001
+++ php4/ext/mnogosearch/config.m4  Wed Feb 14 06:27:45 2001
@@ -1,5 +1,5 @@
 dnl $Source: /local/repository/php4/ext/mnogosearch/config.m4,v $
-dnl $Id: config.m4,v 1.3 2001/02/05 14:00:35 gluke Exp $
+dnl $Id: config.m4,v 1.4 2001/02/14 14:27:45 gluke Exp $
 
 PHP_ARG_WITH(mnogosearch,for mnoGoSearch support,
 [  --with-mnogosearch[=DIR]   Include mnoGoSearch support.  DIR is the 
mnoGoSearch base
@@ -17,13 +17,35 @@
   MNOGOSEARCH_LIBDIR=$PHP_MNOGOSEARCH/lib
 fi
 
-AC_ADD_INCLUDE($MNOGOSEARCH_INCDIR)
+AC_MSG_CHECKING(for mnoGoSearch version)
 
 if test -x "$MNOGOSEARCH_BINDIR/udm-config"; then
+   MNOGOSEARCH_VERSION=`$MNOGOSEARCH_BINDIR/udm-config --version`
+   MNOGOSEARCH_VERSION_ID=`$MNOGOSEARCH_BINDIR/udm-config -version-id`
+
+   if test $? -ne 0; then
+   AC_MSG_RESULT(= 3.1.9)
+   AC_MSG_ERROR(mnoGoSearch 3.1.10 at least required)
+   fi
+   
+   if test -l "$MNOGOSEARCH_VERSION_ID" -gt 6; then
+   AC_MSG_RESULT(= 3.1.9)
+   AC_MSG_ERROR(mnoGoSearch 3.1.10 at least required)
+   fi
+   
+   if test "$MNOGOSEARCH_VERSION_ID" -lt 30110; then
+   AC_MSG_RESULT(= 3.1.9)
+   AC_MSG_ERROR(mnoGoSearch 3.1.10 at least required)
+   fi
+   
+   AC_MSG_RESULT($MNOGOSEARCH_VERSION)
+   
PHP_EVAL_LIBLINE(`$MNOGOSEARCH_BINDIR/udm-config --libs`, 
MNOGOSEARCH_SHARED_LIBADD)
 else
-   AC_ADD_LIBRARY_WITH_PATH(udmsearch, $MNOGOSEARCH_LIBDIR, 
MNOGOSEARCH_SHARED_LIBADD)
+   AC_MSG_ERROR(udm-config script not found in $MNOGOSEARCH_BINDIR)
 fi
+
+AC_ADD_INCLUDE($MNOGOSEARCH_INCDIR)
 
 AC_DEFINE(HAVE_MNOGOSEARCH,1,[ ])
 
Index: php4/ext/mnogosearch/php_mnogo.c
diff -u php4/ext/mnogosearch/php_mnogo.c:1.13 php4/ext/mnogosearch/php_mnogo.c:1.14
--- php4/ext/mnogosearch/php_mnogo.c:1.13   Fri Feb  9 05:29:19 2001
+++ php4/ext/mnogosearch/php_mnogo.cWed Feb 14 06:27:45 2001
@@ -1,5 +1,5 @@
 /* $Source: /local/repository/php4/ext/mnogosearch/php_mnogo.c,v $ */
-/* $Id: php_mnogo.c,v 1.13 2001/02/09 13:29:19 gluke Exp $ */
+/* $Id: php_mnogo.c,v 1.14 2001/02/14 14:27:45 gluke Exp $ */
 
 /*
+--+
@@ -682,12 +682,12 @@
 /* }}} */
 
 
-/* {{{ proto int udm_errno(int agent)
-   mnoGoSearch error number */
-DLEXPORT PHP_FUNCTION(udm_errno)
+/* {{{ proto int udm_free_agent(int agent)
+   Free mnoGoSearch session */
+DLEXPORT PHP_FUNCTION(udm_free_agent)
 {
pval ** yyagent;
-   UDM_AGENT * Agent;
+   UDM_RESULT * Agent;
switch(ZEND_NUM_ARGS()){
case 1: {
if (zend_get_parameters_ex(1, yyagent)==FAILURE) {
@@ -699,19 +699,20 @@
WRONG_PARAM_COUNT;
break;
}
-   ZEND_FETCH_RESOURCE(Agent, UDM_AGENT *, yyagent, -1, "mnoGoSearch-Agent", 
le_link);
-   RETURN_LONG(UdmDBErrorCode(Agent-db));
+   ZEND_FETCH_RESOURCE(Agent, UDM_RESULT *, yyagent, -1, "mnoGoSearch-agent", 
+le_link);
+   zend_list_delete((*yyagent)-value.lval);
+   
+   RETURN_TRUE;
 }
 /* }}} */
 
 
-/* {{{ proto string udm_error(int agent)
-   mnoGoSearch error message */
-DLEXPORT PHP_FUNCTION(udm_error)
+/* {{{ proto int udm_errno(int agent)
+   Get mnoGoSearch error number */
+DLEXPORT PHP_FUNCTION(udm_errno)
 {
pval ** yyagent;
UDM_AGENT * Agent;
-   
switch(ZEND_NUM_ARGS()){
case 1: {
if (zend_get_parameters_ex(1, yyagent)==FAILURE) {
@@ -724,17 +725,18 @@
break;
}
ZEND_FETCH_RESOURCE(Agent, UDM_AGENT *, yyagent, -1, "mnoGoSearch-Agent", 
le_link);
-   RETURN_STRING(UdmDBErrorMsg(Agent-db),1);
+   RETURN_LONG(UdmDBErrorCode(Agent-db));
 }
 /* }}} */
 
 
-/* {{{ proto int udm_free_agent(int agent)
-   Free mnoGoSearch session */
-DLEXPORT PHP_FUNCTION(udm_free_agent)
+/* {{{ proto string udm_error(int agent)
+   Get mnoGoSearch error message */
+DLEXPORT PHP_FUNCTION(udm_error)
 {
pval ** yyagent;
-   UDM_RESULT * Agent;
+   UDM_AGENT * Agent;
+   
switch(ZEND_NUM_ARGS()){
case 1: {
if (zend_get_parameters_ex(1, yyagent)==FAILURE) {
@@ -746,10 +748,8 @@
WRONG_PARAM_COUNT;
break;
}
-   ZEND_FETCH_RESOURCE(Agent, UDM_RESULT *, yyagent, -1, "mnoGoSearch-agent", 
le_link);
-   

[PHP-CVS] cvs: php4 /ext/mnogosearch config.m4

2001-02-14 Thread Sergey Kartashoff

gluke   Wed Feb 14 06:39:39 2001 EDT

  Modified files:  
/php4/ext/mnogosearch   config.m4 
  Log:
  mnoGoSearch config.m4 freebsd compatibility fix.
  
  
Index: php4/ext/mnogosearch/config.m4
diff -u php4/ext/mnogosearch/config.m4:1.4 php4/ext/mnogosearch/config.m4:1.5
--- php4/ext/mnogosearch/config.m4:1.4  Wed Feb 14 06:27:45 2001
+++ php4/ext/mnogosearch/config.m4  Wed Feb 14 06:39:39 2001
@@ -1,5 +1,5 @@
 dnl $Source: /local/repository/php4/ext/mnogosearch/config.m4,v $
-dnl $Id: config.m4,v 1.4 2001/02/14 14:27:45 gluke Exp $
+dnl $Id: config.m4,v 1.5 2001/02/14 14:39:39 gluke Exp $
 
 PHP_ARG_WITH(mnogosearch,for mnoGoSearch support,
 [  --with-mnogosearch[=DIR]   Include mnoGoSearch support.  DIR is the 
mnoGoSearch base
@@ -24,11 +24,6 @@
MNOGOSEARCH_VERSION_ID=`$MNOGOSEARCH_BINDIR/udm-config -version-id`
 
if test $? -ne 0; then
-   AC_MSG_RESULT(= 3.1.9)
-   AC_MSG_ERROR(mnoGoSearch 3.1.10 at least required)
-   fi
-   
-   if test -l "$MNOGOSEARCH_VERSION_ID" -gt 6; then
AC_MSG_RESULT(= 3.1.9)
AC_MSG_ERROR(mnoGoSearch 3.1.10 at least required)
fi



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-CVS] cvs: php4 /ext/mnogosearch php_mnogo.c test.php

2001-02-09 Thread Sergey Kartashoff

gluke   Fri Feb  9 05:29:19 2001 EDT

  Modified files:  
/php4/ext/mnogosearch   php_mnogo.c test.php 
  Log:
  Added UDM_PARAM_FIRST_DOC and UDM_PARAM_LAST_DOC mnoGoSearch extenstion
  result parameters. Example updated. 
  
  
Index: php4/ext/mnogosearch/php_mnogo.c
diff -u php4/ext/mnogosearch/php_mnogo.c:1.12 php4/ext/mnogosearch/php_mnogo.c:1.13
--- php4/ext/mnogosearch/php_mnogo.c:1.12   Thu Feb  8 05:33:36 2001
+++ php4/ext/mnogosearch/php_mnogo.cFri Feb  9 05:29:19 2001
@@ -1,5 +1,5 @@
 /* $Source: /local/repository/php4/ext/mnogosearch/php_mnogo.c,v $ */
-/* $Id: php_mnogo.c,v 1.12 2001/02/08 13:33:36 gluke Exp $ */
+/* $Id: php_mnogo.c,v 1.13 2001/02/09 13:29:19 gluke Exp $ */
 
 /*
+--+
@@ -67,6 +67,8 @@
 #define UDM_PARAM_FOUND257
 #define UDM_PARAM_WORDINFO 258
 #define UDM_PARAM_SEARCHTIME   259
+#define UDM_PARAM_FIRST_DOC260
+#define UDM_PARAM_LAST_DOC 261
 
 /* True globals, no need for thread safety */
 static int le_link,le_res;
@@ -167,6 +169,8 @@
REGISTER_LONG_CONSTANT("UDM_PARAM_WORD_INFO",   UDM_PARAM_WORDINFO,CONST_CS | 
CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_PARAM_SEARCHTIME",  UDM_PARAM_SEARCHTIME,CONST_CS 
| CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_PARAM_SEARCH_TIME", UDM_PARAM_SEARCHTIME,CONST_CS 
| CONST_PERSISTENT);
+   REGISTER_LONG_CONSTANT("UDM_PARAM_FIRST_DOC",   UDM_PARAM_FIRST_DOC,CONST_CS | 
+CONST_PERSISTENT);
+   REGISTER_LONG_CONSTANT("UDM_PARAM_LAST_DOC",UDM_PARAM_LAST_DOC,CONST_CS | 
+CONST_PERSISTENT);
 
/* search modes */
REGISTER_LONG_CONSTANT("UDM_MODE_ALL",  UDM_MODE_ALL,CONST_CS | 
CONST_PERSISTENT);
@@ -635,6 +639,14 @@
case UDM_PARAM_SEARCHTIME:  
RETURN_DOUBLE(((double)Res-work_time)/1000);
break;  
+   
+   case UDM_PARAM_FIRST_DOC:   
+   RETURN_LONG(Res-first);
+   break;
+
+   case UDM_PARAM_LAST_DOC:
+   RETURN_LONG(Res-last);
+   break;
 
default:
php_error(E_WARNING,"Udm_Get_Res_Param: Unknown mnoGoSearch 
param name");
Index: php4/ext/mnogosearch/test.php
diff -u php4/ext/mnogosearch/test.php:1.9 php4/ext/mnogosearch/test.php:1.10
--- php4/ext/mnogosearch/test.php:1.9   Thu Feb  8 05:33:36 2001
+++ php4/ext/mnogosearch/test.php   Fri Feb  9 05:29:19 2001
@@ -1,6 +1,6 @@
 !-- 
 $Source: /local/repository/php4/ext/mnogosearch/test.php,v $
-$Id: test.php,v 1.9 2001/02/08 13:33:36 gluke Exp $ 
+$Id: test.php,v 1.10 2001/02/09 13:29:19 gluke Exp $ 
 --
 
 html
@@ -64,11 +64,13 @@
$rows=Udm_Get_Res_Param($res,UDM_PARAM_NUM_ROWS);
$wordinfo=Udm_Get_Res_Param($res,UDM_PARAM_WORDINFO);
$searchtime=Udm_Get_Res_Param($res,UDM_PARAM_SEARCHTIME);
+   $first_doc=Udm_Get_Res_Param($res,UDM_PARAM_FIRST_DOC);
+   $last_doc=Udm_Get_Res_Param($res,UDM_PARAM_LAST_DOC);
 
printf("Searchtime: ".$searchtime."\n\n");
 
-   printf("Documents %d-%d from %d total found; %s\n\n",
-   $first,$first+$rows-1,$total,$wordinfo);
+   printf("Documents %d(%d)-%d(%d) from %d total found; %s\n\n",
+   $first,$first_doc,$first+$rows-1,$last_doc,$total,$wordinfo);
 
// Fetch all rows
for($i=0;$i$rows;$i++){



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-CVS] cvs: php4 /ext/mnogosearch php_mnogo.c test.php

2001-02-08 Thread Sergey Kartashoff

gluke   Thu Feb  8 05:33:36 2001 EDT

  Modified files:  
/php4/ext/mnogosearch   php_mnogo.c test.php 
  Log:
  Added UDM_PARAM_SEARCHTIME result parameter. 
  Now at least mnoGoSearch-3.1.10 required to use this module.
  Added some parameters aliases. Example updated.
  
  
Index: php4/ext/mnogosearch/php_mnogo.c
diff -u php4/ext/mnogosearch/php_mnogo.c:1.11 php4/ext/mnogosearch/php_mnogo.c:1.12
--- php4/ext/mnogosearch/php_mnogo.c:1.11   Thu Feb  8 02:14:56 2001
+++ php4/ext/mnogosearch/php_mnogo.cThu Feb  8 05:33:36 2001
@@ -1,5 +1,5 @@
 /* $Source: /local/repository/php4/ext/mnogosearch/php_mnogo.c,v $ */
-/* $Id: php_mnogo.c,v 1.11 2001/02/08 10:14:56 gluke Exp $ */
+/* $Id: php_mnogo.c,v 1.12 2001/02/08 13:33:36 gluke Exp $ */
 
 /*
+--+
@@ -36,14 +36,12 @@
 #define UDM_FIELD_TITLE4
 #define UDM_FIELD_KEYWORDS 5
 #define UDM_FIELD_DESC 6
-#define UDM_FIELD_DESCRIPTION  7
-#define UDM_FIELD_TEXT 8
-#define UDM_FIELD_SIZE 9
-#define UDM_FIELD_SCORE10
-#define UDM_FIELD_RATING   11
-#define UDM_FIELD_MODIFIED 12
-#define UDM_FIELD_ORDER13
-#define UDM_FIELD_CRC  14
+#define UDM_FIELD_TEXT 7
+#define UDM_FIELD_SIZE 8
+#define UDM_FIELD_RATING   9
+#define UDM_FIELD_MODIFIED 10
+#define UDM_FIELD_ORDER11
+#define UDM_FIELD_CRC  12
 
 /* udm_set_agent_param constants */
 #define UDM_PARAM_PAGE_SIZE1
@@ -68,6 +66,7 @@
 #define UDM_PARAM_NUM_ROWS 256
 #define UDM_PARAM_FOUND257
 #define UDM_PARAM_WORDINFO 258
+#define UDM_PARAM_SEARCHTIME   259
 
 /* True globals, no need for thread safety */
 static int le_link,le_res;
@@ -134,11 +133,11 @@
REGISTER_LONG_CONSTANT("UDM_FIELD_TITLE",   UDM_FIELD_TITLE,CONST_CS | 
CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_FIELD_KEYWORDS",UDM_FIELD_KEYWORDS,CONST_CS | 
CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_FIELD_DESC",UDM_FIELD_DESC,CONST_CS | 
CONST_PERSISTENT);
-   REGISTER_LONG_CONSTANT("UDM_FIELD_DESCRIPTION", UDM_FIELD_DESCRIPTION,CONST_CS 
| CONST_PERSISTENT);
+   REGISTER_LONG_CONSTANT("UDM_FIELD_DESCRIPTION", UDM_FIELD_DESC,CONST_CS | 
+CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_FIELD_TEXT",UDM_FIELD_TEXT,CONST_CS | 
CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_FIELD_SIZE",UDM_FIELD_SIZE,CONST_CS | 
CONST_PERSISTENT);
-   REGISTER_LONG_CONSTANT("UDM_FIELD_SCORE",   UDM_FIELD_SCORE,CONST_CS | 
CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_FIELD_RATING",  UDM_FIELD_RATING,CONST_CS | 
CONST_PERSISTENT);
+   REGISTER_LONG_CONSTANT("UDM_FIELD_SCORE",   UDM_FIELD_RATING,CONST_CS | 
+CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_FIELD_MODIFIED",UDM_FIELD_MODIFIED,CONST_CS | 
CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_FIELD_ORDER",   UDM_FIELD_ORDER,CONST_CS | 
CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_FIELD_CRC", UDM_FIELD_CRC,CONST_CS | 
CONST_PERSISTENT);
@@ -151,7 +150,9 @@
REGISTER_LONG_CONSTANT("UDM_PARAM_TRACK_MODE",  UDM_PARAM_TRACK_MODE,CONST_CS 
| CONST_PERSISTENT);  
REGISTER_LONG_CONSTANT("UDM_PARAM_CHARSET", UDM_PARAM_CHARSET,CONST_CS | 
CONST_PERSISTENT); 
REGISTER_LONG_CONSTANT("UDM_PARAM_STOPTABLE",   UDM_PARAM_STOPTABLE,CONST_CS | 
CONST_PERSISTENT);   
+   REGISTER_LONG_CONSTANT("UDM_PARAM_STOP_TABLE",  UDM_PARAM_STOPTABLE,CONST_CS | 
+CONST_PERSISTENT);   
REGISTER_LONG_CONSTANT("UDM_PARAM_STOPFILE",UDM_PARAM_STOPFILE,CONST_CS | 
CONST_PERSISTENT);
+   REGISTER_LONG_CONSTANT("UDM_PARAM_STOP_FILE",   UDM_PARAM_STOPFILE,CONST_CS | 
+CONST_PERSISTENT);

/* udm_add_search_limit constants */
REGISTER_LONG_CONSTANT("UDM_LIMIT_CAT", UDM_LIMIT_CAT,CONST_CS | 
CONST_PERSISTENT);
@@ -163,6 +164,9 @@
REGISTER_LONG_CONSTANT("UDM_PARAM_FOUND",   UDM_PARAM_FOUND,CONST_CS | 
CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_PARAM_NUM_ROWS",UDM_PARAM_NUM_ROWS,CONST_CS | 
CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_PARAM_WORDINFO",UDM_PARAM_WORDINFO,CONST_CS | 
CONST_PERSISTENT);
+   REGISTER_LONG_CONSTANT("UDM_PARAM_WORD_INFO",   UDM_PARAM_WORDINFO,CONST_CS | 
+CONST_PERSISTENT);
+   REGISTER_LONG_CONSTANT("UDM_PARAM_SEARCHTIME",  UDM_PARAM_SEARCHTIME,CONST_CS 
+| CONST_PERSISTENT);
+   REGISTER_LONG_CONSTANT("UDM_PARAM_SEARCH_TIME", UDM_PARAM_SEARCHTIME,CONST_CS 
+| CONST_PERSISTENT);
 
/* search modes */
REGISTER_LONG_CONSTANT("UDM_MODE_ALL",  UDM_MODE_ALL,CONST_CS | 
CONST_PERSISTENT);
@@ -550,7 +554,6 @@
break;

case UDM_FIELD_DESC:
- 

[PHP-CVS] cvs: php4 /ext/mnogosearch .cvsignore

2001-02-07 Thread Sergey Kartashoff

gluke   Wed Feb  7 02:41:39 2001 EDT

  Added files: 
/php4/ext/mnogosearch   .cvsignore 
  Log:
  Added .cvsignore
  
  

Index: php4/ext/mnogosearch/.cvsignore
+++ php4/ext/mnogosearch/.cvsignore
Makefile
*.lo
*.la
libs
deps
libs.mk



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-CVS] cvs: php4 /ext/mnogosearch php_mnogo.c test.php

2001-02-06 Thread Sergey Kartashoff

gluke   Tue Feb  6 06:30:54 2001 EDT

  Modified files:  
/php4/ext/mnogosearch   php_mnogo.c test.php 
  Log:
  UDM_PARAM_WORDINFO mnoGoSearch result parameter has been added.
  UDM_PARAM_RATING result field has neen added as alias for UDM_PARAM_SCORE.
  Example updated.
  @- UDM_PARAM_WORDINFO mnoGoSearch result parameter has been added.
  @  UDM_PARAM_RATING result field has neen added as alias for 
  @  UDM_PARAM_SCORE. (gluke)
  
  
Index: php4/ext/mnogosearch/php_mnogo.c
diff -u php4/ext/mnogosearch/php_mnogo.c:1.8 php4/ext/mnogosearch/php_mnogo.c:1.9
--- php4/ext/mnogosearch/php_mnogo.c:1.8Mon Feb  5 07:15:08 2001
+++ php4/ext/mnogosearch/php_mnogo.cTue Feb  6 06:30:54 2001
@@ -1,5 +1,5 @@
 /* $Source: /local/repository/php4/ext/mnogosearch/php_mnogo.c,v $ */
-/* $Id: php_mnogo.c,v 1.8 2001/02/05 15:15:08 gluke Exp $ */
+/* $Id: php_mnogo.c,v 1.9 2001/02/06 14:30:54 gluke Exp $ */
 
 /*
+--+
@@ -32,14 +32,16 @@
 
 #define UDM_FIELD_URLID1
 #define UDM_FIELD_URL  2
-#define UDM_FIELD_CONTENT  4   
-#define UDM_FIELD_TITLE8
-#define UDM_FIELD_KEYWORDS 16
-#define UDM_FIELD_DESC 32
-#define UDM_FIELD_TEXT 64
-#define UDM_FIELD_SIZE 128
-#define UDM_FIELD_SCORE256
-#define UDM_FIELD_MODIFIED 512
+#define UDM_FIELD_CONTENT  3   
+#define UDM_FIELD_TITLE4
+#define UDM_FIELD_KEYWORDS 5
+#define UDM_FIELD_DESC 6
+#define UDM_FIELD_DESCRIPTION  7
+#define UDM_FIELD_TEXT 8
+#define UDM_FIELD_SIZE 9
+#define UDM_FIELD_SCORE10
+#define UDM_FIELD_RATING   11
+#define UDM_FIELD_MODIFIED 12
 
 /* udm_set_agent_param constants */
 #define UDM_PARAM_PAGE_SIZE1
@@ -63,6 +65,7 @@
 /* udm_get_res_param constants */
 #define UDM_PARAM_NUM_ROWS 256
 #define UDM_PARAM_FOUND257
+#define UDM_PARAM_WORDINFO 258
 
 /* True globals, no need for thread safety */
 static int le_link,le_res;
@@ -128,9 +131,11 @@
REGISTER_LONG_CONSTANT("UDM_FIELD_TITLE",   UDM_FIELD_TITLE,CONST_CS | 
CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_FIELD_KEYWORDS",UDM_FIELD_KEYWORDS,CONST_CS | 
CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_FIELD_DESC",UDM_FIELD_DESC,CONST_CS | 
CONST_PERSISTENT);
+   REGISTER_LONG_CONSTANT("UDM_FIELD_DESCRIPTION", UDM_FIELD_DESCRIPTION,CONST_CS 
+| CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_FIELD_TEXT",UDM_FIELD_TEXT,CONST_CS | 
CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_FIELD_SIZE",UDM_FIELD_SIZE,CONST_CS | 
CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_FIELD_SCORE",   UDM_FIELD_SCORE,CONST_CS | 
CONST_PERSISTENT);
+   REGISTER_LONG_CONSTANT("UDM_FIELD_RATING",  UDM_FIELD_RATING,CONST_CS | 
+CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_FIELD_MODIFIED",UDM_FIELD_MODIFIED,CONST_CS | 
CONST_PERSISTENT);
 
/* udm_set_agent_param constants */
@@ -152,6 +157,7 @@
/* udm_get_res_param constants */
REGISTER_LONG_CONSTANT("UDM_PARAM_FOUND",UDM_PARAM_FOUND,CONST_CS | 
CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_PARAM_NUM_ROWS",UDM_PARAM_NUM_ROWS,CONST_CS | 
CONST_PERSISTENT);
+   REGISTER_LONG_CONSTANT("UDM_PARAM_WORDINFO",UDM_PARAM_WORDINFO,CONST_CS | 
+CONST_PERSISTENT);
 
/* search modes */
REGISTER_LONG_CONSTANT("UDM_MODE_ALL",UDM_MODE_ALL,CONST_CS | 
CONST_PERSISTENT);
@@ -496,7 +502,7 @@
 /* }}} */
 
 
-/* {{{ proto int udm_get_res_field(int res, int row, int field)
+/* {{{ proto string udm_get_res_field(int res, int row, int field)
Fetch mnoGoSearch result field */
 DLEXPORT PHP_FUNCTION(udm_get_res_field){
pval **yyres, **yyrow_num, **yyfield_name;
@@ -522,16 +528,48 @@
ZEND_FETCH_RESOURCE(Res, UDM_RESULT *, yyres, -1, "mnoGoSearch-Result", 
le_res);
if(rowRes-num_rows){
switch(field){
-   case UDM_FIELD_URL: 
RETURN_STRING((Res-Doc[row].url),1);break;
-   case UDM_FIELD_CONTENT: 
RETURN_STRING((Res-Doc[row].content_type),1);break;
-   case UDM_FIELD_TITLE:   
RETURN_STRING((Res-Doc[row].title),1);break;
-   case UDM_FIELD_KEYWORDS:
RETURN_STRING((Res-Doc[row].keywords),1);break;
-   case UDM_FIELD_DESC:
RETURN_STRING((Res-Doc[row].description),1);break;
-   case UDM_FIELD_TEXT:
RETURN_STRING((Res-Doc[row].text),1);break;
-   case UDM_FIELD_SIZE:
RETURN_LONG((Res-Doc[row].size));break;
-   case UDM_FIELD_URLID:   
RETURN_LONG((Res-Doc[row].url_id));break;
-   case UDM_FIELD_SCORE:   
RETURN_LONG((Res-Doc[row].rating));break;
-  

[PHP-CVS] cvs: php4 /ext/mnogosearch php_mnogo.c test.php

2001-02-06 Thread Sergey Kartashoff

gluke   Tue Feb  6 07:40:33 2001 EDT

  Modified files:  
/php4/ext/mnogosearch   php_mnogo.c test.php 
  Log:
  UDM_FIELD_ORDER and UDM_FIELD_CRC mnoGoSearch result fields has been added.
  Example updated.
  @- UDM_FIELD_ORDER and UDM_FIELD_CRC mnoGoSearch result fields 
  @  has been added. (gluke)
  
  

Index: php4/ext/mnogosearch/php_mnogo.c
diff -u php4/ext/mnogosearch/php_mnogo.c:1.9 php4/ext/mnogosearch/php_mnogo.c:1.10
--- php4/ext/mnogosearch/php_mnogo.c:1.9Tue Feb  6 06:30:54 2001
+++ php4/ext/mnogosearch/php_mnogo.cTue Feb  6 07:40:32 2001
@@ -1,5 +1,5 @@
 /* $Source: /local/repository/php4/ext/mnogosearch/php_mnogo.c,v $ */
-/* $Id: php_mnogo.c,v 1.9 2001/02/06 14:30:54 gluke Exp $ */
+/* $Id: php_mnogo.c,v 1.10 2001/02/06 15:40:32 gluke Exp $ */
 
 /*
+--+
@@ -42,6 +42,8 @@
 #define UDM_FIELD_SCORE10
 #define UDM_FIELD_RATING   11
 #define UDM_FIELD_MODIFIED 12
+#define UDM_FIELD_ORDER13
+#define UDM_FIELD_CRC  14
 
 /* udm_set_agent_param constants */
 #define UDM_PARAM_PAGE_SIZE1
@@ -126,51 +128,53 @@
le_res = zend_register_list_destructors_ex(_free_udm_res,NULL,"mnogosearch 
result",module_number);
 
REGISTER_LONG_CONSTANT("UDM_FIELD_URLID",   UDM_FIELD_URLID,CONST_CS | 
CONST_PERSISTENT);
-   REGISTER_LONG_CONSTANT("UDM_FIELD_URL", UDM_FIELD_URL,CONST_CS | 
CONST_PERSISTENT);
-   REGISTER_LONG_CONSTANT("UDM_FIELD_CONTENT",UDM_FIELD_CONTENT,CONST_CS | 
CONST_PERSISTENT);
+   REGISTER_LONG_CONSTANT("UDM_FIELD_URL", UDM_FIELD_URL,CONST_CS | 
+CONST_PERSISTENT);
+   REGISTER_LONG_CONSTANT("UDM_FIELD_CONTENT", UDM_FIELD_CONTENT,CONST_CS | 
+CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_FIELD_TITLE",   UDM_FIELD_TITLE,CONST_CS | 
CONST_PERSISTENT);
-   REGISTER_LONG_CONSTANT("UDM_FIELD_KEYWORDS",UDM_FIELD_KEYWORDS,CONST_CS | 
CONST_PERSISTENT);
+   REGISTER_LONG_CONSTANT("UDM_FIELD_KEYWORDS",UDM_FIELD_KEYWORDS,CONST_CS | 
+CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_FIELD_DESC",UDM_FIELD_DESC,CONST_CS | 
CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_FIELD_DESCRIPTION", UDM_FIELD_DESCRIPTION,CONST_CS 
| CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_FIELD_TEXT",UDM_FIELD_TEXT,CONST_CS | 
CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_FIELD_SIZE",UDM_FIELD_SIZE,CONST_CS | 
CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_FIELD_SCORE",   UDM_FIELD_SCORE,CONST_CS | 
CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_FIELD_RATING",  UDM_FIELD_RATING,CONST_CS | 
CONST_PERSISTENT);
-   REGISTER_LONG_CONSTANT("UDM_FIELD_MODIFIED",UDM_FIELD_MODIFIED,CONST_CS | 
CONST_PERSISTENT);
+   REGISTER_LONG_CONSTANT("UDM_FIELD_MODIFIED",UDM_FIELD_MODIFIED,CONST_CS | 
+CONST_PERSISTENT);
+   REGISTER_LONG_CONSTANT("UDM_FIELD_ORDER",   UDM_FIELD_ORDER,CONST_CS | 
+CONST_PERSISTENT);
+   REGISTER_LONG_CONSTANT("UDM_FIELD_CRC", UDM_FIELD_CRC,CONST_CS | 
+CONST_PERSISTENT);
 
/* udm_set_agent_param constants */
-   REGISTER_LONG_CONSTANT("UDM_PARAM_PAGE_SIZE",UDM_PARAM_PAGE_SIZE,CONST_CS | 
CONST_PERSISTENT);
-   REGISTER_LONG_CONSTANT("UDM_PARAM_PAGE_NUM",UDM_PARAM_PAGE_NUM,CONST_CS | 
CONST_PERSISTENT);
-   REGISTER_LONG_CONSTANT("UDM_PARAM_SEARCH_MODE",UDM_PARAM_SEARCH_MODE,CONST_CS 
| CONST_PERSISTENT);  
-   REGISTER_LONG_CONSTANT("UDM_PARAM_CACHE_MODE",UDM_PARAM_CACHE_MODE,CONST_CS | 
CONST_PERSISTENT);
-   REGISTER_LONG_CONSTANT("UDM_PARAM_TRACK_MODE",UDM_PARAM_TRACK_MODE,CONST_CS | 
CONST_PERSISTENT);
-   REGISTER_LONG_CONSTANT("UDM_PARAM_CHARSET",UDM_PARAM_CHARSET,CONST_CS | 
CONST_PERSISTENT);  
-   REGISTER_LONG_CONSTANT("UDM_PARAM_STOPTABLE",UDM_PARAM_STOPTABLE,CONST_CS | 
CONST_PERSISTENT);  
-   REGISTER_LONG_CONSTANT("UDM_PARAM_STOPFILE",UDM_PARAM_STOPFILE,CONST_CS | 
CONST_PERSISTENT);
+   REGISTER_LONG_CONSTANT("UDM_PARAM_PAGE_SIZE",   UDM_PARAM_PAGE_SIZE,CONST_CS | 
+CONST_PERSISTENT);
+   REGISTER_LONG_CONSTANT("UDM_PARAM_PAGE_NUM",UDM_PARAM_PAGE_NUM,CONST_CS | 
+CONST_PERSISTENT);
+   REGISTER_LONG_CONSTANT("UDM_PARAM_SEARCH_MODE", UDM_PARAM_SEARCH_MODE,CONST_CS 
+| CONST_PERSISTENT); 
+   REGISTER_LONG_CONSTANT("UDM_PARAM_CACHE_MODE",  UDM_PARAM_CACHE_MODE,CONST_CS 
+| CONST_PERSISTENT);  
+   REGISTER_LONG_CONSTANT("UDM_PARAM_TRACK_MODE",  UDM_PARAM_TRACK_MODE,CONST_CS 
+| CONST_PERSISTENT);  
+   REGISTER_LONG_CONSTANT("UDM_PARAM_CHARSET", UDM_PARAM_CHARSET,CONST_CS | 
+CONST_PERSISTENT); 
+   REGISTER_LONG_CONSTANT("UDM_PARAM_STOPTABLE",   UDM_PARAM_STOPTABLE,CONST_CS | 
+CONST_PERSISTENT);   
+   REGISTER_LONG_CONSTANT("UDM_PARAM_STOPFILE",UDM_PARAM_STOPFILE,CONST_CS | 
+CONST_PERSISTENT);

/* 

Re: [PHP-CVS] cvs: php4 /ext/mnogosearch php_mnogo.c test.php

2001-02-06 Thread Sergey Kartashoff

On Tue, 6 Feb 2001, Sterling Hughes wrote:

 This extension is being released in this next version of PHP, you only need
 one news entry, something to the effect of

 "Added the UDM search extension (authors)"

ok. So, i should not write any NEWS on this extension till 4.0.5 release ?

-- 
    Regards. Sergey aka gluke.


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-CVS] cvs: php4 /ext/mnogosearch README php_mnogo.c php_mnogo.h

2001-02-05 Thread Sergey Kartashoff

gluke   Mon Feb  5 00:42:54 2001 EDT

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

[PHP-CVS] cvs: php4 /ext/mnogosearch README php_mnogo.c php_mnogo.h test.php

2001-02-05 Thread Sergey Kartashoff

gluke   Mon Feb  5 05:12:15 2001 EDT

  Modified files:  
/php4/ext/mnogosearch   README php_mnogo.c php_mnogo.h test.php 
  Log:
  Added new Udm_Add_Search_Limit mnoGoSearch extension function.
  Some bugfixes and example update.
  @- Added new Udm_Add_Search_Limit mnoGoSearch extension function.
  @  Some bugfixes and example update. (gluke)
  
  
Index: php4/ext/mnogosearch/README
diff -u php4/ext/mnogosearch/README:1.4 php4/ext/mnogosearch/README:1.5
--- php4/ext/mnogosearch/README:1.4 Mon Feb  5 00:42:53 2001
+++ php4/ext/mnogosearch/README Mon Feb  5 05:12:15 2001
@@ -1,8 +1,8 @@
 $Source: /local/repository/php4/ext/mnogosearch/README,v $
-$Id: README,v 1.4 2001/02/05 08:42:53 gluke Exp $
+$Id: README,v 1.5 2001/02/05 13:12:15 gluke Exp $
 
 mnoGoSearch extension module for PHP4.
-Basic mnoGoSearch function implementation.
+mnoGoSearch function implementation.
 
 If used with mysql you should not use bundled mysql library 
 in the php distribution. You should use native mysql 
@@ -12,7 +12,7 @@
   TODO
   
 
-1. Implement more mnoGoSearch functions.
+1. Implement all mnoGoSearch functions.
 
 2. Fix  config.m4 to detect whether mnoGoSearch is actually installed.
 Currently there is no any checking. ./configure just trust that mnoGoSearch
Index: php4/ext/mnogosearch/php_mnogo.c
diff -u php4/ext/mnogosearch/php_mnogo.c:1.6 php4/ext/mnogosearch/php_mnogo.c:1.7
--- php4/ext/mnogosearch/php_mnogo.c:1.6Mon Feb  5 00:42:53 2001
+++ php4/ext/mnogosearch/php_mnogo.cMon Feb  5 05:12:15 2001
@@ -1,5 +1,5 @@
 /* $Source: /local/repository/php4/ext/mnogosearch/php_mnogo.c,v $ */
-/* $Id: php_mnogo.c,v 1.6 2001/02/05 08:42:53 gluke Exp $ */
+/* $Id: php_mnogo.c,v 1.7 2001/02/05 13:12:15 gluke Exp $ */
 
 /*
+--+
@@ -51,6 +51,12 @@
 #define UDM_PARAM_STOPTABLE7
 #define UDM_PARAM_STOPFILE 8
 
+/* udm_add_search_limit constants */
+#define UDM_LIMIT_URL  1
+#define UDM_LIMIT_TAG  2
+#define UDM_LIMIT_LANG 3
+#define UDM_LIMIT_CAT  4
+
 #define UDM_TRACK_ENABLED  1
 #define UDM_TRACK_DISABLED 0
 
@@ -66,6 +72,7 @@
 function_entry mnogosearch_functions[] = {
PHP_FE(udm_alloc_agent, NULL)
PHP_FE(udm_set_agent_param, NULL)
+   PHP_FE(udm_add_search_limit,NULL)
PHP_FE(udm_free_agent,  NULL)
 
PHP_FE(udm_errno,   NULL)
@@ -133,6 +140,12 @@
REGISTER_LONG_CONSTANT("UDM_PARAM_STOPTABLE",UDM_PARAM_STOPTABLE,CONST_CS | 
CONST_PERSISTENT);  
REGISTER_LONG_CONSTANT("UDM_PARAM_STOPFILE",UDM_PARAM_STOPFILE,CONST_CS | 
CONST_PERSISTENT);

+   /* udm_add_search_limit constants */
+   REGISTER_LONG_CONSTANT("UDM_LIMIT_CAT",UDM_LIMIT_CAT,CONST_CS | 
+CONST_PERSISTENT);
+   REGISTER_LONG_CONSTANT("UDM_LIMIT_URL",UDM_LIMIT_URL,CONST_CS | 
+CONST_PERSISTENT);
+   REGISTER_LONG_CONSTANT("UDM_LIMIT_TAG",UDM_LIMIT_TAG,CONST_CS | 
+CONST_PERSISTENT);  
+   REGISTER_LONG_CONSTANT("UDM_LIMIT_LANG",UDM_LIMIT_LANG,CONST_CS | 
+CONST_PERSISTENT);
+   
/* udm_get_res_param constants */
REGISTER_LONG_CONSTANT("UDM_PARAM_FOUND",UDM_PARAM_FOUND,CONST_CS | 
CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_PARAM_NUM_ROWS",UDM_PARAM_NUM_ROWS,CONST_CS | 
CONST_PERSISTENT);
@@ -353,8 +366,67 @@

break;

+   default:
+   php_error(E_WARNING,"Udm_Set_Agent_Param: Unknown agent 
+session parameter");
+   RETURN_FALSE;
+   break;
+   }
+   RETURN_TRUE;
+}
+/* }}} */
+
+
+/* {{{ proto int udm_add_search_limit(int agent, int var, string val)
+   Add mnoGoSearch search restrictions */
+DLEXPORT PHP_FUNCTION(udm_add_search_limit)
+{
+   pval **yyagent, **yyvar, **yyval;
+   char *val;
+   int var;
+   UDM_AGENT * Agent;
+
+   switch(ZEND_NUM_ARGS()){
+   
+   case 3: 
+   if(zend_get_parameters_ex(3,yyagent,yyvar,yyval)==FAILURE){
+   RETURN_FALSE;
+   }
+   convert_to_long_ex(yyvar);
+   convert_to_string_ex(yyval);
+   ZEND_FETCH_RESOURCE(Agent, UDM_AGENT *, yyagent, -1, 
+"mnoGoSearch-agent", le_link);
+   var = (*yyvar)-value.lval;
+   val = (*yyval)-value.str.val;
+   
+   break;
+   
+   default:
+   WRONG_PARAM_COUNT;
+   break;
+   }
+   
+   switch(var){
+   case UDM_LIMIT_URL: 
+   UdmAddURLLimit(Agent-Conf,val);
+   
+   break;
+   
+   case 

[PHP-CVS] cvs: php4 /ext/mnogosearch config.m4

2001-02-05 Thread Sergey Kartashoff

gluke   Mon Feb  5 06:00:35 2001 EDT

  Modified files:  
/php4/ext/mnogosearch   config.m4 
  Log:
  Fixed default search path.
  @- Fixed default search path. (gluke)
  
  
Index: php4/ext/mnogosearch/config.m4
diff -u php4/ext/mnogosearch/config.m4:1.2 php4/ext/mnogosearch/config.m4:1.3
--- php4/ext/mnogosearch/config.m4:1.2  Wed Jan 31 06:04:29 2001
+++ php4/ext/mnogosearch/config.m4  Mon Feb  5 06:00:35 2001
@@ -1,16 +1,16 @@
 dnl $Source: /local/repository/php4/ext/mnogosearch/config.m4,v $
-dnl $Id: config.m4,v 1.2 2001/01/31 14:04:29 gluke Exp $
+dnl $Id: config.m4,v 1.3 2001/02/05 14:00:35 gluke Exp $
 
 PHP_ARG_WITH(mnogosearch,for mnoGoSearch support,
 [  --with-mnogosearch[=DIR]   Include mnoGoSearch support.  DIR is the 
mnoGoSearch base
-  install directory, defaults to /usr/local/udmsearch.])
+  install directory, defaults to /usr/local/mnogosearch.])
 
   if test "$PHP_MNOGOSEARCH" != "no"; then
   
 if test "$PHP_MNOGOSEARCH" = "yes"; then
-  MNOGOSEARCH_BINDIR=/usr/local/udmsearch/bin
-  MNOGOSEARCH_INCDIR=/usr/local/udmsearch/include
-  MNOGOSEARCH_LIBDIR=/usr/local/udmsearch/lib
+  MNOGOSEARCH_BINDIR=/usr/local/mnogosearch/bin
+  MNOGOSEARCH_INCDIR=/usr/local/mnogosearch/include
+  MNOGOSEARCH_LIBDIR=/usr/local/mnogosearch/lib
 else
   MNOGOSEARCH_BINDIR=$PHP_MNOGOSEARCH/bin
   MNOGOSEARCH_INCDIR=$PHP_MNOGOSEARCH/include



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-CVS] cvs: php4 /ext/mnogosearch php_mnogo.c php_mnogo.h test.php

2001-02-05 Thread Sergey Kartashoff

gluke   Mon Feb  5 07:15:09 2001 EDT

  Modified files:  
/php4/ext/mnogosearch   php_mnogo.c php_mnogo.h test.php 
  Log:
  Added new Udm_Clear_Search_Limits mnogosearch extension function.
  @- Added Udm_Clear_Search_Limits mnoGoSearch extension function.
  
  
Index: php4/ext/mnogosearch/php_mnogo.c
diff -u php4/ext/mnogosearch/php_mnogo.c:1.7 php4/ext/mnogosearch/php_mnogo.c:1.8
--- php4/ext/mnogosearch/php_mnogo.c:1.7Mon Feb  5 05:12:15 2001
+++ php4/ext/mnogosearch/php_mnogo.cMon Feb  5 07:15:08 2001
@@ -1,5 +1,5 @@
 /* $Source: /local/repository/php4/ext/mnogosearch/php_mnogo.c,v $ */
-/* $Id: php_mnogo.c,v 1.7 2001/02/05 13:12:15 gluke Exp $ */
+/* $Id: php_mnogo.c,v 1.8 2001/02/05 15:15:08 gluke Exp $ */
 
 /*
+--+
@@ -72,17 +72,20 @@
 function_entry mnogosearch_functions[] = {
PHP_FE(udm_alloc_agent, NULL)
PHP_FE(udm_set_agent_param, NULL)
+   
PHP_FE(udm_add_search_limit,NULL)
-   PHP_FE(udm_free_agent,  NULL)
-
+   PHP_FE(udm_clear_search_limits, NULL)
+   
PHP_FE(udm_errno,   NULL)
PHP_FE(udm_error,   NULL)
 
PHP_FE(udm_find,NULL)
-   PHP_FE(udm_free_res,NULL)
-   PHP_FE(udm_get_res_field,   NULL)
PHP_FE(udm_get_res_param,   NULL)
-
+   PHP_FE(udm_get_res_field,   NULL)
+   
+   PHP_FE(udm_free_res,NULL)
+   PHP_FE(udm_free_agent,  NULL)
+   
{NULL, NULL, NULL}
 };
 
@@ -430,6 +433,32 @@
RETURN_FALSE;
break;
}
+   RETURN_TRUE;
+}
+/* }}} */
+
+
+/* {{{ proto int udm_clear_search_limits(int agent)
+   Clear all mnoGoSearch search restrictions */
+DLEXPORT PHP_FUNCTION(udm_clear_search_limits)
+{
+   pval ** yyagent;
+   UDM_AGENT * Agent;
+   switch(ZEND_NUM_ARGS()){
+   case 1: {
+   if (zend_get_parameters_ex(1, yyagent)==FAILURE) {
+   RETURN_FALSE;
+   }
+   }
+   break;
+   default:
+   WRONG_PARAM_COUNT;
+   break;
+   }
+   ZEND_FETCH_RESOURCE(Agent, UDM_AGENT *, yyagent, -1, "mnoGoSearch-Agent", 
+le_link);
+   
+   UdmClearLimits(Agent-Conf);
+   
RETURN_TRUE;
 }
 /* }}} */
Index: php4/ext/mnogosearch/php_mnogo.h
diff -u php4/ext/mnogosearch/php_mnogo.h:1.4 php4/ext/mnogosearch/php_mnogo.h:1.5
--- php4/ext/mnogosearch/php_mnogo.h:1.4Mon Feb  5 05:12:15 2001
+++ php4/ext/mnogosearch/php_mnogo.hMon Feb  5 07:15:08 2001
@@ -1,5 +1,5 @@
 /* $Source: /local/repository/php4/ext/mnogosearch/php_mnogo.h,v $ */
-/* $Id: php_mnogo.h,v 1.4 2001/02/05 13:12:15 gluke Exp $ */
+/* $Id: php_mnogo.h,v 1.5 2001/02/05 15:15:08 gluke Exp $ */
 
 /* 
+--+
@@ -48,16 +48,19 @@
 
 DLEXPORT PHP_FUNCTION(udm_alloc_agent);
 DLEXPORT PHP_FUNCTION(udm_set_agent_param);
+
 DLEXPORT PHP_FUNCTION(udm_add_search_limit);
-DLEXPORT PHP_FUNCTION(udm_free_agent);
+DLEXPORT PHP_FUNCTION(udm_clear_search_limits);
 
 DLEXPORT PHP_FUNCTION(udm_error);
 DLEXPORT PHP_FUNCTION(udm_errno);
 
 DLEXPORT PHP_FUNCTION(udm_find);
-DLEXPORT PHP_FUNCTION(udm_free_res);
 DLEXPORT PHP_FUNCTION(udm_get_res_field);
 DLEXPORT PHP_FUNCTION(udm_get_res_param);
+
+DLEXPORT PHP_FUNCTION(udm_free_res);
+DLEXPORT PHP_FUNCTION(udm_free_agent);
 
 #else
 
Index: php4/ext/mnogosearch/test.php
diff -u php4/ext/mnogosearch/test.php:1.5 php4/ext/mnogosearch/test.php:1.6
--- php4/ext/mnogosearch/test.php:1.5   Mon Feb  5 05:12:15 2001
+++ php4/ext/mnogosearch/test.php   Mon Feb  5 07:15:08 2001
@@ -1,6 +1,6 @@
 !-- 
 $Source: /local/repository/php4/ext/mnogosearch/test.php,v $
-$Id: test.php,v 1.5 2001/02/05 13:12:15 gluke Exp $ 
+$Id: test.php,v 1.6 2001/02/05 15:15:08 gluke Exp $ 
 --
 
 html
@@ -43,6 +43,8 @@
 // Udm_Add_Search_Limit($udm,UDM_LIMIT_TAG,"01");
 // Udm_Add_Search_Limit($udm,UDM_LIMIT_CAT,"01");
 // Udm_Add_Search_Limit($udm,UDM_LIMIT_LANG,"en");
+
+//  Udm_Clear_Search_Limits($udm);

 // Stage 4: perform search 
 



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-CVS] cvs: php4 /ext/mnogosearch README php_mnogo.c test.php

2001-02-02 Thread Sergey Kartashoff

gluke   Fri Feb  2 04:54:15 2001 EDT

  Modified files:  
/php4/ext/mnogosearch   README php_mnogo.c test.php 
  Log:
  Added new UDM_PARAM_STOPTABLE and UDM_PARAM_STOPFILE parameters
  for Udm_Set_Agent_Params mnoGoSearch module. Now it can use stopwords
  stored either in database or in the plain text files. Added php warnings.
  Test example updated.
  @- Added new UDM_PARAM_STOPTABLE and UDM_PARAM_STOPFILE parameters
  @  for Udm_Set_Agent_Params mnoGoSearch module. Now it can use stopwords
  @  stored either in database or in the plain text files. Added php warnings.
  @  Test example updated. (gluke)
  
  

Index: php4/ext/mnogosearch/README
diff -u php4/ext/mnogosearch/README:1.2 php4/ext/mnogosearch/README:1.3
--- php4/ext/mnogosearch/README:1.2 Wed Jan 31 06:04:29 2001
+++ php4/ext/mnogosearch/README Fri Feb  2 04:54:14 2001
@@ -1,7 +1,7 @@
 $Source: /local/repository/php4/ext/mnogosearch/README,v $
-$Id: README,v 1.2 2001/01/31 14:04:29 gluke Exp $
+$Id: README,v 1.3 2001/02/02 12:54:14 gluke Exp $
 
-mnoGoSearch extension module version 0.3 for PHP4.
+mnoGoSearch extension module for PHP4.
 Basic mnoGoSearch function implementation.
 
 If used with mysql you should not use bundled mysql library 
@@ -12,8 +12,7 @@
   TODO
   
 
-1. Implement more UdmSearch functions. Only basic minimal functions
-set is implemented for now.
+1. Implement more UdmSearch functions.
 
 2. Fix  config.m4 to detect whether UdmSearch is actually installed.
 Currently there is no any checking. ./configure just trust that UdmSearch
@@ -24,6 +23,3 @@
   Actually it should work fine with other supported database.
 
 4. Write PHP interface documentation.
-
-5. Add nice warnings when unknown parameters are passed to PHP functions.
-Those places are marked with FIXME is php_udm.c
Index: php4/ext/mnogosearch/php_mnogo.c
diff -u php4/ext/mnogosearch/php_mnogo.c:1.3 php4/ext/mnogosearch/php_mnogo.c:1.4
--- php4/ext/mnogosearch/php_mnogo.c:1.3Thu Feb  1 05:06:25 2001
+++ php4/ext/mnogosearch/php_mnogo.cFri Feb  2 04:54:14 2001
@@ -1,5 +1,5 @@
 /* $Source: /local/repository/php4/ext/mnogosearch/php_mnogo.c,v $ */
-/* $Id: php_mnogo.c,v 1.3 2001/02/01 13:06:25 gluke Exp $ */
+/* $Id: php_mnogo.c,v 1.4 2001/02/02 12:54:14 gluke Exp $ */
 
 /*
+--+
@@ -48,6 +48,8 @@
 #define UDM_PARAM_CACHE_MODE   4
 #define UDM_PARAM_TRACK_MODE   5
 #define UDM_PARAM_CHARSET  6
+#define UDM_PARAM_STOPTABLE7
+#define UDM_PARAM_STOPFILE 8
 
 #define UDM_TRACK_ENABLED  1
 #define UDM_TRACK_DISABLED 0
@@ -128,6 +130,8 @@
REGISTER_LONG_CONSTANT("UDM_PARAM_CACHE_MODE",UDM_PARAM_CACHE_MODE,CONST_CS | 
CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_PARAM_TRACK_MODE",UDM_PARAM_TRACK_MODE,CONST_CS | 
CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_PARAM_CHARSET",UDM_PARAM_CHARSET,CONST_CS | 
CONST_PERSISTENT);  
+   REGISTER_LONG_CONSTANT("UDM_PARAM_STOPTABLE",UDM_PARAM_STOPTABLE,CONST_CS | 
+CONST_PERSISTENT);  
+   REGISTER_LONG_CONSTANT("UDM_PARAM_STOPFILE",UDM_PARAM_STOPFILE,CONST_CS | 
+CONST_PERSISTENT);

/* udm_get_res_param constants */
REGISTER_LONG_CONSTANT("UDM_PARAM_FOUND",UDM_PARAM_FOUND,CONST_CS | 
CONST_PERSISTENT);
@@ -285,7 +289,8 @@
break;

default:
-   RETURN_STRING("Udm_Set_Agent_Param: 
Unknown search mode",1);
+   
+php_error(E_WARNING,"Udm_Set_Agent_Param: Unknown search mode");
+   RETURN_FALSE;
break;
}

@@ -303,7 +308,8 @@

default:
Agent-cache_mode=UDM_CACHE_DISABLED;
-   RETURN_STRING("Udm_Set_Agent_Param: Unknown 
cache mode",1);
+   php_error(E_WARNING,"Udm_Set_Agent_Param: 
+Unknown cache mode");
+   RETURN_FALSE;
break;
}

@@ -320,7 +326,8 @@
break;

default:
-   RETURN_STRING("Udm_Set_Agent_Param: Unknown 
track_mode",1);
+   php_error(E_WARNING,"Udm_Set_Agent_Param: 
+Unknown track mode");
+   RETURN_FALSE;
break;
}

@@ -332,34 +339,26 @@
 

[PHP-CVS] cvs: php4 /ext/mnogosearch README config.m4 php_mnogo.c php_mnogo.h setup.stub test.php

2001-01-31 Thread Sergey Kartashoff

gluke   Wed Jan 31 06:04:30 2001 EDT

  Modified files:  
/php4/ext/mnogosearch   README config.m4 php_mnogo.c php_mnogo.h 
setup.stub test.php 
  Log:
  Added search cache and track query features.
  @-Added search cache and track query features.
  # For example please refer at ext/mnogosearch/test.php 
  
  

Index: php4/ext/mnogosearch/README
diff -u php4/ext/mnogosearch/README:1.1 php4/ext/mnogosearch/README:1.2
--- php4/ext/mnogosearch/README:1.1 Tue Jan 30 04:53:49 2001
+++ php4/ext/mnogosearch/README Wed Jan 31 06:04:29 2001
@@ -1,3 +1,6 @@
+$Source: /local/repository/php4/ext/mnogosearch/README,v $
+$Id: README,v 1.2 2001/01/31 14:04:29 gluke Exp $
+
 mnoGoSearch extension module version 0.3 for PHP4.
 Basic mnoGoSearch function implementation.
 
Index: php4/ext/mnogosearch/config.m4
diff -u php4/ext/mnogosearch/config.m4:1.1 php4/ext/mnogosearch/config.m4:1.2
--- php4/ext/mnogosearch/config.m4:1.1  Tue Jan 30 04:53:50 2001
+++ php4/ext/mnogosearch/config.m4  Wed Jan 31 06:04:29 2001
@@ -1,5 +1,5 @@
-dnl $Id: config.m4,v 1.1 2001/01/30 12:53:50 gluke Exp $
-
+dnl $Source: /local/repository/php4/ext/mnogosearch/config.m4,v $
+dnl $Id: config.m4,v 1.2 2001/01/31 14:04:29 gluke Exp $
 
 PHP_ARG_WITH(mnogosearch,for mnoGoSearch support,
 [  --with-mnogosearch[=DIR]   Include mnoGoSearch support.  DIR is the 
mnoGoSearch base
Index: php4/ext/mnogosearch/php_mnogo.c
diff -u php4/ext/mnogosearch/php_mnogo.c:1.1 php4/ext/mnogosearch/php_mnogo.c:1.2
--- php4/ext/mnogosearch/php_mnogo.c:1.1Tue Jan 30 04:53:50 2001
+++ php4/ext/mnogosearch/php_mnogo.cWed Jan 31 06:04:29 2001
@@ -1,3 +1,6 @@
+/* $Source: /local/repository/php4/ext/mnogosearch/php_mnogo.c,v $ */
+/* $Id: php_mnogo.c,v 1.2 2001/01/31 14:04:29 gluke Exp $ */
+
 /*
+--+
| PHP version 4.0  |
@@ -18,8 +21,6 @@
|  Further development by  Sergey Kartashoff [EMAIL PROTECTED]|
+--+
  */
- 
-/* $Id: php_mnogo.c,v 0.3 2001/01/27 15:30:00 */
 
 #include "php.h"
 #include "php_mnogo.h"
@@ -40,12 +41,19 @@
 #define UDM_FIELD_SCORE256
 #define UDM_FIELD_MODIFIED 512
 
+/* udm_set_agent_param constants */
 #define UDM_PARAM_PAGE_SIZE1
 #define UDM_PARAM_PAGE_NUM 2
-#define UDM_PARAM_SEARCH_MODE  4
-#define UDM_PARAM_CHARSET  8
-#define UDM_PARAM_NUM_ROWS 16
-#define UDM_PARAM_FOUND32
+#define UDM_PARAM_SEARCH_MODE  3
+#define UDM_PARAM_CACHE_MODE   4
+#define UDM_PARAM_TRACK_MODE   5
+
+#define UDM_TRACK_ENABLED  1
+#define UDM_TRACK_DISABLED 0
+
+/* udm_get_res_param constants */
+#define UDM_PARAM_NUM_ROWS 256
+#define UDM_PARAM_FOUND257
 
 /* True globals, no need for thread safety */
 static int le_link,le_res;
@@ -112,18 +120,30 @@
REGISTER_LONG_CONSTANT("UDM_FIELD_SCORE",   UDM_FIELD_SCORE,CONST_CS | 
CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_FIELD_MODIFIED",UDM_FIELD_MODIFIED,CONST_CS | 
CONST_PERSISTENT);
 
+   /* udm_set_agent_param constants */
REGISTER_LONG_CONSTANT("UDM_PARAM_PAGE_SIZE",UDM_PARAM_PAGE_SIZE,CONST_CS | 
CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_PARAM_PAGE_NUM",UDM_PARAM_PAGE_NUM,CONST_CS | 
CONST_PERSISTENT);
-   REGISTER_LONG_CONSTANT("UDM_PARAM_SEARCH_MODE",UDM_PARAM_SEARCH_MODE,CONST_CS 
| CONST_PERSISTENT);
-   REGISTER_LONG_CONSTANT("UDM_PARAM_CHARSET",UDM_PARAM_CHARSET,CONST_CS | 
CONST_PERSISTENT);
+   REGISTER_LONG_CONSTANT("UDM_PARAM_SEARCH_MODE",UDM_PARAM_SEARCH_MODE,CONST_CS 
+| CONST_PERSISTENT);  
+   REGISTER_LONG_CONSTANT("UDM_PARAM_CACHE_MODE",UDM_PARAM_CACHE_MODE,CONST_CS | 
+CONST_PERSISTENT);
+   REGISTER_LONG_CONSTANT("UDM_PARAM_TRACK_MODE",UDM_PARAM_TRACK_MODE,CONST_CS | 
+CONST_PERSISTENT);
+   
+   /* udm_get_res_param constants */
REGISTER_LONG_CONSTANT("UDM_PARAM_FOUND",UDM_PARAM_FOUND,CONST_CS | 
CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_PARAM_NUM_ROWS",UDM_PARAM_NUM_ROWS,CONST_CS | 
CONST_PERSISTENT);
-
 
+   /* search modes */
REGISTER_LONG_CONSTANT("UDM_MODE_ALL",UDM_MODE_ALL,CONST_CS | 
CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_MODE_ANY",UDM_MODE_ANY,CONST_CS | 
CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_MODE_BOOL",UDM_MODE_BOOL,CONST_CS | 
CONST_PERSISTENT);
 
+   /* search cache params */
+   REGISTER_LONG_CONSTANT("UDM_CACHE_ENABLED",UDM_CACHE_ENABLED,CONST_CS | 
+CONST_PERSISTENT);
+   REGISTER_LONG_CONSTANT("UDM_CACHE_DISABLED",UDM_CACHE_DISABLED,CONST_CS | 
+CONST_PERSI

[PHP-CVS] cvs: php4 /ext/mnogosearch Makefile.in README config.m4 php_mnogo.c php_mnogo.h setup.stub test.php

2001-01-30 Thread Sergey Kartashoff

gluke   Tue Jan 30 04:54:11 2001 EDT

  Added files: 
/php4/ext/mnogosearch   Makefile.in README config.m4 php_mnogo.c 
php_mnogo.h setup.stub test.php 
  Log:
  mnoGoSearch extension module initial version has been added.
  This module currently at the alpha state, but it can be used already.
  @- mnoGoSearch extension module initial version has been added.
  @  This module currently at the alpha state, but it can be used already.
  # For details about mnoGoSearch please refer at http://search.mnogo.ru
  PR:
  Submitted by:
  Reviewed by:
  Obtained from:
  
  


Index: php4/ext/mnogosearch/Makefile.in
+++ php4/ext/mnogosearch/Makefile.in

LTLIBRARY_NAME= libmnogosearch.la
LTLIBRARY_SOURCES = php_mnogo.c
LTLIBRARY_SHARED_NAME = mnogosearch.la
LTLIBRARY_SHARED_LIBADD = $(MNOGOSEARCH_SHARED_LIBADD)

include $(top_srcdir)/build/dynlib.mk

Index: php4/ext/mnogosearch/config.m4
+++ php4/ext/mnogosearch/config.m4
dnl $Id: config.m4,v 1.1 2001/01/30 12:53:50 gluke Exp $


PHP_ARG_WITH(mnogosearch,for mnoGoSearch support,
[  --with-mnogosearch[=DIR]   Include mnoGoSearch support.  DIR is the mnoGoSearch 
base
  install directory, defaults to /usr/local/udmsearch.])

  if test "$PHP_MNOGOSEARCH" != "no"; then
  
if test "$PHP_MNOGOSEARCH" = "yes"; then
  MNOGOSEARCH_BINDIR=/usr/local/udmsearch/bin
  MNOGOSEARCH_INCDIR=/usr/local/udmsearch/include
  MNOGOSEARCH_LIBDIR=/usr/local/udmsearch/lib
else
  MNOGOSEARCH_BINDIR=$PHP_MNOGOSEARCH/bin
  MNOGOSEARCH_INCDIR=$PHP_MNOGOSEARCH/include
  MNOGOSEARCH_LIBDIR=$PHP_MNOGOSEARCH/lib
fi

AC_ADD_INCLUDE($MNOGOSEARCH_INCDIR)

if test -x "$MNOGOSEARCH_BINDIR/udm-config"; then
PHP_EVAL_LIBLINE(`$MNOGOSEARCH_BINDIR/udm-config --libs`, 
MNOGOSEARCH_SHARED_LIBADD)
else
AC_ADD_LIBRARY_WITH_PATH(udmsearch, $MNOGOSEARCH_LIBDIR, 
MNOGOSEARCH_SHARED_LIBADD)
fi

AC_DEFINE(HAVE_MNOGOSEARCH,1,[ ])

PHP_SUBST(MNOGOSEARCH_SHARED_LIBADD)
PHP_EXTENSION(mnogosearch,$ext_shared)

  fi

Index: php4/ext/mnogosearch/php_mnogo.c
+++ php4/ext/mnogosearch/php_mnogo.c
/*
   +--+
   | PHP version 4.0  |
   +--+
   | Copyright (c) 1997, 1998, 1999, 2000 The PHP Group   |
   +--+
   | This source file is subject to version 2.02 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. |
   | If you did not receive a copy of the PHP license and are unable to   |
   | obtain it through the world-wide-web, please send a note to  |
   | [EMAIL PROTECTED] so we can mail you a copy immediately.   |
   +--+
   | Authors: |
   |  Initial version by  Alex Barkov [EMAIL PROTECTED] |
   |  and Ramil Kalimullin [EMAIL PROTECTED]|
   |  Further development by  Sergey Kartashoff [EMAIL PROTECTED]|
   +--+
 */
 
/* $Id: php_mnogo.c,v 0.3 2001/01/27 15:30:00 */

#include "php.h"
#include "php_mnogo.h"
#include "ext/standard/php_standard.h"
#include "ext/standard/info.h"
#include "php_globals.h"

#ifdef HAVE_MNOGOSEARCH

#define UDM_FIELD_URLID 1
#define UDM_FIELD_URL   2
#define UDM_FIELD_CONTENT   4   
#define UDM_FIELD_TITLE 8
#define UDM_FIELD_KEYWORDS  16
#define UDM_FIELD_DESC  32
#define UDM_FIELD_TEXT  64
#define UDM_FIELD_SIZE  128
#define UDM_FIELD_SCORE 256
#define UDM_FIELD_MODIFIED  512

#define UDM_PARAM_PAGE_SIZE 1
#define UDM_PARAM_PAGE_NUM  2
#define UDM_PARAM_SEARCH_MODE   4
#define UDM_PARAM_CHARSET   8
#define UDM_PARAM_NUM_ROWS  16
#define UDM_PARAM_FOUND 32

/* True globals, no need for thread safety */
static int le_link,le_res;

#include udmsearch.h

function_entry mnogosearch_functions[] = {
PHP_FE(udm_alloc_agent, NULL)
PHP_FE(udm_set_agent_param, NULL)
PHP_FE(udm_free_agent,  NULL)

PHP_FE(udm_errno,   NULL)
PHP_FE(udm_error,   NULL)

PHP_FE(udm_find,NULL)
PHP_FE(udm_free_res,NULL)
PHP_FE(udm_get_res_field,   NULL)
PHP_FE(udm_ge