php-i18n Digest 26 Jul 2007 03:45:45 -0000 Issue 363
Topics (messages 1093 through 1100):
Re: PHP intl APIs - part 1
1093 by: tex
1094 by: Stanislav Malyshev
1095 by: tex
1096 by: Vadim Savchuk
1097 by: Stanislav Malyshev
1098 by: Andrei Zmievski
1099 by: tex
Collation/Character Set problem?
1100 by: Frank Reichenbacher
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 ---
We need some close or release API.
If I have a multilingual app, I will create a new collator for the user's
language.
I need to close it, or the app will accumulate many collators.
Also, since an app may use many different subsystems, they are likely to
create their own collators.
We need to be able to free them up.
Cache might be nice, but not urgent.
tex
-----Original Message-----
From: Stanislav Malyshev [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 17, 2007 6:53 PM
To: [EMAIL PROTECTED]
Subject: [PHP-I18N] PHP intl APIs - part 1
Attached are API descriptions for two ICU modules - collation and number
formatting. The descriptions will also be checked into PECL module named
"intl", and the actual code will follow soon.
--
Stanislav Malyshev, Zend Software Architect
[EMAIL PROTECTED] http://www.zend.com/
(408)253-8829 MSN: [EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
We need some close or release API.
If I have a multilingual app, I will create a new collator for the user's
language.
I need to close it, or the app will accumulate many collators.
Right now I think once the variable is unset, the collator would be freed.
--
Stanislav Malyshev, Zend Software Architect
[EMAIL PROTECTED] http://www.zend.com/
(408)253-8829 MSN: [EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
Ok, that's fine, thanks.
1) If I define a collator $coll, and then I reassign $coll to something else
(perhaps another collator)
is the original collator stored in $coll left in memory or will it get
cleaned up at some point?
2) Should we consider any functions useful for debugging memory leaks?
I have in mind something like collator_count() to return a count of the
existing collators.
I know about get_defined_vars() but I was thinking the collators might
become separated from a variable and then be lost...
tex
-----Original Message-----
From: Stanislav Malyshev [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 18, 2007 12:13 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]; 'Hardik'
Subject: Re: [PHP-I18N] PHP intl APIs - part 1
> We need some close or release API.
>
> If I have a multilingual app, I will create a new collator for the
> user's language.
> I need to close it, or the app will accumulate many collators.
Right now I think once the variable is unset, the collator would be freed.
--
Stanislav Malyshev, Zend Software Architect
[EMAIL PROTECTED] http://www.zend.com/
(408)253-8829 MSN: [EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
tex wrote:
> 1) If I define a collator $coll, and then I reassign $coll to something else
> (perhaps another collator)
> is the original collator stored in $coll left in memory or will it get
> cleaned up at some point?
Let me answer with examples.
//-- Example 1 --------------------------------------------------------
$c1 = new Collator( "en_US" ); // creates a collator
$c2 = $c1; // creates a reference to the collator
unset( $c1, $c2 ); // destroys the collator
//---------------------------------------------------------------------
//-- Example 2 -----------------------------------------
$c1 = new Collator( "en_US" ); // creates collator #1
$c2 = new Collator( "ru_RU" ); // creates collator #2
$c1 = $c2; // destroys collator #1
unset( $c1, $c2 ); // destroys collator #2
//------------------------------------------------------
> 2) Should we consider any functions useful for debugging memory leaks?
> I have in mind something like collator_count() to return a count of the
> existing collators.
I don't think we should modify the API for debugging purposes.
--
Vadim
--- End Message ---
--- Begin Message ---
1) If I define a collator $coll, and then I reassign $coll to something else
(perhaps another collator)
is the original collator stored in $coll left in memory or will it get
cleaned up at some point?
It's cleaned up immediately.
2) Should we consider any functions useful for debugging memory leaks?
I have in mind something like collator_count() to return a count of the
existing collators.
I know about get_defined_vars() but I was thinking the collators might
become separated from a variable and then be lost...
PHP has mechanisms for tracking memory leaks, so I don't think we need
anything special in extension APIs.
Speaking of which, we might want to use u_setMemoryFunctions (see
http://www.icu-project.org/apiref/icu4c/uclean_8h.html#5dea766c5e726833400dc0ee24a2bc6a)
to make ICU use PHP's memory function. This, however, depends on whether
ICU allocates any persistent data (caches, etc.) with these functions.
--
Stanislav Malyshev, Zend Software Architect
[EMAIL PROTECTED] http://www.zend.com/
(408)253-8829 MSN: [EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
I looked at that at the start of the Unicode project and found that
ICU does have a need for persistent data. I don't think we can make
it use our memory allocation engine.
-Andrei
On Jul 18, 2007, at 10:26 AM, Stanislav Malyshev wrote:
Speaking of which, we might want to use u_setMemoryFunctions (see
http://www.icu-project.org/apiref/icu4c/
uclean_8h.html#5dea766c5e726833400dc0ee24a2bc6a) to make ICU use
PHP's memory function. This, however, depends on whether ICU
allocates any persistent data (caches, etc.) with these functions.
--
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 ---
Ok, sounds pretty good.
Thanks for the explanations.
tex
-----Original Message-----
From: Vadim Savchuk [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 18, 2007 6:40 AM
To: [EMAIL PROTECTED]
Cc: 'Stanislav Malyshev'; [EMAIL PROTECTED]; 'Hardik'
Subject: Re: [PHP-I18N] PHP intl APIs - part 1
tex wrote:
> 1) If I define a collator $coll, and then I reassign $coll to
> something else (perhaps another collator) is the original collator
> stored in $coll left in memory or will it get cleaned up at some
> point?
Let me answer with examples.
//-- Example 1 --------------------------------------------------------
$c1 = new Collator( "en_US" ); // creates a collator
$c2 = $c1; // creates a reference to the collator
unset( $c1, $c2 ); // destroys the collator
//---------------------------------------------------------------------
//-- Example 2 -----------------------------------------
$c1 = new Collator( "en_US" ); // creates collator #1
$c2 = new Collator( "ru_RU" ); // creates collator #2
$c1 = $c2; // destroys collator #1
unset( $c1, $c2 ); // destroys collator #2
//------------------------------------------------------
> 2) Should we consider any functions useful for debugging memory leaks?
> I have in mind something like collator_count() to return a count of
> the existing collators.
I don't think we should modify the API for debugging purposes.
--
Vadim
--- End Message ---
--- Begin Message ---
Newbie alert.
I have a single table in the only database on my hosted domain for a
medium-sized non-profit organization. The table contains the
list of members and their relevant data.
To manage the database I installed and customized a php/mysql shareware
application. To regulate member access I assign them a user
name based on their last and first names and a password which is the membership
identification number the organization assigns to
them.
It has been in place for about eight months, so far, so good. With one
exception...I have received multiple complaints from users
all over the world that they cannot gain access to their data using their
assigned usernames and passwords. After many emails back
and forth, I usually end up resetting their usernames and passwords to some
simple three or four letter substitues. Whenever I use
their originally assigned usernames and passwords, I have no trouble.
I am well aware of the many foolish ways in which user commit obvious errors,
and I am always alert to these possibilities. But
there have simply been too many complaints, and they are always resolved when I
simplify the username/password combination.
I do not understand the collation/character set issues very well at all, but
isn't it possible that there is a problem with this,
that results in the username/password evaluation process getting screwed up?
The MySQL charset is UTF-8 Unicode (utf8), the MySQL connection collation is
utf8_unicode_ci. However the one table shows a
latin1_swedish_ci collation. Shouldn't the table's collation be the same as the
connection collation -- UTF-8?
Thanks!
Frank
--- End Message ---