summaryrefslogtreecommitdiff
path: root/ext/intl/php_intl.c
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'PHP-7.0' into PHP-7.1Sara Golemon2017-07-261-21/+21
|\ | | | | | | | | * PHP-7.0: Bugfix #74993 Wrong reflection param into for some intl: lookup_*() methods
| * Bugfix #74993 Wrong reflection param into for some intl: lookup_*() methodsSara Golemon2017-07-261-21/+21
| |
* | Merge branch 'PHP-7.0' into PHP-7.1Remi Collet2017-06-131-1/+1
|\ \ | |/ | | | | | | | | | | * PHP-7.0: NEWS Fix bug #74705 for collator_get_sort_key Fixes bug #74705 Wrong ReflectionInfo for Collator::getSortKey()
| * Fix bug #74705 for collator_get_sort_keyRemi Collet2017-06-131-1/+1
| |
* | Merge branch 'PHP-7.0' into PHP-7.1Joe Watkins2017-05-021-1/+6
|\ \ | |/ | | | | | | * PHP-7.0: Fix bug #74468 wrong reflection on Collator::sortWithSortKeys
| * Fix bug #74468 wrong reflection on Collator::sortWithSortKeysFabien Villepinte2017-05-021-1/+6
| |
* | remove unused declarationsAnatol Belski2016-06-231-16/+0
|/
* Move semicolon into TSRMLS_CACHE_EXTERN/DEFINENikita Popov2016-03-031-1/+1
| | | | Also re bug #71575.
* Remove datefmt_set_timezone_id and OO variantNikita Popov2015-04-011-1/+0
|
* cleanup the mod version macros, round 2Anatol Belski2015-03-231-2/+0
|
* made ZEND_TSRMLS_CACHE_* macros look like function callsAnatol Belski2015-02-161-2/+2
| | | | which also comply with the current semantics for such macros
* Add IntlChar class to intl extensionSara Golemon2015-01-161-0/+4
| | | | Exposes ICU's uchar functionality as a set of static methods
* trailing whitespace removalStanislav Malyshev2015-01-101-2/+2
|
* first shot remove TSRMLS_* thingsAnatol Belski2014-12-131-19/+19
|
* opcache, intl, gmp, exif, com, bcmath to use static tsrmlsAnatol Belski2014-10-171-0/+6
|
* s/PHP 5/PHP 7/Johannes Schlüter2014-09-191-1/+1
|
* master renames phase 1Anatol Belski2014-08-251-1/+1
|
* basic macro replacements, all at onceAnatol Belski2014-08-191-1/+1
|
* Merge branch 'master' into testDmitry Stogov2014-07-071-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: (48 commits) change locale - looks like not everybody has sl_SI Fix bug #66921 - Wrong argument type hint for function intltz_from_date_time_zone fix format Fix bug #67052 (NumberFormatter::parse() resets LC_NUMERIC setting) Make sure the generator script also creates a newline at the end of file Add newline at end of file to prevent compilation warning Fix handling of session user module custom handlers. Reference bug report instead of github issue in NEWS file add more exts for Travis Update NEWS Fix phpdbg.1 man page installation when build != src directory BFN for bug #67551 (php://input temp file will be located in sys_temp_dir instead of upload_tmp_dir) reorder restore API compatibility finish refactor php_stream_temp_create{,_ex} and use it for the php://input stream refactor _php_stream_fopen_{temporary_,tmp}file() fix length overflow of HTTP_RAW_POST_DATA Update NEWS Fixed bug #67215 (php-cgi work with opcache, may be segmentation fault happen) ... Conflicts: ext/opcache/zend_accelerator_util_funcs.c ext/session/mod_user.c ext/spl/spl_array.c ext/spl/spl_dllist.c ext/standard/file.c ext/standard/streamsfuncs.c ext/standard/string.c main/streams/memory.c
| * Fix bug #66921 - Wrong argument type hint for function ↵Stanislav Malyshev2014-07-071-1/+1
| | | | | | | | intltz_from_date_time_zone
* | Fixed segfault while starting upXinchen Hui2014-06-281-1/+1
| |
* | Refactoring ext/intl (only compilerable now, far to finish :<)Xinchen Hui2014-06-281-2/+2
|/
* intl: add intlcal_set_minimal_days_in_first_week()Gustavo André dos Santos Lopes2013-07-031-0/+6
| | | | | and IntlCalendar::setMinimalDaysInFirstWeek(). This one had slipped. we had a ::getMinimalDaysInFirstWeek() but no way to change the value.
* Add UConverter class (ICU's UConverter API)Sara Golemon2013-01-291-0/+5
| | | | RFC at http://wiki.php.net/rfc/uconverter
* Merge branch 'PHP-5.4'Gustavo Lopes2012-08-261-2/+2
|\ | | | | | | | | | | | | | | * PHP-5.4: Fixed defective cloning in ext/intl classes NEWS for commit 72c807a Allow Spoofchecker to be registered on ICU 49.1 Announce on NEWS change in 1ce572c
| * Allow Spoofchecker to be registered on ICU 49.1Gustavo Lopes2012-08-261-2/+2
| |
* | Merge branch '5.4'Gustavo André dos Santos Lopes2012-07-301-0/+0
|\ \ | |/ | | | | | | | | | | | | * 5.4: Fix test title and limit it to ICU >= 4.8 Remove executable bit from files Limit test to ICU 49 Remove executable bit from files
| * Merge branch '5.3' into 5.4Gustavo André dos Santos Lopes2012-07-301-0/+0
| |\ | | | | | | | | | | | | | | | * 5.3: Limit test to ICU 49 Remove executable bit from files
| | * Remove executable bit from filesGustavo André dos Santos Lopes2012-07-301-0/+0
| | |
| | * - Make usage of new PHP_FE_END macroFelipe Pena2011-07-251-1/+1
| | |
| | * Show ICU Data version inside phpinfo()Ilia Alshanetsky2011-06-031-0/+3
| | |
| | * Implemented FR #54561 (Expose ICU Version & ICU Data Version info).Ilia Alshanetsky2011-06-011-0/+4
| | |
| * | - Support for UTS #46.Gustavo André dos Santos Lopes2011-11-241-2/+4
| | |
| * | - Make usage of new PHP_FE_END macroFelipe Pena2011-07-251-1/+1
| | |
| * | Show ICU Data version inside phpinfo()Ilia Alshanetsky2011-06-031-0/+3
| | |
| * | Implemented FR #54561 (Expose ICU Version & ICU Data Version info).Ilia Alshanetsky2011-06-011-0/+4
| | |
* | | ini intl.explicit_cleanup -> INTL_EXPLICIT_CLEANUPGustavo André dos Santos Lopes2012-07-241-26/+5
| | | | | | | | | | | | | | | Added an environment variable and removed the ini setting intl.explicit_cleanup for calling u_cleanup()
* | | Do not fetch default locale once on minit or rinitGustavo Lopes2012-07-231-9/+0
| | | | | | | | | | | | | | | The default locale is now requested to ICU when it's needed by using intl_get_default_locale().
* | | Add ini setting intl.explicit_cleanupGustavo Lopes2012-07-231-1/+29
| | | | | | | | | | | | | | | This is to help with looking for leaks. If set to true, this ini setting forces a call to u_cleanup() on module shutdown.
* | | Merge branch 'datefmt_tz_cal_interop'Gustavo André dos Santos Lopes2012-07-221-0/+9
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | * datefmt_tz_cal_interop: Readded accidentally removed line Added IntlDateFormatter::formatObject(). Refactor Refactored internal_get_timestamp() Unified zval -> UDate conversions
| * | | Added IntlDateFormatter::formatObject(). RefactorGustavo André dos Santos Lopes2012-07-221-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To better support IntlCalendar, added this function: string IntlDateFormatter::formatObject(IntlCalendar|DateTime $obj [, array|int|string $format = null [, string $locale = null). $format is either of the constants IntlDateFormatter::FULL, etc., in which case this format applies to both the date and the time, an array in the form array($dateFormat, $timeFormat), or a string with the SimpleDateFormat pattern. This uses both the Calendar type and the timezone of the passed object to configure the formatter (a GregorianCalendar is forced for DateTime). Some stuff was moved around and slighlt modified to allow for more code reuse.
* | | | Merge branch 'break_iterator'Gustavo André dos Santos Lopes2012-06-251-0/+9
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
| * | | | Change in BreakIterator::getPartsIterator()Gustavo André dos Santos Lopes2012-06-101-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 and RuleBasedBreakiterator addedGustavo André dos Santos Lopes2012-06-041-0/+5
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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().
* | | | Fix undeclared intl_locale_get_default()Gustavo André dos Santos Lopes2012-06-251-0/+8
|/ / / | | | | | | | | | | | | | | | | | | | | | 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().
* | | DateFormat plays nice with Calendar, TimeZoneGustavo André dos Santos Lopes2012-06-041-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 IntlCalendar::toDateTime()Gustavo André dos Santos Lopes2012-05-171-0/+1
| | |
* | | Added IntlTimeZone::fromDateTimeZone() and ::toDateTimeZone.Gustavo André dos Santos Lopes2012-05-171-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Added IntlCalendar::fromDateTime()Gustavo André dos Santos Lopes2012-05-171-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Accept DateTimeZone where time zones are expected.Gustavo André dos Santos Lopes2012-05-171-1/+1
| | | | | | | | | | | | | | | Also unified timezone handling in IntlCalendar::setTimeZone() to that in the IntlCalendar and IntlGregorianCalendar constructors.