php-i18n Digest 30 May 2008 14:38:04 -0000 Issue 396

Topics (messages 1222 through 1230):

Re: intl 1.0.0RC1
        1222 by: Texin, Tex
        1223 by: Darren Cook
        1224 by: Stanislav Malyshev
        1225 by: Darren Cook
        1226 by: Stanislav Malyshev
        1227 by: Darren Cook
        1228 by: Darren Cook
        1230 by: David Zülke

Re: ubuntu 7.10 pecl install intl
        1229 by: Darren Cook

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
Hooray! 

> -----Original Message-----
> From: Stanislav Malyshev [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, May 27, 2008 2:27 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP-I18N] intl 1.0.0RC1
> 
> Hi!
> 
> I've uploaded 1.0.0RC1 version of intl extension on PECL. 
> Please test it and if you think anything has to be 
> added/fixed for 1.0.0 please tell.
> --
> Stanislav Malyshev, Zend Software Architect
> [EMAIL PROTECTED]   http://www.zend.com/
> (408)253-8829   MSN: [EMAIL PROTECTED]
> 
> --
> PHP Unicode & I18N Mailing List (http://www.php.net/) To 
> unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

--- End Message ---
--- Begin Message ---
> I've uploaded 1.0.0RC1 version of intl extension on PECL. Please test it
> and if you think anything has to be added/fixed for 1.0.0 please tell.

It now refuses to install on php 5.2.3, i.e. ubuntu 7.10.  (Wasn't the
plan to include the required macros in the ./configure script (or
whatever) so that it could install on more PHP installations.)

Putting the latest acinclude.m4 in /usr/lib/php5/build/ and then doing:
   pecl install --ignore-errors intl

trips up at the same place it did before, with a ptrdiff_t problem [1].

If you need more information from me, let me know. Thanks,

Darren


[1]:
 gcc -I/usr/include -I. -I/tmp/pear/temp/intl -DPHP_ATOM_INC
-I/var/tmp/pear-build-root/intl-1.0.0RC1/include
-I/var/tmp/pear-build-root/intl-1.0.0RC1/main -I/tmp/pear/temp/intl
-I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM
-I/usr/include/php5/Zend -I/usr/include/php5/ext
-I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H -g -O2 -c
/tmp/pear/temp/intl/collator/collator_sort.c  -fPIC -DPIC -o
collator/.libs/collator_sort.o
/tmp/pear/temp/intl/collator/collator_sort.c:30: error: conflicting
types for 'ptrdiff_t'
/usr/lib/gcc/i486-linux-gnu/4.1.3/include/stddef.h:152: error: previous
declaration of 'ptrdiff_t' was here



-- 
Darren Cook
http://dcook.org/mlsn/ (English-Japanese-German-Chinese free dictionary)
http://dcook.org/work/ (About me and my work)
http://dcook.org/work/charts/  (My flash charting demos)

--- End Message ---
--- Begin Message ---
Hi!

It now refuses to install on php 5.2.3, i.e. ubuntu 7.10.  (Wasn't the
plan to include the required macros in the ./configure script (or
whatever) so that it could install on more PHP installations.)

Well, I'm not sure how these macros can be included without conflicting with 5.2.4 where these macros are already defined in system config. If you know how to do it please send a patch.

/tmp/pear/temp/intl/collator/collator_sort.c  -fPIC -DPIC -o
collator/.libs/collator_sort.o
/tmp/pear/temp/intl/collator/collator_sort.c:30: error: conflicting
types for 'ptrdiff_t'
/usr/lib/gcc/i486-linux-gnu/4.1.3/include/stddef.h:152: error: previous
declaration of 'ptrdiff_t' was here

Something is wrong here - this line is specifically surrounded with
#if !defined(HAVE_PTRDIFF_T) && !defined(_PTRDIFF_T_DEFINED)
how happens it's executed?
My php_config.h has #define HAVE_PTRDIFF_T 1 - does yours? If not, does your configure.in have check for ptrdiff?
--
Stanislav Malyshev, Zend Software Architect
[EMAIL PROTECTED]   http://www.zend.com/
(408)253-8829   MSN: [EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
> Well, I'm not sure how these macros can be included without conflicting
> with 5.2.4 where these macros are already defined in system config.

Sorry, I don't know either. It seems like redefining a macro should be a
common need however.

> Something is wrong here - this line is specifically surrounded with
> #if !defined(HAVE_PTRDIFF_T) && !defined(_PTRDIFF_T_DEFINED)
> how happens it's executed?
> My php_config.h has #define HAVE_PTRDIFF_T 1 - does yours? If not, does
> your configure.in have check for ptrdiff?

The only ptrdiff reference in php_config.h is:

/* The size of `ptrdiff_t', as computed by sizeof. */
#define SIZEOF_PTRDIFF_T 4


I don't have a configure.in (under either /usr/include/php5 or
/usr/lib/php5), and no references to ptrdiff or PTRDIFF inside any file
in /usr/lib/php5/build.

Looking through cvs, it seems something ptrdiff-related was added to
configure.in 11 months ago:
 http://cvs.php.net/viewvc.cgi/php-src/configure.in?r1=1.628&r2=1.629

Is this another php 5.2.4 dependency? What do I need to add to
php_config.h, on a 32-bit OS, to get past this?

Thanks for your help,

Darren


-- 
Darren Cook
http://dcook.org/mlsn/ (English-Japanese-German-Chinese free dictionary)
http://dcook.org/work/ (About me and my work)
http://dcook.org/work/charts/  (My flash charting demos)

--- End Message ---
--- Begin Message ---
Hi!

The only ptrdiff reference in php_config.h is:

/* The size of `ptrdiff_t', as computed by sizeof. */
#define SIZEOF_PTRDIFF_T 4

That's strange -

I don't have a configure.in (under either /usr/include/php5 or
/usr/lib/php5), and no references to ptrdiff or PTRDIFF inside any file
in /usr/lib/php5/build.

You are supposed to have configure.in - it's part of PHP source. Do you use binary install? If so, which version?

Is this another php 5.2.4 dependency? What do I need to add to
php_config.h, on a 32-bit OS, to get past this?

I guess adding correct definition for HAVE_PTRDIFF_T should be enough.
--
Stanislav Malyshev, Zend Software Architect
[EMAIL PROTECTED]   http://www.zend.com/
(408)253-8829   MSN: [EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
> Well, I'm not sure how these macros can be included without conflicting
> with 5.2.4 where these macros are already defined in system config. If
> you know how to do it please send a patch.

A quick bit of study suggests it most likely "just works", as long as
you have square brackets around the macro name (see
http://ac-archive.sourceforge.net/doc/howto.html and search for word
"redefine").

As a quick test I added a 2nd copy of AC_DEFUN([PHP_SETUP_ICU],[...]) to
/usr/lib/php5/build/acinclude.m4 and it didn't cause an error.

Darren


-- 
Darren Cook
http://dcook.org/mlsn/ (English-Japanese-German-Chinese free dictionary)
http://dcook.org/work/ (About me and my work)
http://dcook.org/work/charts/  (My flash charting demos)

--- End Message ---
--- Begin Message ---
>> I don't have a configure.in (under either /usr/include/php5 or
>> /usr/lib/php5), and no references to ptrdiff or PTRDIFF inside any file
>> in /usr/lib/php5/build.
> 
> You are supposed to have configure.in - it's part of PHP source. Do you
> use binary install? If so, which version?

ubuntu 7.10, with php5 (i.e. 5.2.3) and php5-dev packages.

>> Is this another php 5.2.4 dependency? What do I need to add to
>> php_config.h, on a 32-bit OS, to get past this?
> 
> I guess adding correct definition for HAVE_PTRDIFF_T should be enough.

OK, I added this line at the end of php_config.h:
#define HAVE_PTRDIFF_T 1

And "pecl install intl" now works!
A quick test of Normalizer::normalize() worked.

Thanks for your help,

Darren

-- 
Darren Cook
http://dcook.org/mlsn/ (English-Japanese-German-Chinese-Arabic
                        open source dictionary/semantic network)
http://dcook.org/work/ (About me and my work)
http://dcook.org/work/charts/  (My flash charting demos)

--- End Message ---
--- Begin Message ---
Hi Stas,

some things we noticed:

- I still think IntlDateFormatter vs the rest w/o Intl prefix is inconsistent. Can't we just prefix it with "Intl" across the board? Saves trouble down the road

- DateFormatter::parse() and DateFormater::localtime() should have the second argument ($parse_pos) as a reference - it is supposed to "return" the position where an error occured, in case it could not parse the given value. ICU does have it this way, and I think PHP should, too. It's pretty valuable information, and if only for debugging purposes. - IntlDateFormatter::format() does not accept DateTime (I think that is a known issue)
- There is no way to use or retrieve milliseconds, so far

- What does Collator::sortWithKeys() do, exactly? Why not always have this one? Why does the API have a "normal" sorting function and an optimized one? Why not just always use the sorting with ucol_getSortKey() keys? And why is there no Collator::asortWithKeys(), to keep the API consistent?

- INTL_MAX_LOCALE_LEN is 64 - what if I have a longer locale string, with options?

- http://php.net/manual/en/intl.examples.php uses a "getLocaleByType()" method that does not exist

The only "critical" thing, I would say, is having the $parse_pos argument as a reference, as changing that in a later release would break code if people pass a value directly. The rest is pretty much just questions I'm hoping you could answer, not actual problems ;)

Cheers,

David


Am 27.05.2008 um 23:26 schrieb Stanislav Malyshev:

Hi!

I've uploaded 1.0.0RC1 version of intl extension on PECL. Please test it and if you think anything has to be added/fixed for 1.0.0 please tell.
--
Stanislav Malyshev, Zend Software Architect
[EMAIL PROTECTED]   http://www.zend.com/
(408)253-8829   MSN: [EMAIL PROTECTED]

--
PHP Unicode & I18N Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




--- End Message ---
--- Begin Message ---
> Has anyone managed to install "intl" pecl extension on ubuntu?

Now I have this working I've summarized the steps here:

http://darrendev.blogspot[DOT]com/2008/05/install-php-pecl-intl-module-for-ubuntu.html

(Change [DOT] to ".". Apologies for not being able to make that
clickable; but foolishly (IMHO) PHP lists are using SBL, where some
idiot (or employee of a google competitor) has blacklisted blogspot.com.)

Darren

-- 
Darren Cook
http://dcook.org/mlsn/ (English-Japanese-German-Chinese-Arabic
                        open source dictionary/semantic network)
http://dcook.org/work/ (About me and my work)
http://dcook.org/work/charts/  (My flash charting demos)



--- End Message ---

Reply via email to