[PHP-DEV] Re: [PHP-CVS] cvs: php4 / README.TESTING

2002-03-04 Thread derick

On Tue, 5 Mar 2002, Yasuo Ohgaki wrote:

>   "make test" does not work... I'm supposing this
>   will be changed to use CGI sapi for now.

Nope, I'm just fixing it to work with the CLI :)

Derick


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




Re: [PHP-DEV] Re: [PHP-CVS] cvs: php4 / README.TESTING

2002-03-04 Thread derick

On Tue, 5 Mar 2002, Yasuo Ohgaki wrote:

> We should use:
> CGI sapi unless we make test script work with CLI sapi
> or
> Skip tests that does not work with CLI sapi.
>
> I would like to skip tests that does not work with CLI,
> but I don't have time to change run-tsets.php.

I don't think that's the best option. The CLI is always available, and
meant for this kind of things. So I really want option one here (fix
run-tests.php to work with the CLI). (I'm crossposting this to php-qa,
maybe somebody has some time to look into it?)

> Stig is working for it, may be?

AFAIK, he's not.

Derick


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




[PHP-DEV] Re: [PHP-CVS] cvs: php4 / README.TESTING

2002-03-04 Thread Yasuo Ohgaki

[EMAIL PROTECTED] wrote:
> 
> Isn't it an idea just to modify the scripts so that it uses the cli
> version always?
> 

Stig changed so that make test uses cli sapi.
Edin said it wouldn't work, and it does not work for me also.

We should use:
CGI sapi unless we make test script work with CLI sapi
or
Skip tests that does not work with CLI sapi.

I would like to skip tests that does not work with CLI,
but I don't have time to change run-tsets.php.

Stig is working for it, may be?

-- 
Yasuo Ohgaki


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




Re: [PHP-DEV] Re: [PHP-CVS] cvs: php4 / README.TESTING

2002-03-04 Thread derick

On Tue, 5 Mar 2002, Yasuo Ohgaki wrote:

> Thanks for catching this. I should have fix this description for now.
> Test script does _NOT_ work with CLI SAPI's php binary.

Yeah, but why doesn't it work?

Derick


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




[PHP-DEV] Re: [PHP-CVS] cvs: php4 / README.TESTING

2002-03-04 Thread Yasuo Ohgaki

[EMAIL PROTECTED] wrote:
> On Tue, 5 Mar 2002, Yasuo Ohgaki wrote:
> 
> 
>>[Which "php" executable "make test" look for]
>>-
>> "make test" executes "run-tests.php" script with "./sapi/cli/php".
>>Although, "run-tests.php" is executed by CLI SAPI binary, test
>>scripts must be executed by CGI SAPI. Therefore, you must build
>>PHP with CGI SAPI to perform tests.
>>
>> "run-tests.php" look for "php" executable in build top directory,
>>then look for search path. Therefore, if you have "php" executable
>>other than CGI SAPI in your search path or source root, tests may fail.
>>
> 
> Isn't it an idea just to modify the scripts so that it uses the cli
> version always?
> 

Thanks for catching this. I should have fix this desription for now.
Test script does _NOT_ work with CLI SAPI's php binary.

I'll commit fixed version soon.

-- 
Yasuo Ohgaki


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




Re: [PHP-DEV] your patch to session.c broke it (testcase

2002-03-04 Thread Yasuo Ohgaki

Zeev,

Thies is complaining about the same issue that I've mailed
to you personally.

Have you read my emails? I've send 2 emails about the patch,
one with short script that you can play with.

I'll send them again to you, if you didn't get them.

--
Yasuo Ohgaki


Zeev Suraski wrote:
> At 13:18 04/03/2002, Thies C. Arntzen wrote:
> 
>> zeev,
>> your patch
>>
>> http://cvs.php.net/diff.php/php4/ext/session/session.c?r1=1.277&r2=1.278&ty=u 
>>
>>
>> broke the session module:
>>
>> testcase (run multiple times using php-cgi from the command-line)
>>
>> > session_id("thies");
>> session_start();
>> if (! session_is_registered("hallo")) {
>> $hallo = "hi ";
>> session_register('hallo');
>> } else {
>> $hallo = &$_SESSION[ 'hallo' ];
>> }
>> echo "$hallo\n";
>> $hallo .= '!';
>> ?>
>>
>> after your patch the changed value of $hallo is no longer remembered.
>>
>> hmm, as i don't know wich "crash bug" your patch fixes i
>> don't want to simply revert it - could you give me some
>> insights?
> 
> 
> Well, I didn't find any crashes, but it is a potential crash, because 
> the zval is put into the hash with a wrong refcount.  Did you try 
> rolling back this particular patch and it works again?
> 
> You said I should run this using php-cgi from the command line, how 
> exactly is this supposed to work with sessions (which rely on HTTP 
> cookies, or am I missing something? :)
> 
> Zeev
> 


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




Re: [PHP-DEV] your patch to session.c broke it (testcase included)

2002-03-04 Thread derick

Hey Thies,

can you file a bug report for this so that we can use it during the
release process (make it Critical right away :).

Derick

On Tue, 5 Mar 2002, Thies C. Arntzen wrote:

> On Mon, Mar 04, 2002 at 10:42:42PM +0200, Zeev Suraski wrote:
> > At 13:18 04/03/2002, Thies C. Arntzen wrote:
> > >zeev,
> > >your patch
> > >
> > >http://cvs.php.net/diff.php/php4/ext/session/session.c?r1=1.277&r2=1.278&ty=u
> > >
> > >broke the session module:
> > >
> > >testcase (run multiple times using php-cgi from the command-line)
> > >
> > > > >session_id("thies");
> > >session_start();
> > >if (! session_is_registered("hallo")) {
> > >$hallo = "hi ";
> > >session_register('hallo');
> > >} else {
> > >$hallo = &$_SESSION[ 'hallo' ];
> > >}
> > >echo "$hallo\n";
> > >$hallo .= '!';
> > >?>
> > >
> > >after your patch the changed value of $hallo is no longer remembered.
> > >
> > >hmm, as i don't know wich "crash bug" your patch fixes i
> > >don't want to simply revert it - could you give me some
> > >insights?
> >
> > Well, I didn't find any crashes, but it is a potential crash, because the
> > zval is put into the hash with a wrong refcount.  Did you try rolling back
> > this particular patch and it works again?
>
> yep.
>
> >
> > You said I should run this using php-cgi from the command line, how exactly
> > is this supposed to work with sessions (which rely on HTTP cookies, or am I
> > missing something? :)
>
> session_init('hallo'); set's the session ID. running this from
> the commandline works - you could also run in apache.
>
> tc
> >
> > Zeev
> >
> >
> > --
> > PHP Development Mailing List 
> > To unsubscribe, visit: http://www.php.net/unsub.php
>
> --
> PHP Development Mailing List 
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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




Re: [PHP-DEV] Re: cvs: php4 / makerpm

2002-03-04 Thread derick

On Tue, 5 Mar 2002, Yasuo Ohgaki wrote:

> Derick Rethans wrote:
> > derick  Mon Mar  4 05:45:31 2002 EDT
> >
> >   Modified files:
> > /php4   makerpm
> >   Log:
> >   - Fix a path and remove --with-imap
> >
>
> Is there problem with including imap?

The dependencies on Kerberos for the IMAP packages in RedHat are a total
headache (as was explained in the original mail to php-dev@).

regards,
Derick


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




Re: [PHP-DEV] Feature Request for pcre_match*()

2002-03-04 Thread derick

Hello,

can you please post a unified diff (diff -u)? That's much more readable.

regards,
Derick


On Mon, 4 Mar 2002, 'Ricky' S Dhatt wrote:

> Hi -
>
> I'd like to ask that the pcre_match*() functions be modified such that
> they can also return position info on where the match(s) occured, akin to
> Perl's pos(). I think this would be a very useful addition, plus it
> requires minimal code changes since the actual function, php_pcre_match()
> computes the values presently but just throws them away.
>
> I've modified my own build to do this, and I've attached a diff...but I'd
> regard this as proof-of-concept code since I did it in a hurry (so maybe
> it can make 4.2.0?) and I haven't coded in C since my university classes
> couple years back. It's actually kinda of embarassing, but heck I don't
> know any of you. =P.
>
> The only really difficulty would be deciding how to return the
> values...I've thought up a bunch of ways of implementing this
> other than the stupidly simple add another nested array I did, like use a
> resource, a new function, return a 2nd array, etc.
>
>
> --Ricky
>


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




[PHP-DEV] odbc_fetch_into alteration

2002-03-04 Thread Dan Kalowsky

Hello hello!

One of the changes I ment to get into PHP4.1 was this change to
odbc_fetch_into.

Traditionally, the function can take upto three params like so:
odbc_fetch_into(required, [ not required,] required)
Meaning params 1and2 or 1and3 are always required.

To me this is a rather backwards way of doing this, and would like to
correct this behavior to reflect a more consistent style to:
(required, required, [ not required])

Hopefuly this patch does this correctly for al db's.  If any developers
would be so kind to review, comment, and do some testing, I'd appriciate
it.  Thanks.

>---<
Dan Kalowsky"Tonight I think I'll walk alone.
http://www.deadmime.org/~dankI'll find soul as I go home."
[EMAIL PROTECTED]- "Temptation", New Order


Index: php_odbc.c
===
RCS file: /repository/php4/ext/odbc/php_odbc.c,v
retrieving revision 1.119
diff -u -r1.119 php_odbc.c
--- php_odbc.c  4 Mar 2002 09:10:31 -   1.119
+++ php_odbc.c  5 Mar 2002 06:48:13 -
@@ -69,7 +69,7 @@
 
 #define SAFE_SQL_NTS(n) ((SWORD) ((n)?(SQL_NTS):0))
 
-static unsigned char a3_arg3_and_3_force_ref[] = { 3, BYREF_NONE, BYREF_FORCE, 
BYREF_FORCE };
+static unsigned char a3_arg3_and_3_force_ref[] = { 3, BYREF_NONE, BYREF_FORCE, 
+BYREF_ALLOW};
 
 /* {{{ odbc_functions[]
  */
@@ -1379,20 +1379,22 @@
 /* }}} */
 #endif
 
-/* {{{ proto int odbc_fetch_into(int result_id [, int rownumber], array result_array)
+/* {{{ proto int odbc_fetch_into(int result_id, array result_array, [, int 
+rownumber])
Fetch one result row into an array */ 
 PHP_FUNCTION(odbc_fetch_into)
 {
int numArgs, i;
odbc_result *result;
RETCODE rc;
-SWORD sql_c_type;
+   SWORD sql_c_type;
char *buf = NULL;
+   pval **pv_res, **pv_res_arr, *tmp;
 #ifdef HAVE_SQL_EXTENDED_FETCH
+   pval **pv_row;
UDWORD crow;
UWORD  RowStatus[1];
SDWORD rownum = -1;
-   pval **pv_res, **pv_row, **pv_res_arr, *tmp;
+#endif /* HAVE_SQL_EXTENDED_FETCH */

numArgs = ZEND_NUM_ARGS();
 
@@ -1401,26 +1403,18 @@
if (zend_get_parameters_ex(2, &pv_res, &pv_res_arr) == 
FAILURE)
WRONG_PARAM_COUNT;
break;
+#ifdef HAVE_SQL_EXTENDED_FETCH
case 3:
-   if (zend_get_parameters_ex(3, &pv_res, &pv_row, &pv_res_arr) 
== FAILURE)
+   if (zend_get_parameters_ex(3, &pv_res, &pv_res_arr, &pv_row) 
+== FAILURE)
WRONG_PARAM_COUNT;
SEPARATE_ZVAL(pv_row);
convert_to_long_ex(pv_row);
rownum = Z_LVAL_PP(pv_row);
break;
+#endif /* HAVE_SQL_EXTENDED_FETCH */
default:
WRONG_PARAM_COUNT;
}
-
-#else
-   pval **pv_res, **pv_res_arr, *tmp;
-
-   numArgs = ZEND_NUM_ARGS();
-
-   if (numArgs != 2 || zend_get_parameters_ex(2, &pv_res, &pv_res_arr) == 
FAILURE) {
-   WRONG_PARAM_COUNT;
-   }
-#endif
 
ZEND_FETCH_RESOURCE(result, odbc_result *, pv_res, -1, "ODBC result", 
le_result);



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


Re: [PHP-DEV] New Module

2002-03-04 Thread derick

Hey,

why not simply use the mcrypt functions available in PHP?

Derick

On Mon, 4 Mar 2002, Keyser Soze wrote:

> Hi all,
>
> I have developed a new module that may be of interest of you. I'm putting it
> under GNU license.
> The module consist of two functions:
> bool cfg_set(string file,assoc array vars):  it saves configurations in vars
> crypted into file
> array cfg_set(string file):  returns the associative array uncrypted
>
> This module uses a library called libmycrypt.so which must be developed by
> the user and must have two functions:
> char *my_crypt(char *string)
> char *my_decrypt(char *string)
>
> This module was intended two protect the configurations of database like:
> user, pass, ip, dbname, so that even if someones get his hands on the
> php scripts, he can't get those variables.
>
> I just need to comment out the code, but it will be ready tomorrow for sure.
> To where should I send the code, so if you are interested, put in php
> distribution???
>
> Regards,
> Fabricio Olivetti de França
> aka Keyser Soze
>
>
> --
> PHP Development Mailing List 
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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




RE: [PHP-DEV] New Module

2002-03-04 Thread Chris Newbill

PHP already has mcrypt support so doing this in userland wouldn't be
much of a challenge at all.  

See pear.php.net.

-Chris

-Original Message-
From: Keyser Soze [mailto:[EMAIL PROTECTED]] 
Sent: Monday, March 04, 2002 5:58 PM
To: PHP-DEV
Subject: [PHP-DEV] New Module

Hi all,

I have developed a new module that may be of interest of you. I'm
putting it
under GNU license.
The module consist of two functions:
bool cfg_set(string file,assoc array vars):  it saves configurations in
vars
crypted into file
array cfg_set(string file):  returns the associative array uncrypted

This module uses a library called libmycrypt.so which must be developed
by
the user and must have two functions:
char *my_crypt(char *string)
char *my_decrypt(char *string)

This module was intended two protect the configurations of database
like:
user, pass, ip, dbname, so that even if someones get his hands on
the
php scripts, he can't get those variables.

I just need to comment out the code, but it will be ready tomorrow for
sure.
To where should I send the code, so if you are interested, put in php
distribution???

Regards,
Fabricio Olivetti de França
aka Keyser Soze


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


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




Re: [PHP-DEV] your patch to session.c broke it (testcase included)

2002-03-04 Thread Thies C. Arntzen

On Mon, Mar 04, 2002 at 10:42:42PM +0200, Zeev Suraski wrote:
> At 13:18 04/03/2002, Thies C. Arntzen wrote:
> >zeev,
> >your patch
> >
> >http://cvs.php.net/diff.php/php4/ext/session/session.c?r1=1.277&r2=1.278&ty=u
> >
> >broke the session module:
> >
> >testcase (run multiple times using php-cgi from the command-line)
> >
> > >session_id("thies");
> >session_start();
> >if (! session_is_registered("hallo")) {
> >$hallo = "hi ";
> >session_register('hallo');
> >} else {
> >$hallo = &$_SESSION[ 'hallo' ];
> >}
> >echo "$hallo\n";
> >$hallo .= '!';
> >?>
> >
> >after your patch the changed value of $hallo is no longer remembered.
> >
> >hmm, as i don't know wich "crash bug" your patch fixes i
> >don't want to simply revert it - could you give me some
> >insights?
> 
> Well, I didn't find any crashes, but it is a potential crash, because the 
> zval is put into the hash with a wrong refcount.  Did you try rolling back 
> this particular patch and it works again?

yep.

> 
> You said I should run this using php-cgi from the command line, how exactly 
> is this supposed to work with sessions (which rely on HTTP cookies, or am I 
> missing something? :)

session_init('hallo'); set's the session ID. running this from
the commandline works - you could also run in apache.

tc
> 
> Zeev
> 
> 
> -- 
> PHP Development Mailing List 
> To unsubscribe, visit: http://www.php.net/unsub.php

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




[PHP-DEV] Feature Request for pcre_match*()

2002-03-04 Thread 'Ricky' S Dhatt

Hi -

I'd like to ask that the pcre_match*() functions be modified such that
they can also return position info on where the match(s) occured, akin to
Perl's pos(). I think this would be a very useful addition, plus it
requires minimal code changes since the actual function, php_pcre_match()
computes the values presently but just throws them away.

I've modified my own build to do this, and I've attached a diff...but I'd
regard this as proof-of-concept code since I did it in a hurry (so maybe
it can make 4.2.0?) and I haven't coded in C since my university classes
couple years back. It's actually kinda of embarassing, but heck I don't
know any of you. =P.

The only really difficulty would be deciding how to return the
values...I've thought up a bunch of ways of implementing this
other than the stupidly simple add another nested array I did, like use a
resource, a new function, return a 2nd array, etc.


--Ricky


326d324
< 

328c326
<   zval**position; /* Option to return match positions */

---
> 

342d339
<   int  position_val  = 0; /* Integer value of 
position_flag */
369,387c366
<   /* Make sure subpats_order*/ 

<   convert_to_long_ex(subpats_order);

<   

<   subpats_order_val = Z_LVAL_PP(subpats_order);

< 

<   if (subpats_order_val < PREG_PATTERN_ORDER ||

<   subpats_order_val > PREG_SET_ORDER) {

<   zend_error(E_WARNING, "Wrong value for parameter 4 in 
call to preg_match_all()");

<   }

< 

< 

<   break;

<   case 5:

<   if (zend_get_parameters_ex(5, ®ex, &subject, &subpats, 
&subpats_order, &position) == FAILURE) {

<   WRONG_PARAM_COUNT;

<   }

<   

<   
<   /* Make sure subpats_order/ position flag is a number */
---
>   /* Make sure subpats_order is a number */
389,390d367
<   convert_to_long_ex(position);

< 
392,393d368
<   position_val = Z_LVAL_PP(position);

< 

429d403
<   if (position_val) {

431d404
<   }

439d411
<   if (position_val) {

443d414
<   }

482a456,459
>   /* add position information */

> 

> 
> 
487,491c464
<   

<   /* add position information */

< 

<   if (position_val) {

<   pos = (char 
*)emalloc(16 * sizeof(char));

---
>   pos = (char *)emalloc(5 * 
>sizeof(char));

499,500d471
<   }

< 

525,526d495
< 

<   if (position_val) {

531c500
<   pos = (char *)emalloc(16 * 
sizeof(char));   
---
>   pos = (char *)emalloc(5 * 
>sizeof(char));
542d510
<   
zend_hash_next_index_insert(Z_ARRVAL_P(result_set), &match_sets_pos[0], sizeof(zval 
*), NULL);

545c513
<   }

---
>   
>zend_hash_next_index_insert(Z_ARRVAL_P(result_set), &match_sets_pos[0], sizeof(zval 
>*), NULL);

590d557
<   if(position_val) {

592d558
<   } 
596d561
<   if (position_val) { 

598,600d562
<   efree(pos); 

<   }

<   


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


[PHP-DEV] Re: cvs: php4 / makerpm

2002-03-04 Thread Yasuo Ohgaki

Derick Rethans wrote:
> derickMon Mar  4 05:45:31 2002 EDT
> 
>   Modified files:  
> /php4 makerpm 
>   Log:
>   - Fix a path and remove --with-imap
>   

Is there problem with including imap?
-- 
Yasuo Ohgaki


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




Re: [PHP-DEV] Re: Function to retrieve headers for message/rfc822 attachments

2002-03-04 Thread Vlad Krupin

Sorry, I'm just catching up with email backlog, so this email might be 
irrelevant by now, but just in case it isn't:

imap_fetch_header() is probably not a very good name because we already have 
imap_fetchheader() and I believe they might be a bit too similar in names (I don't 
know what the proposed function does, if it is good or not, I just don't like the 
name). IMAP extension has already got a good share of confusingly similar function 
names IMHO.

$.02

Vlad


Brad Fisher wrote:

>Here is my attempt at a unified diff against the current CVS.  Let me
>know if I need to do anything differently.
>
>-Brad
>
>--  diff for php_imap.c ---
>
>--- php_imap.c
>+++ php_imap.c  Tue Feb 26 23:00:58 2002
>@@ -91,6 +91,7 @@
>
>PHP_FE(imap_bodystruct,
>NULL)
>
>PHP_FE(imap_fetchbody,
>NULL)
>
>PHP_FE(imap_fetchheader,
>NULL)
>+
>PHP_FE(imap_fetch_header,
>NULL)
>
>PHP_FE(imap_fetchstructure,
>NULL)
>
>PHP_FE(imap_expunge,
>NULL)
>
>PHP_FE(imap_delete,
>NULL)
>@@ -2582,6 +2583,99 @@
>RETVAL_STRING(mail_fetchheader_full(imap_le_struct->imap_stream,
>Z_LVAL_PP(msgno), NIL, NIL, (myargc == 3 ? Z_LVAL_PP(flags) : NIL)), 1);
>
> }
> /* }}} */
>+
>+
>+
>+/* {{{ proto string imap_fetch_header(int stream_id, int msg_no [,
>string section [, array lines [, int options]]])
>+   Get the (optionally filtered) header for a given section of a
>message */
>+PHP_FUNCTION(imap_fetch_header)
>+{
>+/*
>+   NOTE: You need to explicitly set FT_PEEK to not mark message as READ
>when calling this function.
>+   Empty strings are ignored in the lines array.
>+*/
>+zval **streamind, **msgno, **sec = NIL, **lines = NIL, **flags,
>**tmp;
>+int i, ind, ind_type, msgindex;
>+pils *imap_le_struct;
>+int myargc = ZEND_NUM_ARGS();
>+HashPosition pos;
>+STRINGLIST *cur_lines = NIL, *cur;
>+
>+if (myargc < 2 ||
>+myargc > 5 ||
>+zend_get_parameters_ex(myargc, &streamind, &msgno, &sec,
>&lines, &flags) == FAILURE)
>+{
>+ZEND_WRONG_PARAM_COUNT();
>+} //if
>+
>+convert_to_long_ex(streamind);
>+convert_to_long_ex(msgno);
>+
>+if (myargc > 2) {
>+convert_to_string_ex(sec);
>+} //if
>+
>+/* Convert the  array to a STRINGLIST */
>+if (myargc > 3) {
>+convert_to_array_ex(lines);
>+
>+zend_hash_internal_pointer_reset_ex((*lines)->value.ht,
>&pos);
>+while
>(zend_hash_get_current_data_ex((*lines)->value.ht, (void **) &tmp, &pos)
>== SUCCESS) {
>+convert_to_string_ex(tmp);
>+
>+// Only add to the filter list if not an empty
>string
>+if (*Z_STRVAL_PP(tmp)) {
>+if (cur_lines) {
>+cur->next =
>mail_newstringlist();
>+cur = cur->next;
>+} else {
>+cur_lines =
>mail_newstringlist();
>+cur = cur_lines;
>+} //if
>+
>+cur->LSIZE = (*tmp)->value.str.len;
>+cur->LTEXT = (char*)
>cpystr((*tmp)->value.str.val);
>+} //if
>+
>+zend_hash_move_forward_ex((*lines)->value.ht,
>&pos);
>+} //while
>+} //if
>+
>+if (myargc == 5) {
>+convert_to_long_ex(flags);
>+} //if
>+ind = Z_LVAL_PP(streamind);
>+
>+imap_le_struct = (pils *) zend_list_find(ind, &ind_type);
>+//  if (!imap_le_struct || !IS_STREAM(ind_type)) {
>+if (!imap_le_struct) {
>+php_error(E_WARNING, "Unable to find stream pointer");
>+RETURN_FALSE;
>+} //if
>+
>+if ((myargc == 5) && (Z_LVAL_PP(flags) & FT_UID)) {
>+/* This should be cached; if it causes an extra RTT to the
>+   IMAP server, then that's the price we pay for making sure
>+   we don't crash. */
>+msgindex = mail_msgno(imap_le_struct->imap_stream,
>Z_LVAL_PP(msgno));
>+} else {
>+msgindex = Z_LVAL_PP(msgno);
>+} //if
>+if ((msgindex < 1) || ((unsigned) msgindex >
>imap_le_struct->imap_stream->nmsgs)) {
>+php_error(E_WARNING, "Bad message number");
>+RETURN_FALSE;
>+} //if
>+
>+/* Perform the header fetch */
>+RETVAL_STRING(mail_fetch_header(imap_le_struct->imap_stream,
>Z_LVAL_PP(msgno), Z_STRVAL_PP(sec),
>+cur_lines, NIL, myargc==5 ?
>Z_LVAL_PP(flags) : NIL), 1);
>+
>+/* Free the temporary string list */
>+mail_free_stringlist(&cur_lines);
>+} // PHP_FUNCTION(imap_fetch_header)
>+/* }}} */
>+
>+
>
> /* {{{ proto int imap_uid(int stream_id

[PHP-DEV] Re: [PHP] Does function ImageTTFText work with php 4.1.2 and freetype 2.0.5?

2002-03-04 Thread Tom Rogers

Hi
The following worked for me with gd gd-2.0.1 php-4.1.2  freetype-2.0.5



(putting html in the jpeg output didn't work for me :)

for other people having trouble getting this to work here are the various 
settings that worked for me on linux:

gd-2.0.1 Makefile...
CFLAGS=-g -DHAVE_LIBPNG -DHAVE_LIBJPEG -DHAVE_LIBFREETYPE -DHAVE_XPM
LIBS=-lgd -lpng -lz -ljpeg -lfreetype -lXpm -lm
INCLUDEDIRS=-I. -I/usr/local/jpeg-6b 
-I/usr/include/freetype2  -I/usr/include/X11  -I/usr/X11R6/include/X11 
-I/usr/include

freetype-2.0.5 was built with:
make setup CFG="--prefix=/usr"

and php was configured with:
./configure \
--prefix=/usr \
--with-apache=/usr/src/apache_1.3.23 \
--enable-trans-sid \
--with-swf=/usr \
--with-vpopmail=/usr/local/apache \
--with-jpeg-dir=/usr/src/jpeg-6b \
--with-tiff-dir=/usr/src/tiff-v3.5.5 \
--with-png-dir=/usr/src/libpng-1.2.0 \
--with-zlib-dir=/usr/src/zlib \
--with-xpm-dir=/usr/X11R6 \
--with-pdflib \
--with-mysql=/usr/local/mysql \
--enable-static-pddflib \
--enable-ftp \
--with-gd=/usr \
--enable-gd-native-tt \
--enable-gd-imgstrttf \
--with-freetype-dir=/usr/include/freetype2 \
--with-mcrypt=/usr/src/mcrypt-2.5.10 \
--with-mhash=/usr/src/mhash-0.8.9 \
--with-pspell=/usr \
--enable-track-vars

Hope this helps
Tom




At 08:01 AM 5/03/2002, Ziying Sherwin wrote:

>We installed php 4.1.2 with freetype 2.0.5 library support on our Solaris
>2.8 machine using gcc 2.95.2. However, the php function ImageTTFText()
>stopped to work properly with the new installation.
>
>We used the following sample code from php web site for testing:
>
>
>   Header("Content-type: image/jpeg");
>
>   $im = @imagecreate (400, 30);
>   $black = ImageColorAllocate ($im, 0, 0, 0);
>   $white = ImageColorAllocate ($im, 255, 255, 255);
>   ImageTTFText ($im, 20, 0, 10, 20, $white, 
> "/usr/openwin/lib/X11/fonts/TrueType/TimesNewRoman.ttf", "Testing... 
> Omega: Ω");
>
>   echo " TTF result  bgcolor=\"white\"> ";
>   echo " ";
>
>   ImageDestroy ($im);
>?>
>
>But there is no text generated in the image. When we tried to use cyberbit
>fonts to generate a UTF-8 string, we kept getting the warning message and
>no image file is generated.
>
>The same code works with php 4.0.1 and freetype 1.3.1 library. So is it a
>problem with php 4.1.1 and freetype 2 library? Is there anyone who 
>successfully used php 4.1.2 with freetype 2 library?
>
>I am not on the mailing list, please send emails to [EMAIL PROTECTED]
>
>Thanks,
>Ziying Sherwin
>
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php


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




Re: [PHP-DEV] {NULL,NULL,NULL}

2002-03-04 Thread Vlad Krupin

Sorry, couldn't reply earlier - I was away on my honeymoon ;)

Yes, the change is cool - I guess, I was too happy with the 'Cut' 
shortcut when Copy&Pasting code from aspell a couple of years ago :) 
Thanks for noticing

Vlad


Yasuo Ohgaki wrote:

> [EMAIL PROTECTED] wrote:
>
>>  ID:   15607
>>  Updated by:   [EMAIL PROTECTED]
>>  Reported By:  [EMAIL PROTECTED]
>> -Status:   Feedback
>> +Status:   Closed
>>  Bug Type: *Spelling functions
>>  Operating System: Solaris 5.7
>>  PHP Version:  4.1.1
>>  New Comment:
>>
>> Thanks for your report. I've added function entry terminator.
>> If you still have problem(s), let us know.
>>
>>
>> Previous Comments:
>> 
>>
>> [2002-02-21 20:08:10] [EMAIL PROTECTED]
>>
>> I believe I have found the bug.  I'm no PHP coder, but I believe that a
>> {NULL, NULL, NULL} is required at the end of pspell_functions.  The
>
>
> Users say pspell was working even without {NULL,NULL,NULL}
> in function entry.
>
> Module maintainers might want to check your extension(s)
> see if it's ok.
>
> Just my .02 :)





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




[PHP-DEV] New Module

2002-03-04 Thread Keyser Soze

Hi all,

I have developed a new module that may be of interest of you. I'm putting it
under GNU license.
The module consist of two functions:
bool cfg_set(string file,assoc array vars):  it saves configurations in vars
crypted into file
array cfg_set(string file):  returns the associative array uncrypted

This module uses a library called libmycrypt.so which must be developed by
the user and must have two functions:
char *my_crypt(char *string)
char *my_decrypt(char *string)

This module was intended two protect the configurations of database like:
user, pass, ip, dbname, so that even if someones get his hands on the
php scripts, he can't get those variables.

I just need to comment out the code, but it will be ready tomorrow for sure.
To where should I send the code, so if you are interested, put in php
distribution???

Regards,
Fabricio Olivetti de França
aka Keyser Soze


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




[PHP-DEV] Does function ImageTTFText work with php 4.1.2 and freetype 2.0.5?

2002-03-04 Thread Ziying Sherwin


We installed php 4.1.2 with freetype 2.0.5 library support on our Solaris
2.8 machine using gcc 2.95.2. However, the php function ImageTTFText()
stopped to work properly with the new installation. 

We used the following sample code from php web site for testing:

 TTF result  
";
  echo " ";

  ImageDestroy ($im);
?>

But there is no text generated in the image. When we tried to use cyberbit 
fonts to generate a UTF-8 string, we kept getting the warning message and 
no image file is generated.

The same code works with php 4.0.1 and freetype 1.3.1 library. So is it a 
problem with php 4.1.1 and freetype 2 library? Is there anyone who successfully used 
php 4.1.2 with freetype 2 library?

I am not on the mailing list, please send emails to [EMAIL PROTECTED]

Thanks,
Ziying Sherwin




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




Re: [PHP-DEV] Re: Get object name

2002-03-04 Thread Hartmut Holzgraefe

l0t3k wrote:
> you can do this only with a not-so nice hack. essentially you have to
> manually search the active symbol table stack for a zval * which equals your
> variable. zend_hash_find wont help you, since you're doing a "reverse"
> lookup. 

... and your chances of getting the right name in case of
assignments by reference are 50/50:

print_obj_name();
$b->print_obj_name();
?>

reuslt will be either

   a
   a

or

   b
   b

but not

   a
   b


-- 
Hartmut Holzgraefe  [EMAIL PROTECTED]  http://www.six.de  +49-711-99091-77

Wir stellen für Sie aus auf der CeBIT 2002 und freuen uns
in Halle 6 auf Ihren Besuch am Stand H 18


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




[PHP-DEV] php_error & $php_erormsg

2002-03-04 Thread Marcus Boerger

Question, do we have a function that resets the $php_errormsg variable 
before returning
from a php function (Then one could write E_NOTICE to log but not generae 
info returning
in $php_errormsg)?

marcus


->>> mailto:[EMAIL PROTECTED] <<<
 I don't want to start any blashphemous rumours
 but i think that god's got a sick sense of humor
 and when i die i expect to find him laughing.
  Depeche Mode
--->>> http://www.marcus-boerger.de <<<---


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




[PHP-DEV] Re: Get object name

2002-03-04 Thread l0t3k

you can do this only with a not-so nice hack. essentially you have to
manually search the active symbol table stack for a zval * which equals your
variable. zend_hash_find wont help you, since you're doing a "reverse"
lookup. so the process is something like (totally OTTOMH)

HashTable *table = EG(active_symbol_table);
char *name_im_looking_for = NULL;

while (table && !name_im_looking_for) {
if (name_im_looking_for = find_name(table, zval
*zval_ptr_im_looking_for)) break;
table = get_prev_symbol_table(); /* you're on your own here - i have
no idea how to do this*/
}


static char *find_name(HashTable * table, zval *zval_ptr_im_looking_for)
{
zval **entry;

 zend_hash_internal_pointer_reset(table);
 while (zend_hash_get_current_data( hash, (void**)&entry) == SUCCESS) {
if (*entry = zval_ptr_im_looking_for) {
  char *string_key;
  ulong num_key, key_len;

  if (HASH_KEY_IS_STRING ==
zend_hash_get_current_key_ex(hash, &string_key, &key_len, &num_key, 0,
NULL)) {
return string_key:
   }

 }
zend_hash_move_forward(hash);
}   /* while */
return NULL;
}

- Original Message -
From: Klaus Reimer <[EMAIL PROTECTED]>
Newsgroups: php.dev
To: <[EMAIL PROTECTED]>
Sent: Monday, March 04, 2002 3:11 PM
Subject: Get object name


> Hi,
>
> I need to acces the name of an object in a class method written in C. How
can
> I do this? Example:
>
> I have the following PHP code
>
>   $Test=new CMyClass();
>   $Test->print_obj_name();
>
> and I have the following print_obj_name()-method written in C:
>
>   ZEND_NAMED_FUNCTION(cmyclass_print_obj_name) {
> zend_printf("%s\n",doSomethingMagic());
>   }
>
> How can I do the doSomethingMagic() part so my method prints the object
name
> ("Test")? I can access the CLASS name with
>
>   getThis()->value.obj.ce->name
>
> but I need the variable name of the class instance ("Test" in this case).
How
> can I do this?
>
> --
> Bye, K 
> [A735 47EC D87B 1F15 C1E9  53D3 AA03 6173 A723 E391]
> (Finger [EMAIL PROTECTED] to get public key)
Klaus Reimer <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED].;
> Hi,
>
> I need to acces the name of an object in a class method written in C. How
can
> I do this? Example:
>
> I have the following PHP code
>
>   $Test=new CMyClass();
>   $Test->print_obj_name();
>
> and I have the following print_obj_name()-method written in C:
>
>   ZEND_NAMED_FUNCTION(cmyclass_print_obj_name) {
> zend_printf("%s\n",doSomethingMagic());
>   }
>
> How can I do the doSomethingMagic() part so my method prints the object
name
> ("Test")? I can access the CLASS name with
>
>   getThis()->value.obj.ce->name
>
> but I need the variable name of the class instance ("Test" in this case).
How
> can I do this?
>
> --
> Bye, K 
> [A735 47EC D87B 1F15 C1E9  53D3 AA03 6173 A723 E391]
> (Finger [EMAIL PROTECTED] to get public key)



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




Re: [PHP-DEV] your patch to session.c broke it (testcase included)

2002-03-04 Thread Zeev Suraski

At 13:18 04/03/2002, Thies C. Arntzen wrote:
> zeev,
> your patch
> 
>http://cvs.php.net/diff.php/php4/ext/session/session.c?r1=1.277&r2=1.278&ty=u
>
> broke the session module:
>
> testcase (run multiple times using php-cgi from the command-line)
>
>session_id("thies");
>session_start();
>if (! session_is_registered("hallo")) {
> $hallo = "hi ";
> session_register('hallo');
>} else {
> $hallo = &$_SESSION[ 'hallo' ];
>}
>echo "$hallo\n";
>$hallo .= '!';
>?>
>
> after your patch the changed value of $hallo is no longer remembered.
>
> hmm, as i don't know wich "crash bug" your patch fixes i
> don't want to simply revert it - could you give me some
> insights?

Well, I didn't find any crashes, but it is a potential crash, because the 
zval is put into the hash with a wrong refcount.  Did you try rolling back 
this particular patch and it works again?

You said I should run this using php-cgi from the command line, how exactly 
is this supposed to work with sessions (which rely on HTTP cookies, or am I 
missing something? :)

Zeev


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




Re: [PHP-DEV] php_ticks.c patch

2002-03-04 Thread Zeev Suraski

Looks fine...

At 12:51 04/03/2002, Jon Parise wrote:
>The following patch quells a warning under 'cc: WorkShop
>Compilers 5.0 98/12/15 C 5.0' (Solaris 8).  I think it's
>theoretically correct, but I'd like a second opinion before I
>commit the change.
>
>--
>Jon Parise ([EMAIL PROTECTED])  .  Information Technology (2001)
>http://www.csh.rit.edu/~jon/  :  Computer Science House Member
>
>--
>PHP Development Mailing List 
>To unsubscribe, visit: http://www.php.net/unsub.php


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




[PHP-DEV] Get object name

2002-03-04 Thread Klaus Reimer

Hi,

I need to acces the name of an object in a class method written in C. How can 
I do this? Example:

I have the following PHP code

  $Test=new CMyClass();
  $Test->print_obj_name();

and I have the following print_obj_name()-method written in C:

  ZEND_NAMED_FUNCTION(cmyclass_print_obj_name) {
zend_printf("%s\n",doSomethingMagic());
  }

How can I do the doSomethingMagic() part so my method prints the object name 
("Test")? I can access the CLASS name with

  getThis()->value.obj.ce->name

but I need the variable name of the class instance ("Test" in this case). How 
can I do this? 

-- 
Bye, K 
[A735 47EC D87B 1F15 C1E9  53D3 AA03 6173 A723 E391]
(Finger [EMAIL PROTECTED] to get public key)

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




[PHP-DEV] Re: New function (repost from php-cvs)

2002-03-04 Thread Jim Winstead

Marcus Boerger <[EMAIL PROTECTED]> wrote:
> what about a new function called strnlen str*n*len which will
> return the length of a string with a given maximum to avoid
> problems with strings not zero terminated.

why not just use memchr()?

jim

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




[PHP-DEV] New function (repost from php-cvs)

2002-03-04 Thread Marcus Boerger

hi guys,

what about a new function called strnlen str*n*len which will
return the length of a string with a given maximum to avoid
problems with strings not zero terminated.

i suggest we put this in a single .c file near strlcpy.c

/* {{{ php_strnlen
  * get length of string if buffer if less than buffer size or buffer size */
static size_t php_strnlen( char* str, size_t maxlen) {
 size_t len = 0;

 if ( str && maxlen && *str) {
 do {
 len++;
 } while ( --maxlen && *(++str));
 }
 return len;
}
/* }}} */

I already had a small discussion with Andy

 >Andi: There aren't supposed to be strings which aren't zero terminated 
and if there are it should be fixed (or am I missing something?).

Of cause not but currently i am working on ext/exif and i cannot assume 
that a file is correct.
So when i scan a buffer whose length i now i cannot exceed it's length when 
searching for
NUL to determine its string length. I must stop searching for NUL if buffer 
end is reached.
Also there are situations in which you have a string with now NUL from 
outside PHP
(which was one of the many errors in exif.c) 

So i think i am not the only one who use this...(or shoul i say must use 
this for savety reasons?)

marcus




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




[PHP-DEV] Re: [PHP-CVS] cvs: php4 /ext/standard info.c

2002-03-04 Thread Sebastian Bergmann

Sascha Schumann wrote:
>   Log:
>   revert last commit, puts does more through putc.

  ... and I was half-way through coming up with a patch to make this work
  in thread-safe builds :-)

-- 
  Sebastian Bergmann
  http://sebastian-bergmann.de/ http://phpOpenTracker.de/

  Did I help you? Consider a gift: http://wishlist.sebastian-bergmann.de/

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




Re: [PHP-DEV] PHP module creation

2002-03-04 Thread Steven J. Sobol

On Mon, 4 Mar 2002, Rasmus Lerdorf wrote:

> Yup, it is.  But you still need to add that PHP_EXTENSION line to your
> config.m4 if it isn't already there.

Did that. I actually got dl'ing of my test module working using phpize.
Wrote a function that displays info in phpinfo() too. I think it's pretty
cool, but then I'm a bit of an oddball...
 
> -Rasmus
> 
> On Mon, 4 Mar 2002, Steven J. Sobol wrote:
> 
> > On Sun, 3 Mar 2002, Rasmus Lerdorf wrote:
> >
> > > Make sure you have:
> > >
> > > PHP_EXTENSION(exif, $ext_shared)
> > >
> > > in your config.m4 and then simply do:
> > >
> > >   ./configure --with-foo=shared
> > >
> > > You will find it in your ./modules directory.
> >
> > I haven't tried this yet. I will later. I did find phpize, which is nice
> > to have because I don't necessarily want to have to have the entire source
> > tarball sitting there just to build one extension. Is the use of phpize
> > officially supported? Thanks
> >
> > --
> > JustThe.net LLC - Steve "Web Dude" Sobol, CTO  ICQ: 56972932/WebDude216
> > website: http://JustThe.net  email: [EMAIL PROTECTED]  phone: 216.619.2NET
> > postal: 5686 Davis Drive, Mentor On The Lake, OH 44060-2752  DalNet: ZX-2
> >
> >
> 
> 

-- 
JustThe.net LLC - Steve "Web Dude" Sobol, CTO  ICQ: 56972932/WebDude216
website: http://JustThe.net  email: [EMAIL PROTECTED]  phone: 216.619.2NET 
postal: 5686 Davis Drive, Mentor On The Lake, OH 44060-2752  DalNet: ZX-2



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




[PHP-DEV] [PATCH] add appname argument to sybase_connect

2002-03-04 Thread Christophe Sollet

Attached patch add an optional 'appname' argument to sybase_connect
(both ct and db interface).
The first goal of this patch is, obviously, to be able to set the
appname to something more informative that just 'PHP 4.0' if your db
server is php dedicaced.

Futhermore, it's allow to make separate connections in the same script
to the same db since the appname become part of the hashed details :
It's needed when, for example, you have a connection inside a
transaction and you have to make a query that can't be done inside this
transaction.
Without this patch, this sort of things is impossible in PHP (or you
have to play with the case of the username to fool the
hashed_details...).

The patch is well tested with the ct interface (applied on our systems
from several weeks) and poorly tested with the db interface (simple
connect test).

Could someone review it and commit it (it's against current CVS) ?


Christophe.

--
--
Christophe Sollet
[EMAIL PROTECTED]

http://www.coleebris.com
Tél: 01.40.50.60.47
Fax: 01.40.50.67.66
--




Index: sybase_ct/php_sybase_ct.c
===
RCS file: /repository/php4/ext/sybase_ct/php_sybase_ct.c,v
retrieving revision 1.68
diff -u -r1.68 php_sybase_ct.c
--- sybase_ct/php_sybase_ct.c   11 Dec 2001 15:30:42 -  1.68
+++ sybase_ct/php_sybase_ct.c   4 Mar 2002 15:00:26 -
@@ -371,7 +371,7 @@
 }
 
 
-static int php_sybase_do_connect_internal(sybase_link *sybase, char *host, char 
*user, char *passwd, char *charset)
+static int php_sybase_do_connect_internal(sybase_link *sybase, char *host, char 
+*user, char *passwd, char *charset, char *appname)
 {
CS_LOCALE *tmp_locale;
TSRMLS_FETCH();
@@ -395,7 +395,11 @@
if (passwd) {
ct_con_props(sybase->connection, CS_SET, CS_PASSWORD, passwd, 
CS_NULLTERM, NULL);
}
-   ct_con_props(sybase->connection, CS_SET, CS_APPNAME, SybCtG(appname), 
CS_NULLTERM, NULL);
+   if (appname) {
+   ct_con_props(sybase->connection, CS_SET, CS_APPNAME, appname, 
+CS_NULLTERM, NULL);
+   } else { 
+   ct_con_props(sybase->connection, CS_SET, CS_APPNAME, SybCtG(appname), 
+CS_NULLTERM, NULL);
+   }
 
if (SybCtG(hostname)) {
ct_con_props(sybase->connection, CS_SET, CS_HOSTNAME, 
SybCtG(hostname), CS_NULLTERM, NULL);
@@ -442,17 +446,17 @@
 
 static void php_sybase_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
 {
-   char *user, *passwd, *host, *charset;
+   char *user, *passwd, *host, *charset, *appname;
char *hashed_details;
int hashed_details_length;
sybase_link *sybase_ptr;
 
switch(ZEND_NUM_ARGS()) {
case 0: /* defaults */
-   host=user=passwd=charset=NULL;
-   hashed_details_length=6+4;
+   host=user=passwd=charset=appname=NULL;
+   hashed_details_length=6+5;
hashed_details = (char *) emalloc(hashed_details_length+1);
-   strcpy(hashed_details, "sybase");
+   strcpy(hashed_details, "sybase_");
break;
case 1: {
pval *yyhost;
@@ -462,10 +466,10 @@
}
convert_to_string(yyhost);
host = Z_STRVAL_P(yyhost);
-   user=passwd=charset=NULL;
-   hashed_details_length = Z_STRLEN_P(yyhost)+6+4;
+   user=passwd=charset=appname=NULL;
+   hashed_details_length = Z_STRLEN_P(yyhost)+6+5;
hashed_details = (char *) 
emalloc(hashed_details_length+1);
-   sprintf(hashed_details, "sybase_%s___", 
Z_STRVAL_P(yyhost));
+   sprintf(hashed_details, "sybase_%s", 
+Z_STRVAL_P(yyhost));
}
break;
case 2: {
@@ -478,10 +482,10 @@
convert_to_string(yyuser);
host = Z_STRVAL_P(yyhost);
user = Z_STRVAL_P(yyuser);
-   passwd=charset=NULL;
-   hashed_details_length = 
Z_STRLEN_P(yyhost)+Z_STRLEN_P(yyuser)+6+4;
+   passwd=charset=appname=NULL;
+   hashed_details_length = 
+Z_STRLEN_P(yyhost)+Z_STRLEN_P(yyuser)+6+5;
hashed_details = (char *) 
emalloc(hashed_details_length+1);
-   sprintf(hashed_details, "sybase_%s_%s__", 
Z_STRVAL_P(yyhost), Z_STRVAL_P(yyuser));
+   sprintf(hashed_details, "sybase_%s_%s___", 
+Z_STRVAL_P(yyhost), Z_STRVAL_P(yyuser

Re: [PHP-DEV] FW: [PHP-CVS] cvs: php4 /ext/odbc birdstep.c config.m4 php_birstep.h php_odbc.c php_odbc.h php_velocis.h setup.stub velocis.c /main build-defs.h.in

2002-03-04 Thread Steve Meyers

[EMAIL PROTECTED] wrote:

> On Mon, 4 Mar 2002, James Cox wrote:
> 
>> if anyone has access to a Birdstep server (velocis) can you QA this? I'm
>> waiting on seeing if the Birdstep company will send me a copy of their
>> product - however it's just name changes..
> 
> It should get tested anyway, you could have made typoes p.e.
> 
> Derick
> 
>> -Original Message-
>> /php4/ext/odbc   birdstep.c php_birstep.h

There are typos just in the filename...

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




Re: [PHP-DEV] PHP module creation

2002-03-04 Thread Rasmus Lerdorf

Yup, it is.  But you still need to add that PHP_EXTENSION line to your
config.m4 if it isn't already there.

-Rasmus

On Mon, 4 Mar 2002, Steven J. Sobol wrote:

> On Sun, 3 Mar 2002, Rasmus Lerdorf wrote:
>
> > Make sure you have:
> >
> > PHP_EXTENSION(exif, $ext_shared)
> >
> > in your config.m4 and then simply do:
> >
> >   ./configure --with-foo=shared
> >
> > You will find it in your ./modules directory.
>
> I haven't tried this yet. I will later. I did find phpize, which is nice
> to have because I don't necessarily want to have to have the entire source
> tarball sitting there just to build one extension. Is the use of phpize
> officially supported? Thanks
>
> --
> JustThe.net LLC - Steve "Web Dude" Sobol, CTO  ICQ: 56972932/WebDude216
> website: http://JustThe.net  email: [EMAIL PROTECTED]  phone: 216.619.2NET
> postal: 5686 Davis Drive, Mentor On The Lake, OH 44060-2752  DalNet: ZX-2
>
>


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




[PHP-DEV] PHP4 & SQL: Invalid statement

2002-03-04 Thread Cato Larsen

Hello!
When I run this SQL in PHP I get an error:

Snip -->
$sql="SELECT * FROM site WHERE sID='$wID'";
$result=mysql_query($sql,$db);

$row = mysql_fetch_array($result);

$content = $row["content"];
<--Snip

The problem is that I believe that it can't fetch the code from the content
as it is a "Long Text" in MySQL.
Does anyone know what I am doing wrong and how to fix it?
If you want to see the whole code, please put a post and I'll paste it all.

Thanks!

Cato



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




Re: [PHP-DEV] knowing an ip address machine

2002-03-04 Thread Sander Roobol

You're asking on the wrong list; use [EMAIL PROTECTED] for 
questions like these...
PHP-DEV is for the development OF PHP, not for developing WITH PHP.

Sander

On 2002.03.04 14:43 Eduardo Melo wrote:
(I like the html-support in this client :)

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




Re: [PHP-DEV] php + cygwin - some more

2002-03-04 Thread Edin Kadribasic

> >Ok, seeing that some people indeed do use cygwin to build PHP, here's
> >report about my achievements:
>
> Just checked with new cygwin and it builds, compiles but does not link,
> seem to be a problem with underscore generation. The cli executable
> does not find its functionsmaybe i check this later
>
> by the way i have now problems with php 4.1.1 and 4.1.2 but then came
cli...

Just compiled php from cvs and have encountered no problems.

* Latest cygwin
* autoconf-2.52 recompiled from source
* libtool-1.4.2 recompiled from source
* ./configure --without-xml

Compilation went smoothly and both cgi and cli were built and functioning
ok. It would be fun to run some benchmarks to see whether php compiled under
cygwin is much slower thatn the one compiled with native ms compiler.

Edin



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




[PHP-DEV] knowing an ip address machine

2002-03-04 Thread Eduardo Melo


Pleasse,
How is possible to get information about the machine that is accessing  a PHP file ?
as such as :
www.anyaddress.org/user.php
best regards
Eduardo Melo
computer programmer
Get your FREE download of MSN Explorer at http://explorer.msn.com.

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



Re: [PHP-DEV] PHP module creation

2002-03-04 Thread Steven J. Sobol

On Sun, 3 Mar 2002, Rasmus Lerdorf wrote:

> Make sure you have:
> 
> PHP_EXTENSION(exif, $ext_shared)
> 
> in your config.m4 and then simply do:
> 
>   ./configure --with-foo=shared
> 
> You will find it in your ./modules directory.

I haven't tried this yet. I will later. I did find phpize, which is nice
to have because I don't necessarily want to have to have the entire source
tarball sitting there just to build one extension. Is the use of phpize 
officially supported? Thanks

-- 
JustThe.net LLC - Steve "Web Dude" Sobol, CTO  ICQ: 56972932/WebDude216
website: http://JustThe.net  email: [EMAIL PROTECTED]  phone: 216.619.2NET 
postal: 5686 Davis Drive, Mentor On The Lake, OH 44060-2752  DalNet: ZX-2



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




Re: [PHP-DEV] PHP module creation

2002-03-04 Thread Steven J. Sobol

On Sun, 3 Mar 2002, Steven J. Sobol wrote:

> 
> I've followed the instructions at http://www.zend.com/apidoc/
> and generated test code for a php extension, and can get it to compile
> into a PHP binary, but I'm having difficulty finding the info I need to
> get it to compile as a shared library.

Nevermind, I found it. May I suggest a couple pages on the use of phpize
in the docs at zend.com or php.net? The Zend API docs are pretty thorough
except for this...

-- 
JustThe.net LLC - Steve "Web Dude" Sobol, CTO  ICQ: 56972932/WebDude216
website: http://JustThe.net  email: [EMAIL PROTECTED]  phone: 216.619.2NET 
postal: 5686 Davis Drive, Mentor On The Lake, OH 44060-2752  DalNet: ZX-2



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




[PHP-DEV] slow ldap operation

2002-03-04 Thread Didier Geheniau

Hi,

i have the next code that puts all groups of an apllication from ldap into
an array with membership check of the current user:

function check_group($group, $uid, $ds)
 {
global $LDAP_SERVER_ADDRESS;
 global $LDAP_SERVER_PORT;
 global $LDAP_BASE_DN;
 global $appnm;
 global $cfg;
 $authorization = 0;

 $res_id= ldap_search($ds, "$LDAP_BASE_DN", "cn=$group");
 $entry= ldap_get_entries($ds, $res_id);
 if ($entry)
  {
  $obj_dn = $entry[0]["dn"];
  if ($obj_dn["dn"]<>"")
   {
   foreach ($entry[0][uniquemember] as $show)
{
if ($show[0]=="c")
 {
 $ufn=ldap_dn2ufn($show);
 $exp=explode(",",$ufn);
 if(check_group("$exp[0]",$uid, $ds))
  {
  $authorization=1;
  }
 }
else
 {
 if ($show==$uid)
  {
  $authorization = 1;
  }
 }
}
   }
  }
 return $authorization;
 }




function authorizations()
 {
 global $LDAP_SERVER_ADDRESS;
 global $LDAP_SERVER_PORT;
 global $LDAP_BASE_DN;
 global $appnm;
 global $PHP_AUTH_USER;

 $uid_ds=ldap_connect("$LDAP_SERVER_ADDRESS", "$LDAP_SERVER_PORT");
 $uid_r = ldap_bind($uid_ds);
 $res_uid= ldap_search($uid_ds, "$LDAP_BASE_DN", "uid=$PHP_AUTH_USER");
 $uid_entry= ldap_get_entries($uid_ds, $res_uid);
 $uid=$uid_entry[0][dn];
 ldap_close($uid_ds);

 $ds=ldap_connect("$LDAP_SERVER_ADDRESS", "$LDAP_SERVER_PORT");
 $r = ldap_bind($ds);
 if ($r)
  {
  $res_id= ldap_search($ds, "$LDAP_BASE_DN", "ou=$appnm");
  $entry = ldap_get_entries($ds, $res_id);
  $app_dn = $entry[0]["dn"];
  $res = ldap_search($ds, "$app_dn", "objectclass=groupOfUniqueNames");
  $entry = ldap_get_entries($ds, $res);
  for($i=0; $i<$entry[count]; $i++)
   {
   $dn=$entry[$i]["dn"];
   $ufn=ldap_dn2ufn($dn);
   $grnm=explode(",",$ufn);

   $authorization[$grnm[0]]=check_group($grnm[0], $uid, $ds);
   }
  }
 ldap_close($ds);
 return $authorization;
 }

when running authorization() it searches for all groups in a sub tree
(location of the application authorization groups) put those groups into an
array and checks of the currnet user is member of this group(it is checked
recursive)

the script is very slow and often i get a timed out, there are approximately
30 groups in the sub-tree i'm using.



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




[PHP-DEV] your patch to session.c broke it (testcase included)

2002-03-04 Thread Thies C. Arntzen

zeev, 
your patch
http://cvs.php.net/diff.php/php4/ext/session/session.c?r1=1.277&r2=1.278&ty=u

broke the session module:

testcase (run multiple times using php-cgi from the command-line)



after your patch the changed value of $hallo is no longer remembered.

hmm, as i don't know wich "crash bug" your patch fixes i
don't want to simply revert it - could you give me some
insights?

re,
tc

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




[PHP-DEV] php_ticks.c patch

2002-03-04 Thread Jon Parise

The following patch quells a warning under 'cc: WorkShop
Compilers 5.0 98/12/15 C 5.0' (Solaris 8).  I think it's
theoretically correct, but I'd like a second opinion before I
commit the change.

-- 
Jon Parise ([EMAIL PROTECTED])  .  Information Technology (2001)
http://www.csh.rit.edu/~jon/  :  Computer Science House Member


Index: php_ticks.c
===
RCS file: /repository/php4/main/php_ticks.c,v
retrieving revision 1.14
diff -u -r1.14 php_ticks.c
--- php_ticks.c 28 Feb 2002 08:27:04 -  1.14
+++ php_ticks.c 4 Mar 2002 10:49:31 -
@@ -52,7 +52,7 @@
 {
TSRMLS_FETCH();
 
-   zend_llist_del_element(&PG(tick_functions), func,
+   zend_llist_del_element(&PG(tick_functions), (void *)func,
   (int(*)(void*, 
void*))php_compare_tick_functions);
 }
 



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


Re: [PHP-DEV] makerpm script in source distri

2002-03-04 Thread Derick Rethans

Hello Arjen,

I applied the patch, thx

Derick

On 4 Mar 2002, Arjen Lentz wrote:

> Hi, (particularly Zak)
>
> I sometimes create RPMs from the source distri (any 4.x version), so I
> can do an easy install on some RH machines. The 'makerpm' script in the
> root of the source tree does this quite nicely, except it hasn't been
> changed for a while and therefore has a few probs I needed to fix to
> make it work.
>
> Diff posted below... one path was wrong, and --with-imap often doesn't
> work because of its Kerberos dependencies.
>
> Another thing is, the script isn't executable straight from the .tar.gz,
> so a chmod +x is required. Since other scripts in the source distri are
> executable, perhaps make that so for this one too?
>
>
> Regards,
> Arjen.
>
>
> *** makerpm~Fri Jun 29 12:32:19 2001
> --- makerpm Fri Mar  1 11:32:21 2002
> ***
> *** 63,69 
> --enable-safe-mode \
> --with-exec-dir=/usr/bin \
> --with-mysql=/usr \
> -   --with-imap=/usr \
> --with-pdflib=/usr \
> --with-zlib=/usr \
> --enable-xml \
> --- 63,68 
> ***
> *** 81,87 
> --enable-safe-mode \
> --with-exec-dir=/usr/bin \
> --with-mysql=/usr \
> -   --with-imap=/usr \
> --with-pdflib=/usr \
> --with-zlib=/usr \
> --enable-xml \
> --- 80,85 
> ***
> *** 95,101 
>   %install
>   rm -rf $RPM_BUILD_ROOT
>   mkdir -p $RPM_BUILD_ROOT/usr/lib/apache
> ! install -m 755 libphp4.so $RPM_BUILD_ROOT/usr/lib/apache
>   mkdir -p $RPM_BUILD_ROOT/usr/bin
>   install -m 755 php $RPM_BUILD_ROOT/usr/bin
>
> --- 93,99 
>   %install
>   rm -rf $RPM_BUILD_ROOT
>   mkdir -p $RPM_BUILD_ROOT/usr/lib/apache
> ! install -m 755 .libs/libphp4.so $RPM_BUILD_ROOT/usr/lib/apache
>   mkdir -p $RPM_BUILD_ROOT/usr/bin
>   install -m 755 php $RPM_BUILD_ROOT/usr/bin
>
>
>
>
>
> --
> PHP Development Mailing List 
> To unsubscribe, visit: http://www.php.net/unsub.php
>

Derick Rethans

-
PHP: Scripting the Web - www.php.net - [EMAIL PROTECTED]
 SRM: Site Resource Manager - www.vl-srm.net
-


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




Re: [PHP-DEV] FW: [PHP-CVS] cvs: php4 /ext/odbc birdstep.c config.m4php_birstep.h php_odbc.c php_odbc.h php_velocis.h setup.stub velocis.c /main build-defs.h.in

2002-03-04 Thread derick

On Mon, 4 Mar 2002, James Cox wrote:

> if anyone has access to a Birdstep server (velocis) can you QA this? I'm
> waiting on seeing if the Birdstep company will send me a copy of their
> product - however it's just name changes..

It should get tested anyway, you could have made typoes p.e.

Derick

> -Original Message-
> From: James Cox [mailto:[EMAIL PROTECTED]]
> Sent: Monday, March 04, 2002 9:11 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP-CVS] cvs: php4 /ext/odbc birdstep.c config.m4
> php_birstep.h php_odbc.c php_odbc.h php_velocis.h setup.stub velocis.c
> /main build-defs.h.in
>
>
> imajesMon Mar  4 04:10:33 2002 EDT
>
>   Added files:
> /php4/ext/odbcbirdstep.c php_birstep.h
>
>   Removed files:
> /php4/ext/odbcphp_velocis.h velocis.c
>
>   Modified files:
> /php4/ext/odbcconfig.m4 php_odbc.c php_odbc.h setup.stub
> /php4/mainbuild-defs.h.in
>   Log:
>   Changing the Velocis extension to now be called Birdstep, due to a
> product/company change.
>   added aliases for Velocis to the birdstep functions.
>   # testing is both advised and encouraged!
>   @ The Velocis extension is no
>
>
>
>
>


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




Re: [PHP-DEV] parse_str and session vars

2002-03-04 Thread Thomas Wentzel

As I mentioned earlier - it is not because I don't know how to
circumvent it
but next to actually fixing the bugs/issues I just felt that reporting
them
would be a good thing :)

/Thomas

Rasmus Lerdorf wrote:
> 
> Should work just fine.  But since you don't seem to care how you do it, I
> don't understand why you don't just do the obvious.  Loop through the GET
> vars and set each one.  ie.
> 
> foreach($HTTP_GET_VARS as $name=>$val) $$name=$val;
> 
> -Rasmus
> 
> On Mon, 4 Mar 2002, Thomas Wentzel wrote:
> 
> > PHP 4.1.2 std. no CVS
> >
> > Rasmus Lerdorf wrote:
> > >
> > > Which version of PHP?  I tested your file123 thing here and it worked just
> > > fine.
> > >
> > > On Mon, 4 Mar 2002, Thomas Wentzel wrote:
> > >
> > > > I'm very sorry, but it seems - that the solution with
> > > > import_request_variables
> > > > is even worse. I've tried import_request_variables with ("g","f") and
> > > > ("g","foo")
> > > > but now foo isn't even set in file2.php (the url arg to file3 is now
> > > > "bar")
> > > >
> > > > Thomas Wentzel wrote:
> > > > >
> > > > > OK! Thanks, Rasmus!
> > > > >
> > > > > That will allow me to keep working on my current model
> > > > >
> > > > > /Thomas
> > > > >
> > > > > Rasmus Lerdorf wrote:
> > > > > >
> > > > > > Use import_request_variables('g') instead of parse_str($QUERY_STRING) for
> > > > > > now. It does the same thing in your case in a more efficient manner. I
> > > > > > think the session code is holding a reference to the original data and
> > > > > > php_treat_data() is not doing the right thing when overwriting existing
> > > > > > vars. Or something funky like that. It is too late at night to figure this
> > > > > > particular code out.
> > > > > >
> > > > > > -Rasmus
> > > >
> > >
> > > --
> > > PHP Development Mailing List 
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> 
> --
> PHP Development Mailing List 
> To unsubscribe, visit: http://www.php.net/unsub.php


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




[PHP-DEV] FW: [PHP-CVS] cvs: php4 /ext/odbc birdstep.c config.m4 php_birstep.h php_odbc.c php_odbc.h php_velocis.h setup.stub velocis.c /main build-defs.h.in

2002-03-04 Thread James Cox

Hey,

if anyone has access to a Birdstep server (velocis) can you QA this? I'm
waiting on seeing if the Birdstep company will send me a copy of their
product - however it's just name changes..

James

-Original Message-
From: James Cox [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 04, 2002 9:11 AM
To: [EMAIL PROTECTED]
Subject: [PHP-CVS] cvs: php4 /ext/odbc birdstep.c config.m4
php_birstep.h php_odbc.c php_odbc.h php_velocis.h setup.stub velocis.c
/main build-defs.h.in


imajes  Mon Mar  4 04:10:33 2002 EDT

  Added files:
/php4/ext/odbc  birdstep.c php_birstep.h

  Removed files:
/php4/ext/odbc  php_velocis.h velocis.c

  Modified files:
/php4/ext/odbc  config.m4 php_odbc.c php_odbc.h setup.stub
/php4/main  build-defs.h.in
  Log:
  Changing the Velocis extension to now be called Birdstep, due to a
product/company change.
  added aliases for Velocis to the birdstep functions.
  # testing is both advised and encouraged!
  @ The Velocis extension is no






Index: php4/ext/odbc/config.m4
diff -u php4/ext/odbc/config.m4:1.48 php4/ext/odbc/config.m4:1.49
--- php4/ext/odbc/config.m4:1.48Wed Feb  6 14:10:35 2002
+++ php4/ext/odbc/config.m4 Mon Mar  4 04:10:31 2002
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: config.m4,v 1.48 2002/02/06 19:10:35 derick Exp $
+dnl $Id: config.m4,v 1.49 2002/03/04 09:10:31 imajes Exp $
 dnl
 
 dnl
@@ -290,26 +290,26 @@
 fi
 
 if test -z "$ODBC_TYPE"; then
-AC_MSG_CHECKING(for Velocis support)
-AC_ARG_WITH(velocis,
-[  --with-velocis[=DIR]Include Velocis support.  DIR is the Velocis base
-  install directory, defaults to /usr/local/velocis.],
+AC_MSG_CHECKING(for Birdstep support)
+AC_ARG_WITH(birdstep,
+[  --with-birdstep[=DIR]Include Birdstep support.  DIR is the Birdstep base
+  install directory, defaults to /usr/local/birdstep.],
 [
   PHP_WITH_SHARED
 
   if test "$withval" != "no"; then
 if test "$withval" = "yes"; then
-ODBC_INCDIR=/usr/local/velocis/include
-ODBC_LIBDIR=/usr/local/velocis/lib
+ODBC_INCDIR=/usr/local/birdstep/include
+ODBC_LIBDIR=/usr/local/birdstep/lib
 else
 ODBC_INCDIR=$withval/include
 ODBC_LIBDIR=$withval/lib
 fi
 ODBC_INCLUDE=-I$ODBC_INCDIR
-ODBC_TYPE=velocis
+ODBC_TYPE=birdstep
 ODBC_LFLAGS=-L$ODBC_LIBDIR
 ODBC_LIBS="-lCadm -lCdict -lCenc -lCrdm -lCrpc -lCrdbc -lCrm -lCuapi -lutil"
-AC_DEFINE(HAVE_VELOCIS,1,[ ])
+AC_DEFINE(HAVE_BIRDSTEP,1,[ ])
 
 AC_MSG_RESULT(yes)
   else
Index: php4/ext/odbc/php_odbc.c
diff -u php4/ext/odbc/php_odbc.c:1.118 php4/ext/odbc/php_odbc.c:1.119
--- php4/ext/odbc/php_odbc.c:1.118  Thu Feb 28 03:26:29 2002
+++ php4/ext/odbc/php_odbc.cMon Mar  4 04:10:31 2002
@@ -15,12 +15,12 @@
| Authors: Stig Sæther Bakken <[EMAIL PROTECTED]>|
|  Andreas Karajannis <[EMAIL PROTECTED]>  |
|  Frank M. Kromann <[EMAIL PROTECTED]> Support for DB/2 CLI |
-   |  Kevin N. Shallow <[EMAIL PROTECTED]> Velocis Support |
+   |  Kevin N. Shallow <[EMAIL PROTECTED]> Birdstep Support |
|  Daniel R. Kalowsky <[EMAIL PROTECTED]>   |
+--+
  */
 
-/* $Id: php_odbc.c,v 1.118 2002/02/28 08:26:29 sebastian Exp $ */
+/* $Id: php_odbc.c,v 1.119 2002/03/04 09:10:31 imajes Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -113,14 +113,14 @@
PHP_FE(odbc_columns, NULL)
PHP_FE(odbc_gettypeinfo, NULL)
PHP_FE(odbc_primarykeys, NULL)
-#if !defined(HAVE_DBMAKER) && !defined(HAVE_SOLID) && !defined(HAVE_SOLID_30) 
&&!defined(HAVE_SOLID_35) && !defined(HAVE_VELOCIS)/* not supported now */
+#if !defined(HAVE_DBMAKER) && !defined(HAVE_SOLID) && !defined(HAVE_SOLID_30) 
+&&!defined(HAVE_SOLID_35) && !defined(HAVE_BIRDSTEP)/* not supported now */
PHP_FE(odbc_columnprivileges, NULL)
PHP_FE(odbc_tableprivileges, NULL)
 #endif
 #if !defined(HAVE_SOLID) && !defined(HAVE_SOLID_30) && !defined(HAVE_SOLID_35) /* not 
supported */
PHP_FE(odbc_foreignkeys, NULL)
PHP_FE(odbc_procedures, NULL)
-#if !defined(HAVE_VELOCIS)
+#if !defined(HAVE_BIRDSTEP)
PHP_FE(odbc_procedurecolumns, NULL)
 #endif
 #endif
@@ -2800,7 +2800,7 @@
 }
 /* }}} */
 
-#if !defined(HAVE_DBMAKER) && !defined(HAVE_SOLID) && !defined(HAVE_SOLID_30) && 
!defined(HAVE_SOLID_35) && !defined(HAVE_VELOCIS)
+#if !defined(HAVE_DBMAKER) && !defined(HAVE_SOLID) && !defined(HAVE_SOLID_30) && 
+!defined(HAVE_SOLID_35) && !defined(HAVE_BIRDSTEP)
 /* {{{ proto int odbc_columnprivileges(int connection_id, string catalog, string 
schema, string table, string column)
Returns a result identifier that can be used to fetch a list of columns and 
associated privileges for the specified table */
 PHP_FUNCTION(odbc_columnprivileges)
@@ -3127,7 +3127,7 @@
 }
 /* }}} */
 
-#if !defi

Re: [PHP-DEV] parse_str and session vars

2002-03-04 Thread Rasmus Lerdorf

Should work just fine.  But since you don't seem to care how you do it, I
don't understand why you don't just do the obvious.  Loop through the GET
vars and set each one.  ie.

foreach($HTTP_GET_VARS as $name=>$val) $$name=$val;

-Rasmus

On Mon, 4 Mar 2002, Thomas Wentzel wrote:

> PHP 4.1.2 std. no CVS
>
> Rasmus Lerdorf wrote:
> >
> > Which version of PHP?  I tested your file123 thing here and it worked just
> > fine.
> >
> > On Mon, 4 Mar 2002, Thomas Wentzel wrote:
> >
> > > I'm very sorry, but it seems - that the solution with
> > > import_request_variables
> > > is even worse. I've tried import_request_variables with ("g","f") and
> > > ("g","foo")
> > > but now foo isn't even set in file2.php (the url arg to file3 is now
> > > "bar")
> > >
> > > Thomas Wentzel wrote:
> > > >
> > > > OK! Thanks, Rasmus!
> > > >
> > > > That will allow me to keep working on my current model
> > > >
> > > > /Thomas
> > > >
> > > > Rasmus Lerdorf wrote:
> > > > >
> > > > > Use import_request_variables('g') instead of parse_str($QUERY_STRING) for
> > > > > now. It does the same thing in your case in a more efficient manner. I
> > > > > think the session code is holding a reference to the original data and
> > > > > php_treat_data() is not doing the right thing when overwriting existing
> > > > > vars. Or something funky like that. It is too late at night to figure this
> > > > > particular code out.
> > > > >
> > > > > -Rasmus
> > >
> >
> > --
> > PHP Development Mailing List 
> > To unsubscribe, visit: http://www.php.net/unsub.php
>


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




Re: [PHP-DEV] parse_str and session vars

2002-03-04 Thread Thomas Wentzel

PHP 4.1.2 std. no CVS

Rasmus Lerdorf wrote:
> 
> Which version of PHP?  I tested your file123 thing here and it worked just
> fine.
> 
> On Mon, 4 Mar 2002, Thomas Wentzel wrote:
> 
> > I'm very sorry, but it seems - that the solution with
> > import_request_variables
> > is even worse. I've tried import_request_variables with ("g","f") and
> > ("g","foo")
> > but now foo isn't even set in file2.php (the url arg to file3 is now
> > "bar")
> >
> > Thomas Wentzel wrote:
> > >
> > > OK! Thanks, Rasmus!
> > >
> > > That will allow me to keep working on my current model
> > >
> > > /Thomas
> > >
> > > Rasmus Lerdorf wrote:
> > > >
> > > > Use import_request_variables('g') instead of parse_str($QUERY_STRING) for
> > > > now. It does the same thing in your case in a more efficient manner. I
> > > > think the session code is holding a reference to the original data and
> > > > php_treat_data() is not doing the right thing when overwriting existing
> > > > vars. Or something funky like that. It is too late at night to figure this
> > > > particular code out.
> > > >
> > > > -Rasmus
> >
> 
> --
> PHP Development Mailing List 
> To unsubscribe, visit: http://www.php.net/unsub.php


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




Re: [PHP-DEV] parse_str and session vars

2002-03-04 Thread Rasmus Lerdorf

Which version of PHP?  I tested your file123 thing here and it worked just
fine.

On Mon, 4 Mar 2002, Thomas Wentzel wrote:

> I'm very sorry, but it seems - that the solution with
> import_request_variables
> is even worse. I've tried import_request_variables with ("g","f") and
> ("g","foo")
> but now foo isn't even set in file2.php (the url arg to file3 is now
> "bar")
>
> Thomas Wentzel wrote:
> >
> > OK! Thanks, Rasmus!
> >
> > That will allow me to keep working on my current model
> >
> > /Thomas
> >
> > Rasmus Lerdorf wrote:
> > >
> > > Use import_request_variables('g') instead of parse_str($QUERY_STRING) for
> > > now. It does the same thing in your case in a more efficient manner. I
> > > think the session code is holding a reference to the original data and
> > > php_treat_data() is not doing the right thing when overwriting existing
> > > vars. Or something funky like that. It is too late at night to figure this
> > > particular code out.
> > >
> > > -Rasmus
>


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




Re: [PHP-DEV] parse_str and session vars

2002-03-04 Thread Thomas Wentzel

I'm very sorry, but it seems - that the solution with
import_request_variables
is even worse. I've tried import_request_variables with ("g","f") and
("g","foo")
but now foo isn't even set in file2.php (the url arg to file3 is now
"bar")

Thomas Wentzel wrote:
> 
> OK! Thanks, Rasmus!
> 
> That will allow me to keep working on my current model
> 
> /Thomas
> 
> Rasmus Lerdorf wrote:
> >
> > Use import_request_variables('g') instead of parse_str($QUERY_STRING) for
> > now. It does the same thing in your case in a more efficient manner. I
> > think the session code is holding a reference to the original data and
> > php_treat_data() is not doing the right thing when overwriting existing
> > vars. Or something funky like that. It is too late at night to figure this
> > particular code out.
> >
> > -Rasmus


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




Re: [PHP-DEV] parse_str and session vars

2002-03-04 Thread Thomas Wentzel

OK! Thanks, Rasmus!

That will allow me to keep working on my current model

/Thomas

Rasmus Lerdorf wrote:
> 
> Use import_request_variables('g') instead of parse_str($QUERY_STRING) for
> now. It does the same thing in your case in a more efficient manner. I
> think the session code is holding a reference to the original data and
> php_treat_data() is not doing the right thing when overwriting existing
> vars. Or something funky like that. It is too late at night to figure this
> particular code out.
> 
> -Rasmus
> 
> On Mon, 4 Mar 2002, Thomas Wentzel wrote:
> 
> > hehe
> > Thanks - I needed that :)
> >
> > Rasmus Lerdorf wrote:
> > >
> > > It is.  I am looking at it now.  There may actually be a problem.  $foo is
> > > set to foobar, but the session stays at "bar" if $foo is set via
> > > parse_str().  Something funky in the session code.  parse_str() is working
> > > just fine.
> > >
> > > -Rasmus
> > >
> > > On Mon, 4 Mar 2002, Markus Fischer wrote:
> > >
> > > > On Mon, Mar 04, 2002 at 09:21:26AM +0100, Thomas Wentzel wrote :
> > > > > And Markus - thanks, but I tried to subsitute parse_str($QUERY_STRING)
> > > > > with parse_str("foo=foobar") which also didn't set my session var, foo
> > > > > So that is not the problem either!
> > > >
> > > > Ah! I now see what you mean!
> > > >
> > > > Have you double checked that, after parse_str(), $foo is set
> > > > to foobar ?
> > > >
> > > > --
> > > > Please always Cc to me when replying to me on the lists.
> > > > GnuPG Key: http://guru.josefine.at/~mfischer/C2272BD0.asc
> > > >
> >


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




Re: [PHP-DEV] parse_str and session vars

2002-03-04 Thread Rasmus Lerdorf

Use import_request_variables('g') instead of parse_str($QUERY_STRING) for
now. It does the same thing in your case in a more efficient manner. I
think the session code is holding a reference to the original data and
php_treat_data() is not doing the right thing when overwriting existing
vars. Or something funky like that. It is too late at night to figure this
particular code out.

-Rasmus

On Mon, 4 Mar 2002, Thomas Wentzel wrote:

> hehe
> Thanks - I needed that :)
>
> Rasmus Lerdorf wrote:
> >
> > It is.  I am looking at it now.  There may actually be a problem.  $foo is
> > set to foobar, but the session stays at "bar" if $foo is set via
> > parse_str().  Something funky in the session code.  parse_str() is working
> > just fine.
> >
> > -Rasmus
> >
> > On Mon, 4 Mar 2002, Markus Fischer wrote:
> >
> > > On Mon, Mar 04, 2002 at 09:21:26AM +0100, Thomas Wentzel wrote :
> > > > And Markus - thanks, but I tried to subsitute parse_str($QUERY_STRING)
> > > > with parse_str("foo=foobar") which also didn't set my session var, foo
> > > > So that is not the problem either!
> > >
> > > Ah! I now see what you mean!
> > >
> > > Have you double checked that, after parse_str(), $foo is set
> > > to foobar ?
> > >
> > > --
> > > Please always Cc to me when replying to me on the lists.
> > > GnuPG Key: http://guru.josefine.at/~mfischer/C2272BD0.asc
> > >
>


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




Re: [PHP-DEV] parse_str and session vars

2002-03-04 Thread Thomas Wentzel

hehe
Thanks - I needed that :)

Rasmus Lerdorf wrote:
> 
> It is.  I am looking at it now.  There may actually be a problem.  $foo is
> set to foobar, but the session stays at "bar" if $foo is set via
> parse_str().  Something funky in the session code.  parse_str() is working
> just fine.
> 
> -Rasmus
> 
> On Mon, 4 Mar 2002, Markus Fischer wrote:
> 
> > On Mon, Mar 04, 2002 at 09:21:26AM +0100, Thomas Wentzel wrote :
> > > And Markus - thanks, but I tried to subsitute parse_str($QUERY_STRING)
> > > with parse_str("foo=foobar") which also didn't set my session var, foo
> > > So that is not the problem either!
> >
> > Ah! I now see what you mean!
> >
> > Have you double checked that, after parse_str(), $foo is set
> > to foobar ?
> >
> > --
> > Please always Cc to me when replying to me on the lists.
> > GnuPG Key: http://guru.josefine.at/~mfischer/C2272BD0.asc
> >


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




Re: [PHP-DEV] parse_str and session vars

2002-03-04 Thread Rasmus Lerdorf

It is.  I am looking at it now.  There may actually be a problem.  $foo is
set to foobar, but the session stays at "bar" if $foo is set via
parse_str().  Something funky in the session code.  parse_str() is working
just fine.

-Rasmus

On Mon, 4 Mar 2002, Markus Fischer wrote:

> On Mon, Mar 04, 2002 at 09:21:26AM +0100, Thomas Wentzel wrote :
> > And Markus - thanks, but I tried to subsitute parse_str($QUERY_STRING)
> > with parse_str("foo=foobar") which also didn't set my session var, foo
> > So that is not the problem either!
>
> Ah! I now see what you mean!
>
> Have you double checked that, after parse_str(), $foo is set
> to foobar ?
>
> --
> Please always Cc to me when replying to me on the lists.
> GnuPG Key: http://guru.josefine.at/~mfischer/C2272BD0.asc
>


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




Re: [PHP-DEV] parse_str and session vars

2002-03-04 Thread Markus Fischer

On Mon, Mar 04, 2002 at 09:21:26AM +0100, Thomas Wentzel wrote : 
> And Markus - thanks, but I tried to subsitute parse_str($QUERY_STRING) 
> with parse_str("foo=foobar") which also didn't set my session var, foo
> So that is not the problem either!

Ah! I now see what you mean!

Have you double checked that, after parse_str(), $foo is set
to foobar ?

-- 
Please always Cc to me when replying to me on the lists.
GnuPG Key: http://guru.josefine.at/~mfischer/C2272BD0.asc

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




Re: [PHP-DEV] parse_str and session vars

2002-03-04 Thread Thomas Wentzel

Actually, yes it does...

$foo="foobar"; instead of parse_str($QUERY_STRING);
in file2.php - then file3.php echoes "foo: foobar".
Obviously - otherwise there wasn't any point in having sessions.

And Markus - thanks, but I tried to subsitute parse_str($QUERY_STRING) 
with parse_str("foo=foobar") which also didn't set my session var, foo
So that is not the problem either!

/Thomas

Rasmus Lerdorf wrote:
> 
> But your problem has absolutely nothing to do with parse_str().  Does it
> behave differently if you replace parse_str() with $foo="foobar"; ?
> I bet it doesn't.
> 
> On Mon, 4 Mar 2002, Thomas Wentzel wrote:
> 
> > Sure, Rasmus!
> > But...
> > I'm using parse_str because file2 in my example is supposed to be
> > a generic handler for all other scripts on my "site". Offcourse I could
> > use "1.5 million" $HTTP_GET_VARS for each registered session variable
> > (as
> > I wouldn't know what to expect)
> > The reason I did write to this list - is because there obviously is
> > something wrong with the way parse_str works and how it is supposed to
> > work.
> > Not because I don't know how to get around this "obstacle"
> >
> >
> >
> >
> > And the reason I did submit to this list
> > Rasmus Lerdorf wrote:
> > >
> > > You are posting to the wrong list.  And why are you using parse_str()?
> > > PHP automatically imports these variables for you.  Use
> > > $foo=$HTTP_GET_VARS['foo'] in that second script of yours.
> > >
> > > Next time send your user-level question like this to php-general.
> > >
> > > -Rasmus
> > >
> > > On Mon, 4 Mar 2002, Thomas Wentzel wrote:
> > >
> > > > Hi,
> > > >
> > > > I have encountered an issue with parse_str, that I believe needs to
> > > > be addressed - allthough I might be mistaken, and in that case feel
> > > > free to ridicule me - and tell me to go to the general list :)
> > > >
> > > > Well... I want to be able to do something like this:
> > > >
> > > > file1.php:
> > > >> > >   session_start();
> > > >   session_register("foo");
> > > >   $foo="bar";
> > > >   ?>
> > > >   
> > > >   
> > > >   
> > > >
> > > > file2.php:
> > > >> > >   session_start();
> > > >   $old=$foo;
> > > >   parse_str($QUERY_STRING);
> > > >
> > > >   Header("Location: file3.php?old=$old&foo=$foo");
> > > >   ?>
> > > >
> > > > file3.php:
> > > >> > >   session_start();
> > > >   echo "foo: $foo";
> > > >   ?>
> > > >
> > > > >From the manual: (explanation for parse_str)
> > > >   Parses str as if it were the query string passed via an URL and sets
> > > > variables in the current scope. If the second
> > > >   parameter arr is present, variables are stored in this variable as an
> > > > array elements instead.
> > > >
> > > > I would expect that the script would result in file3.php echoing, "foo:
> > > > foobar" - but that's not the case, instead I get: "foo: bar", but the
> > > > url is: "file3.php?old=bar&foo=foobar". Doesn't session_start introduce
> > > > all the registered vars into the current scope - and since parse_str
> > > > "sets varibles in the current scope" why doesn't this scheme work?
> > > >
> > > > Thanks for listening
> > > >   Thomas
> > > >
> > > >
> > > > --
> > > > PHP Development Mailing List 
> > > > To unsubscribe, visit: http://www.php.net/unsub.php
> > > >
> > >
> > > --
> > > PHP Development Mailing List 
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> >


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