summaryrefslogtreecommitdiff
path: root/ext/intl/common/common_enum.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Add support for generating class entries from stubsMáté Kocsis2021-01-261-7/+2
| | | | | | Closes GH-6289 Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
* Generate method entries for ext/intlMáté Kocsis2020-04-141-16/+6
| | | | Closes GH-5370
* Add various stubs for IntlMáté Kocsis2020-02-041-8/+6
| | | | Closes GH-4826
* Use RETURN_THROWS() during ZPP in most of the extensionsMáté Kocsis2019-12-311-5/+5
| | | | Except for some bigger ones: reflection, sodium, spl
* Remove mention of PHP major version in Copyright headersGabriel Caruso2019-09-251-2/+0
| | | | Closes GH-4732.
* Merge branch 'PHP-7.4'Dmitry Stogov2019-05-281-1/+1
|\ | | | | | | | | * PHP-7.4: Replace ZVAL_COPY() and ZVAL_COPY_VALUE() for IS_OBJECT by cheaper macros
| * Replace ZVAL_COPY() and ZVAL_COPY_VALUE() for IS_OBJECT by cheaper macrosDmitry Stogov2019-05-281-1/+1
| |
* | Intl: Don't separately report "bad arguments" errorsNikita Popov2019-03-111-10/+0
|/ | | | | zpp will be throwing for these now, don't report them in addition to that.
* Uze ZVAL_COPY_DEREF() instead of ZVAL_DEREF() and ZVAL_COPY()Dmitry Stogov2018-07-091-2/+1
|
* Export standard object handlers, to avoid indirect accessDmitry Stogov2018-05-311-1/+1
|
* Move constants into read-only data segmentDmitry Stogov2017-12-141-1/+1
|
* Move zend_object_iterator_funcs structures into read-only data segmentDmitry Stogov2017-12-141-1/+1
|
* Encapsulate reference-counting primitives.Dmitry Stogov2017-10-271-1/+1
| | | | | | Prohibit direct update of GC_REFCOUNT(), GC_SET_REFCOUNT(), GC_ADDREF() and GC_DELREF() shoukf be instead. Added mactros to validate reference-counting (disabled for now). These macros are going to be used to eliminate race-condintions during reference-counting on data shared between threads.
* Get rid of implicit type casting in GC_*() macros in Zend/zend_types.h.Dmitry Stogov2015-08-131-1/+1
| | | | | | This prevented compilation warnings and disclosed few incorrect usages in Zend/zend_vm_def.h and ext/dom/xpath.c. Now explicit type casting may be required on call site. This may break some C extension code, but it shoulfn't be a problem to add explicit casting.
* Get rid of more ZVAL_ZVAL() macrosDmitry Stogov2015-06-121-1/+2
|
* trailing whitespace removalStanislav Malyshev2015-01-101-3/+3
|
* first shot remove TSRMLS_* thingsAnatol Belski2014-12-131-42/+42
|
* 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
|
* Fixed iteratorsXinchen Hui2014-06-291-3/+3
|
* Fixed segfault temporarily (probably need to be reverted later)Xinchen Hui2014-06-291-2/+2
|
* Fixed segfault, segfault and segfaultXinchen Hui2014-06-291-4/+1
|
* Refactoring ext/intl (incompleted)Xinchen Hui2014-06-281-46/+37
|
* Add support for non-scalar Iterator keys in foreachNikita Popov2013-03-121-13/+1
| | | | RFC: https://wiki.php.net/rfc/foreach-non-scalar-keys
* Change in BreakIterator::getPartsIterator()Gustavo André dos Santos Lopes2012-06-101-1/+1
| | | | | | | | 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-40/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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().
* DateFormat plays nice with Calendar, TimeZoneGustavo André dos Santos Lopes2012-06-041-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Compatibility with old versions of ICU (4.0+).Gustavo André dos Santos Lopes2012-04-011-0/+3
|
* Initial checkin of calendar/timezone code.Gustavo André dos Santos Lopes2012-04-011-0/+380