History log of /php-src/ext/intl/php_intl.c (Results 76 – 100 of 112)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# f5b42162 31-May-2012 Gustavo André dos Santos Lopes

BreakIterator and RuleBasedBreakiterator added

This commit adds wrappers for the classes BreakIterator and
RuleBasedbreakIterator. The C++ ICU classes are described here:
<http://icu

BreakIterator and RuleBasedBreakiterator added

This commit adds wrappers for the classes BreakIterator and
RuleBasedbreakIterator. The C++ ICU classes are described here:
<http://icu-project.org/apiref/icu4c/classBreakIterator.html>
<http://icu-project.org/apiref/icu4c/classRuleBasedBreakIterator.html>

Additionally, a tutorial is available at:
<http://userguide.icu-project.org/boundaryanalysis>

This implementation wraps UTF-8 text in a UText. The text is
iterated without any copying or conversion to UTF-16. There is
also no validation that the input is actually UTF-8; where there
are malformed sequences, the UText will simply U+FFFD.

The class BreakIterator cannot be instantiated directly (has a
private constructor). It provides the interface exposed by the ICU
abstract class with the same name. The PHP class is not abstract
because we may use it to wrap native subclasses of BreakIterator
that we don't know how to wrap. This class includes methods to
move the iterator position to the beginning (first()), to the
end (last()), forward (next()), backwards (previous()), to the
boundary preceding a certain position (preceding()) and following
a certain position (following()) and to obtain the current position
(current()). next() can also be used to advance or recede an
arbitrary number of positions.

BreakIterator also exposes other native methods:
getAvailableLocales(), getLocale() and factory methods to build
several predefined types of BreakIterators: createWordInstance()
for word boundaries, createCharacterInstance() for locale
dependent notions of "characters", createSentenceInstance() for
sentences, createLineInstance() and createTitleInstance() -- for
title casing breaks. These factories currently return
RuleBasedbreakIterators where the names of the rule sets are found
in the ICU data, observing the passed locale (although the locale
is taken into considering there are very few exceptions to the
root rules).

The clone and compare_object PHP object handlers are also
implemented, though the comparison does not yield meaningful results
when used with >, <, >= and <=.

Note that BreakIterator is an iterator only in the sense of the
first 'Iterator' in 'IteratorIterator', i.e., it does not
implement the Iterator interface. The reason is that there is
no sensible implementation for Iterator::key(). Using it for
an ordinal of the current boundary is not feasible because
we are allowed to move to any boundary at any time. It we were
to determine the current ordinal when last() is called we'd
have to traverse the whole input text to find out how many
breaks there were before. Therefore, BreakIterator implements
only Traversable. It can be wrapped in an IteratorIterator,
but the usual warnings apply.

Finally, I added a convenience method to BreakIterator:
getPartsIterator(). This provides an IntlIterator, backed
by the BreakIterator PHP object (i.e. moving the pointer or
changing the text in BreakIterator affects the iterator
and also moving the iterator affects the backing BreakIterator),
which allows traversing the text between each boundary.
This iterator uses the original text to retrieve the text
between two positions, not the code points returned by the
wrapping UText. Therefore, if the text includes invalid code
unit sequences, these invalid sequences will be in the output
of this iterator, not U+FFFD code points.

The class RuleBasedIterator exposes a constructor that allows
building an iterator from arbitrary compiled or non-compiled
rules. The form of these rules in described in the tutorial linked
above. The rest of the methods allow retrieving the rules --
getRules() and getCompiledRules() --, a hash code of the rule set
(hashCode()) and the rules statuses (getRuleStatus() and
getRuleStatusVec()).

Because the RuleBasedBreakIterator constructor may return parse
errors, I reuse the UParseError to text function that was in the
transliterator files. Therefore, I move that function to
intl_error.c.

common_enum.cpp was also changed, mainly to expose previously
static functions. This avoided code duplication when implementing
the BreakIterator iterator and the IntlIterator returned by
BreakIterator::getPartsIterator().

show more ...

# eb346ef0 03-Jun-2012 Gustavo André dos Santos Lopes

DateFormat plays nice with Calendar, TimeZone

The following changes were made:

* The IntlDateFormatter constructor now accepts the usual values
for its $timezone argument. Thi

DateFormat plays nice with Calendar, TimeZone

The following changes were made:

* The IntlDateFormatter constructor now accepts the usual values
for its $timezone argument. This includes timezone identifiers,
IntlTimeZone objects, DateTimeZone objects and NULL. An empty
string is not accepted. An invalid time zone is no longer accepted
(it used to use UTC in this case).
* When NULL is passed to IntlDateFormatter, the time zone specified in
date.timezone is used instead of the ICU default.
* The IntlDateFormatter $calendar argument now accepts also an
IntlCalendar. In this case, IntlDateFormatter::getCalendar() will
return false.
* The time zone passed to the IntlDateFormatter is ignored if it is
NULL and if the calendar passed is an IntlCalendar object -- in this
case, the IntlCalendar time zone will be used instead. Otherwise,
the time zone specified in the $timezone argument is used instead.
* Added IntlDateFormatter::getCalendarObject(), which always returns
the IntlCalendar object that backs the DateFormat, even if a
constant was passed to the constructor, i.e., if an IntlCalendar
was not passed to the constructor.
* Added IntlDateFormatter::setTimeZone(). It accepts the usual values
for time zone arguments. If NULL is passed, the time zone of the
IntlDateFormatter WILL be overridden with the default time zone,
even if an IntlCalendar object was passed to the constructor.
* Added IntlDateFormatter::getTimeZone(), which returns the time zone
that's associated with the DateFormat.
* Depreacated IntlDateFormatter::setTimeZoneId() and made it an alias
for IntlDateFormatter::setTimeZone(), as the new ::setTimeZone()
also accepts plain identifiers, besides other types.
IntlDateFormatter::getTimeZoneId() is not deprecated however.
* IntlDateFormatter::setCalendar() with a constant passed should now
work correctly. This requires saving the requested locale to the
constructor.
* Centralized the hacks required to avoid compilation disasters on
Windows due to some headers being included inside and outside of
extern "C" blocks.

show more ...

Revision tags: php-5.3.14RC2, php-5.4.4RC2
# 3a81f90e 17-May-2012 Gustavo André dos Santos Lopes

Added IntlCalendar::toDateTime()

Revision tags: php-5.3.14RC1, php-5.4.4RC1, php-5.3.13, php-5.4.3, php-5.4.2, php-5.3.12
# 4cfd9995 30-Apr-2012 Gustavo André dos Santos Lopes

Added IntlTimeZone::fromDateTimeZone() and ::toDateTimeZone.

IntlTimeZone::fromDateTimeZone(DateTimeZone $dtz) converts from an
ext/date TimeZone to an IntlTimeZone. The conversion is do

Added IntlTimeZone::fromDateTimeZone() and ::toDateTimeZone.

IntlTimeZone::fromDateTimeZone(DateTimeZone $dtz) converts from an
ext/date TimeZone to an IntlTimeZone. The conversion is done by feeding
the time zone name (essentially what would be given by
DateTimeZone::getName()) to ICU's TimeZone::createTimeZone except if it's
an offset time zone. In that case, the offset is read from the ext/date
time zone object structure and an appopriate id (of the form
GMT<+|-><HH:MM>) is given to ICU's TimeZone::createTimeZone. Not all
ext/date time zones are recognized for ICU. For instance, WEST is not.
Note that these kind of abbreviations, as far as I can tell, can only be
created via ext/date DateTime, not directly through DateTimeZone's
constructor.

For IntlTimeZone::toDateTimeZone(), the behavior is symmetrical.
We instantiate a DateTimeZone and then call its constructor if we don't
have an offset time zone, otherwise we mess with its structure. If the
timezone is not valid for ext/date, then we allow the exception of
DateTimeZone constructor to propagate.

show more ...

Revision tags: php-5.3.11, php-5.4.1, php-5.3.11RC2, php-5.4.1RC2
# 81278e1b 06-Apr-2012 Gustavo André dos Santos Lopes

Added IntlCalendar::fromDateTime()

IntlCalendar::fromDateTime(DateTime|string $dateTime[, string $locale)
intlcal_from_date_time(...)

If a string is given as the first argument,

Added IntlCalendar::fromDateTime()

IntlCalendar::fromDateTime(DateTime|string $dateTime[, string $locale)
intlcal_from_date_time(...)

If a string is given as the first argument, the method will try to
instantiate a new DateTime object and use that instead.

show more ...

# 9a35d45a 06-Apr-2012 Gustavo André dos Santos Lopes

Accept DateTimeZone where time zones are expected.

Also unified timezone handling in IntlCalendar::setTimeZone()
to that in the IntlCalendar and IntlGregorianCalendar constructors.

# 95fbae89 01-Apr-2012 Gustavo André dos Santos Lopes

Compatibility with old versions of ICU (4.0+).

# 69f75bb4 01-Apr-2012 Gustavo André dos Santos Lopes

Added support for new method TimeZone::getUnknown() added in ICU 49.

# d3a29c10 01-Apr-2012 Gustavo André dos Santos Lopes

Supported Calendar methods new to ICU 49.

# 5e65205a 01-Apr-2012 Gustavo André dos Santos Lopes

Initial checkin of calendar/timezone code.

Revision tags: php-5.3.11RC1, php-5.4.1RC1, PHP-5.4.1-RC1, php-5.4.0, php-5.4.0RC8, php-5.3.10, php-5.4.0RC7, php-5.4.0RC6, php-5.3.9
# 10324891 08-Jan-2012 Gustavo André dos Santos Lopes

- Added the ability for the intl exception to throw exceptions when a global error is set.

Revision tags: php-5.4.0RC5, php-5.3.9RC4, php-5.4.0RC4, php-5.3.9RC3, php-5.4.0RC3
# 5fa1cfbb 24-Nov-2011 Gustavo André dos Santos Lopes

- Support for UTS #46.

# fa4fe639 24-Nov-2011 Gustavo André dos Santos Lopes

- Support for UTS #46.

Revision tags: php-5.3.9RC2, php-5.4.0RC2, php-5.4.0RC1, php-5.3.9RC1, php-5.4.0beta2, php-5.4.0beta1, yaf-2.1.0, php-5.3.8, php-5.3.7, php-5.3.7RC5, php-5.4.0alpha3, php-5.3.7RC4
# 23e43859 25-Jul-2011 Felipe Pena

- Make usage of new PHP_FE_END macro

# 4b30846b 25-Jul-2011 Felipe Pena

- Make usage of new PHP_FE_END macro

# da376383 25-Jul-2011 Felipe Pena

- Make usage of new PHP_FE_END macro

Revision tags: php-5.3.7RC3, php-5.4.0alpha2, php-5.3.7RC2, php-5.4.0alpha1, php-5.3.7RC1
# 00a6dd29 03-Jun-2011 Ilia Alshanetsky

Show ICU Data version inside phpinfo()

# 31b91d7c 03-Jun-2011 Ilia Alshanetsky

Show ICU Data version inside phpinfo()

# 53b6c0c8 03-Jun-2011 Ilia Alshanetsky

Show ICU Data version inside phpinfo()

# e6c9a31c 01-Jun-2011 Ilia Alshanetsky

Implemented FR #54561 (Expose ICU Version & ICU Data Version info).

# b8ffccb3 01-Jun-2011 Ilia Alshanetsky

Implemented FR #54561 (Expose ICU Version & ICU Data Version info).

# ccd3633b 01-Jun-2011 Ilia Alshanetsky

Implemented FR #54561 (Expose ICU Version & ICU Data Version info).

Revision tags: php-5.3.6, php-5.3.6RC3, php-5.3.6RC2, php-5.3.6RC1
# 71f5af6c 15-Feb-2011 Pierre Joye

- fix build with ICU < 4.2, add ICU_VERSION for m4 checks

# d9039485 13-Jan-2011 Scott MacVicar

Add Spoofchecker to intl extension.

Implements part of Unicode TR36 and TR39

Revision tags: php-5.2.17, php-5.3.5, php-5.2.16, php-5.2.15, php-5.3.4, php-5.2.15RC2, php-5.3.4RC2, php-5.3.4RC1, php-5.2.15RC1, PHP_5_2_15RC1
# e283f7a7 06-Oct-2010 Gustavo André dos Santos Lopes

- Added support for ICU Transformations (Transliterator).
- Changes request #52986 to "to be documented".

12345