summaryrefslogtreecommitdiff
path: root/ext/intl
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | - Fixed bug #62564 (Extending MessageFormatter and adding property causes crash)Felipe Pena2012-07-141-0/+1
| | | |
* | | | Merge branch 'PHP-5.4'Stanislav Malyshev2012-06-309-20/+20
|\ \ \ \ | |/ / / | | | | | | | | | | | | * PHP-5.4: Fixed the common misspelling of the word occurred (occured -> occurred)
| * | | Fixed the common misspelling of the word occurred (occured -> occurred)Marc Easen2012-06-309-20/+20
| | | |
* | | | - Fixed buildFelipe Pena2012-06-271-0/+1
| | | |
* | | | Merge branch 'break_iterator'Gustavo André dos Santos Lopes2012-06-2557-122/+3375
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * break_iterator: Fix typo in error message BreakIterator: fix compat with old ICU versions Fix build error one ext/intl BreakIterator::getPartsIterator: new optional arg Added IntlCodePointBreakIterator. Add Intl prefix to BreakIterator/RuleBasedBI Remove trailing space Replaced zend_parse_method_params with plain zpp BreakIter: Removed getAvailableLocales/getHashCode Change in BreakIterator::getPartsIterator() BreakIterator: add rules status constants Tests for (RuleBased)BreakIterator. BreakIterator and RuleBasedBreakiterator added
| * | | | Fix typo in error messageGustavo André dos Santos Lopes2012-06-252-2/+2
| | | | |
| * | | | BreakIterator: fix compat with old ICU versionsGustavo André dos Santos Lopes2012-06-255-2/+22
| | | | |
| * | | | Fix build error one ext/intlGustavo André dos Santos Lopes2012-06-251-1/+2
| | | | |
| * | | | BreakIterator::getPartsIterator: new optional argGustavo André dos Santos Lopes2012-06-226-7/+152
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Can take one of: * IntlPartsIterator::KEY_SEQUENTIAL (keys are 0, 1, ...) * IntlPartsIterator::KEY_LEFT (keys are left boundaries) * IntlPartsIterator::KEY_LEFT (keys are right boundaries) The default is IntlPartsIterator::KEY_SEQUENTIAL (the previous behavior).
| * | | | Added IntlCodePointBreakIterator.Gustavo André dos Santos Lopes2012-06-2215-2/+736
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Objects of this class can be instantiated with IntlBreakIterator::createCodePointInstance() The method does not take a locale, as it would not make sense in this context. This class has one additional method: long IntlCodePointIterator::getLastCodePoint() which returns either -1 or the last code point we moved over, if any (and discounting any movement before the last call to IntlBreakIterator::first() or IntlBreakIterator::last()).
| * | | | Add Intl prefix to BreakIterator/RuleBasedBIGustavo André dos Santos Lopes2012-06-1031-137/+137
| | | | |
| * | | | Remove trailing spaceGustavo André dos Santos Lopes2012-06-105-62/+62
| | | | |
| * | | | Replaced zend_parse_method_params with plain zppGustavo André dos Santos Lopes2012-06-102-29/+31
| | | | |
| * | | | BreakIter: Removed getAvailableLocales/getHashCodeGustavo André dos Santos Lopes2012-06-108-84/+0
| | | | |
| * | | | Change in BreakIterator::getPartsIterator()Gustavo André dos Santos Lopes2012-06-106-13/+115
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | BreakIterator::getPartsIterator() now returns an IntlIterator subclass with a special method, getBreakIterator(), that returns the associated BreakIterator. Any call to getRuleStatus() is forwarded to the BreakIterator.
| * | | | BreakIterator: add rules status constantsGustavo André dos Santos Lopes2012-06-041-0/+29
| | | | |
| * | | | Tests for (RuleBased)BreakIterator.Gustavo André dos Santos Lopes2012-06-0431-0/+842
| | | | |
| * | | | BreakIterator and RuleBasedBreakiterator addedGustavo André dos Santos Lopes2012-06-0417-121/+1583
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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().
* | | | Duplicate test for ICU 49Gustavo André dos Santos Lopes2012-06-252-2/+277
| | | | | | | | | | | | | | | | | | | | The output in ICU < 49 actually seems wrong here; ICU 49 seems to fix the data.
* | | | Fix undeclared intl_locale_get_default()Gustavo André dos Santos Lopes2012-06-258-20/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was causing segfaults at least in the resourcebundle constructor. Also moved intl_locale_get_default() to a more central location and fixed a constness warning in resourcebundle_ctor().
* | | | Merge branch 'PHP-5.4'Xinchen Hui2012-06-0710-240/+66
|\ \ \ \ | |/ / / |/| / / | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By Gustavo André dos Santos Lopes (4) and others via Felipe Pena (2) and Xinchen Hui (2) * PHP-5.4: Remove unused codes based on microsoft's description,the direct convert from FILETIME struct to __int64 is unsafe. merge 5.3 entries restore NEWS Fix ext/intl build on ICU < 4.8 Optimization in ext/intl/msgformat Fixed tests in ext/intl Changed XFAILed collator_get_sort_key.phpt
| * | Merge branch 'PHP-5.3' into PHP-5.4Xinchen Hui2012-06-0710-240/+66
| |\ \ | | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By Gustavo André dos Santos Lopes (4) and others via Felipe Pena (1) and Xinchen Hui (1) * PHP-5.3: Remove unused codes based on microsoft's description,the direct convert from FILETIME struct to __int64 is unsafe. Fix ext/intl build on ICU < 4.8 Optimization in ext/intl/msgformat Fixed tests in ext/intl Changed XFAILed collator_get_sort_key.phpt
| | * Fix ext/intl build on ICU < 4.8Gustavo André dos Santos Lopes2012-06-061-0/+2
| | |
| | * Optimization in ext/intl/msgformatGustavo André dos Santos Lopes2012-06-067-5/+24
| | | | | | | | | | | | | | | Don't transform the string to make it apostrophe friendly in ICU 4.8+ as that it is now the default.
| | * Fixed tests in ext/intlGustavo André dos Santos Lopes2012-06-052-199/+5
| | | | | | | | | | | | | | | | | | | | | 21 is not a valid value for UNUM_PADDING_POSITION. Changed the test to use 2 instead. Remove ICU 4.2- test. No one cares.
| | * Changed XFAILed collator_get_sort_key.phptGustavo André dos Santos Lopes2012-06-041-36/+35
| | | | | | | | | | | | | | | | | | Ressurected and limited to ICU 4.8 in the hope that the sort keys will remain stable in more recent ICU versions. I have only tested with ICU 4.8 so far.
* | | Added and fixed tests given eb346efGustavo André dos Santos Lopes2012-06-0417-69/+400
| | |
* | | DateFormat plays nice with Calendar, TimeZoneGustavo André dos Santos Lopes2012-06-0428-358/+768
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Added private constructor to IntlTimeZone.Gustavo André dos Santos Lopes2012-06-033-0/+10
| | |
* | | Fixed write in constant memory.Gustavo André dos Santos Lopes2012-06-031-2/+2
| | | | | | | | | | | | clang did not forgive.
* | | Merge branch 'PHP-5.4'Stanislav Malyshev2012-05-291-1/+1
|\ \ \ | |/ / | | | | | | | | | | | | * PHP-5.4: fix test fix test
| * | fix testphp-5.4.4RC2Stanislav Malyshev2012-05-291-1/+1
| | |
* | | Fixed problem in IntlCalendar debug handlerGustavo André dos Santos Lopes2012-05-252-4/+2
| | | | | | | | | | | | | | | | | | *is_temp was not being set. Also deleted a redundant assignment to *is_temp in IntlTimeZone.
* | | Merge branch '5.4'Gustavo André dos Santos Lopes2012-05-242-0/+25
|\ \ \ | |/ /
| * | Merge branch '5.3' into 5.4Gustavo André dos Santos Lopes2012-05-242-0/+25
| |\ \ | | |/
| | * Fixed bug #55610: ResourceBundle and TraversableGustavo André dos Santos Lopes2012-05-242-0/+25
| | |
| * | Fixed last commit on 5.4Gustavo André dos Santos Lopes2012-05-241-1/+1
| | | | | | | | | | | | | | | | | | There's no change from the intended behavior. If INTL_G(default_locale) is NULL, the default ICU locale, as given by locale_get_default() in master, will still be used by ures_open().
* | | Merge branch '5.4'Gustavo André dos Santos Lopes2012-05-242-7/+41
|\ \ \ | |/ / | | | | | | | | | Conflicts: UPGRADING
| * | Changed ResourceBundle constructor behaviorGustavo André dos Santos Lopes2012-05-242-7/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | null is now accepted for two first (mandatory arguments). Passing null as the package name causes NULL to be passed to ICU and the default ICU data to be loaded. Passing null as the locale name causes the default locale to be used.
* | | Merge branch '5.4'Gustavo André dos Santos Lopes2012-05-242-4/+58
|\ \ \ | |/ /
| * | Merge branch '5.3' into 5.4Gustavo André dos Santos Lopes2012-05-242-4/+58
| |\ \ | | |/
| | * Fixed bug #60785Gustavo André dos Santos Lopes2012-05-242-4/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | Memory leak in IntlDateFormatter constructor. udat_setCalendar() clones the calendar before it adopts it, so we were leaking the original calendar. Also we now validate the calendar type.
* | | Merge branch '5.4'Gustavo André dos Santos Lopes2012-05-232-19/+67
|\ \ \ | |/ /
| * | Merge branch '5.3' into 5.4Gustavo André dos Santos Lopes2012-05-232-19/+67
| |\ \ | | |/
| | * Fixed bug #62017Gustavo André dos Santos Lopes2012-05-232-19/+67
| | | | | | | | | | | | | | | IntlDateFormatter constructor would release some resources under certain error conditions.
* | | Fixed several ext/intl testsGustavo André dos Santos Lopes2012-05-235-5/+11
| | |
* | | Merge branch '5.4'Gustavo André dos Santos Lopes2012-05-238-4/+74
|\ \ \ | |/ /
| * | Merge branch '5.3' into 5.4Gustavo André dos Santos Lopes2012-05-238-4/+74
| |\ \ | | |/ | | | | | | | | | Conflicts: sapi/fpm/fpm/fpm_main.c
| | * Fixed bug #6208: memory leak in grapheme_extract()Gustavo André dos Santos Lopes2012-05-232-0/+13
| | |
| | * Fixed bug #62082Gustavo André dos Santos Lopes2012-05-232-3/+19
| | | | | | | | | | | | | | | This was a buffer overflow in internal function get_icu_disp_value_src_php().