Re: [PHP-DEV] Re: access to variables

2007-04-25 Thread Marcus Boerger
Hello Ci, Tuesday, April 24, 2007, 11:02:52 PM, you wrote: Tijnema ! napisał(a): I believe that the source string needs to be 0 terminated (\0). Don't ask me how to fix it ;) Thanks all of You. I solve all problems. Hmmm, maybe there are some things to make better, but the main idea is

Re: [PHP-DEV] Re: access to variables

2007-04-25 Thread Ci
Marcus Boerger napisał(a): Have a look here: http://talks.somabo.de/200611_php_code_camp.pdf Ohh this is really good. It should be in more reach place. Regards, Ci -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-DEV] Re: access to variables

2007-04-24 Thread Ci
I tried to use smth like that: zval *data = NULL; zend_hash_find(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_SERVER]), DOCUMENT ROOT, sizeof(DOCUMENT ROOT), data); strcpy(buffer, Z_STRVAL_P(data); Then I write the buffer to file, but I don't get correct variable. I'm working with php-5.2.1.

Re: [PHP-DEV] Re: access to variables

2007-04-24 Thread Tijnema !
On 4/24/07, Ci [EMAIL PROTECTED] wrote: I tried to use smth like that: zval *data = NULL; zend_hash_find(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_SERVER]), DOCUMENT ROOT, sizeof(DOCUMENT ROOT), data); strcpy(buffer, Z_STRVAL_P(data); Then I write the buffer to file, but I don't get

Re: [PHP-DEV] Re: access to variables

2007-04-24 Thread Ci
Tijnema ! napisał(a): Ok, i don't know a lot about the core of PHP, but i do know the C language. First of all, i don't see you declaring buffer somewhere, i guess you did it without showing, or that it is in the core. But if it isn't both, you should do :) Also note that buffer should be

Re: [PHP-DEV] Re: access to variables

2007-04-24 Thread Stefan Esser
Hello, zend_hash_find(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_SERVER]), DOCUMENT ROOT, sizeof(DOCUMENT ROOT), data); strcpy(buffer, Z_STRVAL_P(data); It is called DOCUMENT_ROOT, not DOCUMENT ROOT... -sesser -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit:

Re: [PHP-DEV] Re: access to variables

2007-04-24 Thread Ci
Stefan Esser napisał(a): Hello, zend_hash_find(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_SERVER]), DOCUMENT ROOT, sizeof(DOCUMENT ROOT), data); strcpy(buffer, Z_STRVAL_P(data); It is called DOCUMENT_ROOT, not DOCUMENT ROOT... It was mistake in rewriting. If I choose any php variable, such as

Re: [PHP-DEV] Re: access to variables

2007-04-24 Thread Stefan Esser
Ci schrieb: Stefan Esser napisał(a): Hello, zend_hash_find(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_SERVER]), DOCUMENT ROOT, sizeof(DOCUMENT ROOT), data); strcpy(buffer, Z_STRVAL_P(data); It is called DOCUMENT_ROOT, not DOCUMENT ROOT... It was mistake in rewriting. If I choose any php

Re: [PHP-DEV] Re: access to variables

2007-04-24 Thread Ci
Stefan Esser napisał(a): No. The correct way for getting the variable is zval **data; ... if (zend_hash_find(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_SERVER]), DOCUMENT_ROOT, sizeof(DOCUMENT_ROOT), data)==SUCCESS) { ... strlcpy(buffer, Z_STRVAL_PP(data), sizeof(buffer)); } I tried to use

Re: [PHP-DEV] Re: access to variables

2007-04-24 Thread Tijnema !
On 4/24/07, Ci [EMAIL PROTECTED] wrote: Stefan Esser napisał(a): No. The correct way for getting the variable is zval **data; ... if (zend_hash_find(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_SERVER]), DOCUMENT_ROOT, sizeof(DOCUMENT_ROOT), data)==SUCCESS) { ... strlcpy(buffer,

Re: [PHP-DEV] Re: access to variables

2007-04-24 Thread David Lindstrom
Doesn't the zval contain info about the length of the string? -- // DvDmanDT mail: dvdmandt¤telia.com msn: dvdmandt¤hotmail.com Ci [EMAIL PROTECTED] skrev i meddelandet news:[EMAIL PROTECTED] Stefan Esser napisa³(a): No. The correct way for getting the variable is zval **data; ... if

Re: [PHP-DEV] Re: access to variables

2007-04-24 Thread Ci
Tijnema ! napisał(a): I believe that the source string needs to be 0 terminated (\0). Don't ask me how to fix it ;) Thanks all of You. I solve all problems. Hmmm, maybe there are some things to make better, but the main idea is solved. BTW. Documentation of php API is tragic ;) Regards, Ci

Re: [PHP-DEV] Re: access to variables

2007-04-24 Thread Tijnema !
On 4/24/07, Ci [EMAIL PROTECTED] wrote: Tijnema ! napisał(a): I believe that the source string needs to be 0 terminated (\0). Don't ask me how to fix it ;) Thanks all of You. I solve all problems. Hmmm, maybe there are some things to make better, but the main idea is solved. BTW.

Re: [PHP-DEV] Re: access to variables

2007-04-24 Thread Antony Dovgal
On 04/25/2007 01:02 AM, Ci wrote: Tijnema ! napisał(a): I believe that the source string needs to be 0 terminated (\0). Don't ask me how to fix it ;) Thanks all of You. I solve all problems. Hmmm, maybe there are some things to make better, but the main idea is solved. BTW. Documentation

Re: [PHP-DEV] Re: access to variables

2007-04-24 Thread Richard Lynch
On Tue, April 24, 2007 4:02 pm, Ci wrote: Tijnema ! napisa³(a): I believe that the source string needs to be 0 terminated (\0). Don't ask me how to fix it ;) Thanks all of You. I solve all problems. Hmmm, maybe there are some things to make better, but the main idea is solved. BTW.