Flavius Aspra | 1 Oct 19:01 2011
Picon

[PHP-DEV] ksort an array internally (OR: interate a numerically-indexed array with respect to the indeces)

Hi

How can I ksort() an array?

The default implementation does basically this: 
zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_key_compare, 0 
TSRMLS_CC) but php_array_key_compare() is static in ext/standard/array.c [1]

Actually I wouldn't need to sort by key at all if add_index_zval() would 
put the zval at the "right" [2] place from the beginning. Is there any 
better alternative to add_index_zval() in this regard?

Preferably without going through the hassle of making a round-trip via 
zend_call_function() "directly" to zif_ksort().

What I need is to zend_hash_move_forward() & co but to get the elements 
in the order indicated by the numeric indeces.

Thanks,
Flavius

[1] http://lxr.php.net/opengrok/xref/PHP_5_3/ext/standard/array.c#250
[2] I know the HT implementation is made to be generalized enough for 
other use cases, and as such, there is no "right" order. Thus I'm 
thinking maybe there's some way to add a new numerically-indexed element 
to the HT and "teach" the HT to do the bookkeeping in respect to the 
numeric order. Or maybe a better way to iterate such an array.

--

-- 
What I cannot create, I do not understand. -- Feynman
(Continue reading)

Laruence | 2 Oct 15:37 2011
Picon
Picon

Re: config.m4 possibly undefined macro

Hi:
    this warning can be ignored safely,

    it seems a bug of php autoconf,  maybe  someone can verify this ?

    in the PHP_NEW_EXTENSION defination,  I comment out the case
statement of host_alias (this is also be down in PHP_SHARED_MODULE, so
I think it might be a unecessary codes), then fixed the warnig:

           PHP_ADD_SOURCES_X(PHP_EXT_DIR($1),$2,$ac_extra,shared_objects_$1,yes)
-      case $host_alias in
-        *netware*[)]
          PHP_SHARED_MODULE(php$1,shared_objects_$1, $ext_builddir, $6, $7)
 -         ;;
 -      *[)]
 -        PHP_SHARED_MODULE($1,shared_objects_$1, $ext_builddir, $6, $7)
 -       ;;
 -     esac
      AC_DEFINE_UNQUOTED([COMPILE_DL_]translit($1,a-z_-,A-Z__), 1,
Whether to build $1 as dynamic module)
    fi
  fi

thanks

2011/10/2 Bertrand Mansion <bmansion <at> mamasam.com>:
> Hi,
>
> I'd like to call my extension "utrac", but when I run phpize, it
> returns the following error :
(Continue reading)

Bertrand Mansion | 2 Oct 16:10 2011

[PHP-DEV] Re: [PECL-DEV] config.m4 possibly undefined macro

If I ignore it and run ./configure --with-utrac
I get :

    config.status: error: cannot find input file: config.h.in

I don't get this error if I use another name.
So it doesn't seem so safe to ignore this warning after all :)

Le 2 oct. 2011 à 15:37, Laruence a écrit :

> Hi:
>    this warning can be ignored safely,
> 
>    it seems a bug of php autoconf,  maybe  someone can verify this ?
> 
>    in the PHP_NEW_EXTENSION defination,  I comment out the case
> statement of host_alias (this is also be down in PHP_SHARED_MODULE, so
> I think it might be a unecessary codes), then fixed the warnig:
> 
>           PHP_ADD_SOURCES_X(PHP_EXT_DIR($1),$2,$ac_extra,shared_objects_$1,yes)
> -      case $host_alias in
> -        *netware*[)]
>          PHP_SHARED_MODULE(php$1,shared_objects_$1, $ext_builddir, $6, $7)
> -         ;;
> -      *[)]
> -        PHP_SHARED_MODULE($1,shared_objects_$1, $ext_builddir, $6, $7)
> -       ;;
> -     esac
>      AC_DEFINE_UNQUOTED([COMPILE_DL_]translit($1,a-z_-,A-Z__), 1,
> Whether to build $1 as dynamic module)
(Continue reading)

Lars Nielsen | 2 Oct 17:19 2011
Picon

[PHP-DEV] GD Lib for PHP?

Hi, 
I am not sure if this should go to the general list or here. 

What is happening to the "GDlib" graphics library? Is it deprecated? I
have found a package on google-code which can be compiled on
ubuntu/debian but it seems that it has not been updated for years?

What is the approach to take here? Should I go for Imagemagick instead?
or something diferent?

Regards
Lars Nielsen
http://www.lfweb.dk

--

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

Pierre Joye | 2 Oct 17:25 2011
Picon

Re: [PHP-DEV] GD Lib for PHP?

hi,

It is not deprecated, it is maintained, in and outside php as well.

Which package are you referring to? bitbucket has the libgd's
standalone version and php's src has its bundled version, which is the
recommended one to use with php.

Cheers,

On Sun, Oct 2, 2011 at 5:19 PM, Lars Nielsen <lars <at> lfweb.dk> wrote:
> Hi,
> I am not sure if this should go to the general list or here.
>
> What is happening to the "GDlib" graphics library? Is it deprecated? I
> have found a package on google-code which can be compiled on
> ubuntu/debian but it seems that it has not been updated for years?
>
> What is the approach to take here? Should I go for Imagemagick instead?
> or something diferent?
>
> Regards
> Lars Nielsen
> http://www.lfweb.dk
>
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
(Continue reading)

Lars Nielsen | 2 Oct 17:28 2011
Picon

Re: [PHP-DEV] GD Lib for PHP?

Thanks Pierre,

I have been using GD with Drupal and with the standard gd of either php
or debian/ubuntu Drupal is complaining that GD is not functional.

So I just have to compile and install the version from bitbucket?

Regards Lars
søn, 02 10 2011 kl. 17:25 +0200, skrev Pierre Joye:
> hi,
> 
> It is not deprecated, it is maintained, in and outside php as well.
> 
> Which package are you referring to? bitbucket has the libgd's
> standalone version and php's src has its bundled version, which is the
> recommended one to use with php.
> 
> Cheers,
> 
> On Sun, Oct 2, 2011 at 5:19 PM, Lars Nielsen <lars <at> lfweb.dk> wrote:
> > Hi,
> > I am not sure if this should go to the general list or here.
> >
> > What is happening to the "GDlib" graphics library? Is it deprecated? I
> > have found a package on google-code which can be compiled on
> > ubuntu/debian but it seems that it has not been updated for years?
> >
> > What is the approach to take here? Should I go for Imagemagick instead?
> > or something diferent?
> >
(Continue reading)

Pierre Joye | 2 Oct 17:36 2011
Picon

Re: [PHP-DEV] GD Lib for PHP?

Debian or Ubuntu (they share the same base) uses the external
libraries. Some old versions of these distributions do not have the
newest code and some GD functions available in the php's gd may not be
available. There is already a bug report there about it.

If you can compile it I would suggest to simply take the
php-src/ext/gd one and compile it like a shared extension. Be sure to
uninstall the libgd headers first (debian's).

On Sun, Oct 2, 2011 at 5:28 PM, Lars Nielsen <lars <at> lfweb.dk> wrote:
> Thanks Pierre,
>
> I have been using GD with Drupal and with the standard gd of either php
> or debian/ubuntu Drupal is complaining that GD is not functional.
>
> So I just have to compile and install the version from bitbucket?
>
> Regards Lars
> søn, 02 10 2011 kl. 17:25 +0200, skrev Pierre Joye:
>> hi,
>>
>> It is not deprecated, it is maintained, in and outside php as well.
>>
>> Which package are you referring to? bitbucket has the libgd's
>> standalone version and php's src has its bundled version, which is the
>> recommended one to use with php.
>>
>> Cheers,
>>
>> On Sun, Oct 2, 2011 at 5:19 PM, Lars Nielsen <lars <at> lfweb.dk> wrote:
(Continue reading)

Reindl Harald | 2 Oct 17:56 2011
Picon

Re: [PHP-DEV] GD Lib for PHP?


Am 02.10.2011 17:28, schrieb Lars Nielsen:
> Thanks Pierre,
> 
> I have been using GD with Drupal and with the standard gd of either php
> or debian/ubuntu Drupal is complaining that GD is not functional.
> 
> So I just have to compile and install the version from bitbucket?

no - complain to debian!

distributions normally use their libraries for compiling software
and never static bits - but debian is known to have way too old
libraries most of the time

on ffedora PHP / GD is working like a charme!

gd-devel-2.0.35-11.fc13.x86_64
gd-2.0.35-11.fc13.x86_64

Laruence | 2 Oct 18:12 2011
Picon
Picon

Re: config.m4 possibly undefined macro

Hi:
   in that case,  you can change name to whatever except ***ac.

   thanks

2011/10/2 Bertrand Mansion <bmansion <at> mamasam.com>:
> If I ignore it and run ./configure --with-utrac
> I get :
>
>    config.status: error: cannot find input file: config.h.in
>
> I don't get this error if I use another name.
> So it doesn't seem so safe to ignore this warning after all :)
>
> Le 2 oct. 2011 à 15:37, Laruence a écrit :
>
>> Hi:
>>    this warning can be ignored safely,
>>
>>    it seems a bug of php autoconf,  maybe  someone can verify this ?
>>
>>    in the PHP_NEW_EXTENSION defination,  I comment out the case
>> statement of host_alias (this is also be down in PHP_SHARED_MODULE, so
>> I think it might be a unecessary codes), then fixed the warnig:
>>
>>           PHP_ADD_SOURCES_X(PHP_EXT_DIR($1),$2,$ac_extra,shared_objects_$1,yes)
>> -      case $host_alias in
>> -        *netware*[)]
>>          PHP_SHARED_MODULE(php$1,shared_objects_$1, $ext_builddir, $6, $7)
>> -         ;;
(Continue reading)

sean finney | 2 Oct 19:16 2011
Picon

Re: [PHP-DEV] GD Lib for PHP?

Hi,

On Sun, Oct 02, 2011 at 05:56:10PM +0200, Reindl Harald wrote:
> Am 02.10.2011 17:28, schrieb Lars Nielsen:
> no - complain to debian!

Or don't bother complaining at all, it's already been discussed ad naseum.

Furthermore AIUI it's semi-moot in the latest debian/ubuntu packages as
Pierre has added some form of compat layer (not sure why that was done
as opposed to the below, but... *shrug*...).

> distributions normally use their libraries for compiling software
> and never static bits - but debian is known to have way too old
> libraries most of the time

You know, given that libgd is being maintained by php developers (both
the bundled version and non-bundled version), you could also just make
sure that the "official" libgd has all those php-customized changes in
it, and then this would never have been a problem in the first place.  I
mean, why fork a library that you're already maintaining?

	sean

-- 

--

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

(Continue reading)


Gmane