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
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
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.
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
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
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:
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
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
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
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,
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
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
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.
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
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.
15 matches
Mail list logo