# php ldap wit exop patch and missing ZSTR

- Thread: https://externals.io/message/34584
- Original archive: https://news-web.php.net/php.internals/34584
- Started by Faraz Khan on 2008-01-07T15:53:57+00:00
- Messages: 3
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #34584 — Faraz Khan — 2008-01-07T15:53:57+00:00

URL: https://externals.io/message/34584#34584

Dear all,
I'm trying to apply the php ldap EXOP patch from :

<http://www.sys-net.it/~ando/Download/#PHP>

The patch defines a zstr in ldap.c at line 1731 as obvious below. ZSTR  
no longer appears to be defined anywhere in php or zend.h - can  
somebody help me with this? Should i just define it manually?




/php5/Zend    -I/usr/include -g -O2  -c  
/usr/local/src/php5/ext/ldap/ldap.c -o ext/ldap/ldap.lo
/usr/local/src/php5/ext/ldap/ldap.c: In function 'php_ldap_do_modify':
/usr/local/src/php5/ext/ldap/ldap.c:1731: error: 'zstr' undeclared  
(first use in this function)
/usr/local/src/php5/ext/ldap/ldap.c:1731: error: (Each undeclared  
identifier is reported only once
/usr/local/src/php5/ext/ldap/ldap.c:1731: error: for each function it  
appears in.)
/usr/local/src/php5/ext/ldap/ldap.c:1731: error: expected ';' before  
'attribute'
/usr/local/src/php5/ext/ldap/ldap.c:1790: error: 'attribute'  
undeclared (first use in this function)
make: *** [ext/ldap/ldap.lo] Error 1



-- 
Faraz R Khan
Chief Architect
Emergen Consulting Pvt Ltd
www.emergen.biz

---

## #34585 — johannes@php.net — 2008-01-07T17:26:21+00:00

URL: https://externals.io/message/34584#34585 · In reply to: #34584

Hi Faraz,


> Dear all,
> I'm trying to apply the php ldap EXOP patch from :
> 
> <http://www.sys-net.it/~ando/Download/#PHP>
> 
> The patch defines a zstr in ldap.c at line 1731 as obvious below. ZSTR  
> no longer appears to be defined anywhere in php or zend.h - can  
> somebody help me with this? Should i just define it manually?

I don't know that patch but a little help: zstr is a PHP 6 type for
handling unicode and binary strings. So that patch is either missing
some compatibility code or is only for PHP 6. If you want to adopt it
either define a zstr using something like

typedef union _zstr {
	char *s;
	/* void *u;   -- If you get an error due a missing u component 
                         of that union either try using a void for it
                         or change it to take .s as char* .... */
	void *v;
} zstr;

or try to change the "zstr foo"s there to "char *foo" and drop
the .s/.u/.v where that var is being used.

The original declaration of that type can be found here:
http://lxr.php.net/source/ZendEngine2/zend.h#235

Both ways aren't really good, for more I'd have to check the patch,
maybe it's best to ask the author of the patch.

johannes

---

## #34599 — Faraz Khan — 2008-01-08T08:03:51+00:00

URL: https://externals.io/message/34584#34599 · In reply to: #34585

Many thanks for the quick response guys. Johannes doing void *u works,  
however UChar *u does not. anyways its compiled and working.

Btw- for anybody working with real ldap applications and php, paging  
is almost necessary. Any hopes of incorporating this with php6?

Quoting Johannes Schlüter <johannes@php.net>:

> Hi Faraz,
>
> 
> > […]
>
> I don't know that patch but a little help: zstr is a PHP 6 type for
> handling unicode and binary strings. So that patch is either missing
> some compatibility code or is only for PHP 6. If you want to adopt it
> either define a zstr using something like
>
> typedef union _zstr {
> 	char *s;
> 	/* void *u;   -- If you get an error due a missing u component
>                          of that union either try using a void for it
>                          or change it to take .s as char* .... */
> 	void *v;
> } zstr;
>
> or try to change the "zstr foo"s there to "char *foo" and drop
> the .s/.u/.v where that var is being used.
>
> The original declaration of that type can be found here:
> http://lxr.php.net/source/ZendEngine2/zend.h#235
>
> Both ways aren't really good, for more I'd have to check the patch,
> maybe it's best to ask the author of the patch.
>
> johannes
>
>
>



-- 
Faraz R Khan
Chief Architect
Emergen Consulting Pvt Ltd
www.emergen.biz
