[PHP-DEV] ext_skel on Fedora

2011-08-26 Thread Aaron Gray
I cannot seem to find 'ext_skel' or 'PECL_Gen' on my F11 instillation of 
php-devel ?


Aaron


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



Re: [PHP-DEV] ext_skel on Fedora

2011-08-26 Thread Aaron Gray
Reindl Harald h.rei...@thelounge.net wrote in message 
news:4e583c6a.3000...@thelounge.net...


Ah right, did not think it was that old, thanks, got new servers ready to go 
in,


Aaron


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



[PHP-DEV] transversing associative arrays from C

2011-08-25 Thread Aaron Gray

Hi,

I am working on a C extension module for PHP and am wondering about an API 
issue.


I can see how to add to an associative array :-

   zval *aa;
   MAKE_STD_ZVAL(aa);
   array_init(aa);

   add_assoc_string(aa, test, test value, 1);

but how do I transverse an associative array of values in a for loop simular 
to using foreach in PHP ?


Hope this is not too OT for this list, but I could not find a better place 
to ask the question.


I have looked through the API SVN sources and this seems like a possible 
blind spot.


Many thanks in advance,

Aaron


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



[PHP-DEV] transversing associative arrays from C

2011-08-25 Thread Aaron Gray

Hi,

I am working on a C extension module for PHP and am wondering about an API
issue.

I can see how to add to an associative array :-

zval *aa;
MAKE_STD_ZVAL(aa);
array_init(aa);

Hi,

I am working on a C extension module for PHP and am wondering about an API
issue.

I can see how to add to an associative array :-

zval *aa;
MAKE_STD_ZVAL(aa);
array_init(aa);

add_assoc_string(aa, test, test value, 1);
add_assoc_string(aa, test2, test value2, 1);

but how do I transverse an associative array of values in a for loop simular
to using foreach in PHP ?

Hope this is not too OT for this list, but I could not find a better place
to ask the question.

I have looked through the API SVN sources and this seems like a possible
blind spot.

Many thanks in advance,

Aaron

but how do I transverse an associative array of values in a for loop simular
to using foreach in PHP ?

Hope this is not too OT for this list, but I could not find a better place
to ask the question.

I have looked through the API SVN sources and this seems like a possible
blind spot.

Many thanks in advance,

Aaron


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



Re: [PHP-DEV] transversing associative arrays from C

2011-08-25 Thread Aaron Gray
Chris Stockton chrisstockto...@gmail.com wrote in message 
news:calkfbxvsuq-zqyytdxi3a9tccieh6xzz9y-kbyqva8kpc4-...@mail.gmail.com...

Hello,

On Thu, Aug 25, 2011 at 2:57 PM, Aaron Gray ang.use...@gmail.com wrote:

Hi,

I am working on a C extension module for PHP and am wondering about an 
API

issue.

I can see how to add to an associative array :-



Most everything you need to know about manipulating arrays can be
found in ext/standard/array.c


Where's that in the SVN source tree ?

Aaron



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



Re: [PHP-DEV] transversing associative arrays from C

2011-08-25 Thread Aaron Gray
Aaron Gray ang.use...@gmail.com wrote in message 
news:a1.a0.22704.0d5e6...@pb1.pair.com...
Chris Stockton chrisstockto...@gmail.com wrote in message 
news:calkfbxvsuq-zqyytdxi3a9tccieh6xzz9y-kbyqva8kpc4-...@mail.gmail.com...

Hello,

On Thu, Aug 25, 2011 at 2:57 PM, Aaron Gray ang.use...@gmail.com wrote:

Hi,

I am working on a C extension module for PHP and am wondering about an 
API

issue.

I can see how to add to an associative array :-



Most everything you need to know about manipulating arrays can be
found in ext/standard/array.c


Where's that in the SVN source tree ?


Ah, got it many thanks,

Aaron


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



Re: [PHP-DEV] transversing associative arrays from C

2011-08-25 Thread Aaron Gray
Christopher Jones christopher.jo...@oracle.com wrote in message 
news:4e56e662.90...@oracle.com...



On 08/25/2011 05:16 PM, Aaron Gray wrote:
Chris Stockton chrisstockto...@gmail.com wrote in message 
news:calkfbxvsuq-zqyytdxi3a9tccieh6xzz9y-kbyqva8kpc4-...@mail.gmail.com...

Hello,

On Thu, Aug 25, 2011 at 2:57 PM, Aaron Gray ang.use...@gmail.com 
wrote:

Hi,

I am working on a C extension module for PHP and am wondering about an 
API

issue.

I can see how to add to an associative array :-



Most everything you need to know about manipulating arrays can be
found in ext/standard/array.c


Where's that in the SVN source tree ?

Aaron


http://svn.php.net/viewvc/php/php-src/branches/PHP_5_4/ext/standard/


Chris,

How much can I access as a PHP plugin dll or shared object ?

Thinking about it what I really want to do is see if a key exists in an 
array and get its type to see if it is BOOL and that it is TRUE.


Many thanks,

Aaron


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



Re: [PHP-DEV] transversing associative arrays from C

2011-08-25 Thread Aaron Gray

Hi Stas,

Stas Malyshev smalys...@sugarcrm.com wrote in message 
news:4e56f0d6.20...@sugarcrm.com...

Hi!

On 8/25/11 5:52 PM, Aaron Gray wrote:

Thinking about it what I really want to do is see if a key exists in an
array and get its type to see if it is BOOL and that it is TRUE.


For this, you will need to call zend_hash_find (or zend_symtable_find if 
there's a possibility of keys like 0 that have to be treated as 0).


Okay, found it, zend_hash.h, so that should be accessable to my module :)

If you get SUCCESS, the key exists and you'll be getting zval **, then 
either check it's type and value with Z_TYPE_PP and Z_LVAL_PP or call 
zend_is_true(*val) to get generic truth value (like if(), etc. do).


Great.

That seems alot simpler.

Many thanks,

Aaron


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



Re: [PHP-DEV] transversing associative arrays from C

2011-08-25 Thread Aaron Gray

Thanks !

Xinchen Hui larue...@gmail.com wrote in message 
news:7256329410255948429@unknownmsgid...

hi
 every api has lots of 'samples' ,that are the standard extensions in 
src/ext/*


  :)

Thanks
Sent from my iPhone

在 2011-8-26,11:20,Aaron Gray ang.use...@gmail.com 写道:


Hi Stas,

Stas Malyshev smalys...@sugarcrm.com wrote in message 
news:4e56f0d6.20...@sugarcrm.com...

Hi!

On 8/25/11 5:52 PM, Aaron Gray wrote:

Thinking about it what I really want to do is see if a key exists in an
array and get its type to see if it is BOOL and that it is TRUE.


For this, you will need to call zend_hash_find (or zend_symtable_find if 
there's a possibility of keys like 0 that have to be treated as 0).


Okay, found it, zend_hash.h, so that should be accessable to my module 
:)


If you get SUCCESS, the key exists and you'll be getting zval **, then 
either check it's type and value with Z_TYPE_PP and Z_LVAL_PP or call 
zend_is_true(*val) to get generic truth value (like if(), etc. do).


Great.

That seems alot simpler.

Many thanks,

Aaron


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




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