summaryrefslogtreecommitdiff
path: root/ext/intl/intl_error.c
Commit message (Collapse)AuthorAgeFilesLines
* Generate ext/intl class entries from stubsMáté Kocsis2021-02-091-11/+0
| | | | Closes GH-6670
* Fix a few commentsMáté Kocsis2020-07-061-36/+14
|
* Remove proto comments from C filesMax Semenik2020-07-061-6/+3
| | | | Closes GH-5758
* Remove mention of PHP major version in Copyright headersGabriel Caruso2019-09-251-2/+0
| | | | Closes GH-4732.
* Remove local variablesPeter Kokot2019-02-031-9/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch removes the so called local variables defined per file basis for certain editors to properly show tab width, and similar settings. These are mainly used by Vim and Emacs editors yet with recent changes the once working definitions don't work anymore in Vim without custom plugins or additional configuration. Neither are these settings synced across the PHP code base. A simpler and better approach is EditorConfig and fixing code using some code style fixing tools in the future instead. This patch also removes the so called modelines for Vim. Modelines allow Vim editor specifically to set some editor configuration such as syntax highlighting, indentation style and tab width to be set in the first line or the last 5 lines per file basis. Since the php test files have syntax highlighting already set in most editors properly and EditorConfig takes care of the indentation settings, this patch removes these as well for the Vim 6.0 and newer versions. With the removal of local variables for certain editors such as Emacs and Vim, the footer is also probably not needed anymore when creating extensions using ext_skel.php script. Additionally, Vim modelines for setting php syntax and some editor settings has been removed from some *.phpt files. All these are mostly not relevant for phpt files neither work properly in the middle of the file.
* Use zend_string_release_ex() instread of zend_string_release() in places, ↵Dmitry Stogov2018-05-281-2/+2
| | | | where we sure about string persistence.
* Trailing whitespacesGabriel Caruso2018-01-031-1/+1
| | | | Signed-off-by: Gabriel Caruso <carusogabriel34@gmail.com>
* Switch position of ce in exception ce variable namesAaron Piotrowski2015-07-031-2/+2
|
* Change zend_exception_get_default() to zend_exception_ceAaron Piotrowski2015-07-031-7/+4
|
* Cleanup (avoid string reallocations)Dmitry Stogov2015-07-011-13/+12
|
* Improved zend_string API (Francois Laupretre)Dmitry Stogov2015-06-291-1/+1
| | | | | | | | | | | | | | | | | | | | Squashed commit of the following: commit d96eab8d79b75ac83d49d49ae4665f948d15a804 Author: Francois Laupretre <francois@tekwire.net> Date: Fri Jun 26 01:23:31 2015 +0200 Use the new 'ZSTR' macros in the rest of the code. Does not change anything to the generated code (thanks to compat macros) but cleaner. commit b3526439104ac7a89a8e0c79dbebf33b22bd01b8 Author: Francois Laupretre <francois@tekwire.net> Date: Thu Jun 25 13:45:06 2015 +0200 Improve zend_string API Add missing methods
* Always throw TypeException on throwing zpp failuresNikita Popov2015-04-061-5/+5
| | | | | | | | | | | | | | Introduces a ZEND_PARSE_PARAMS_THROW flag for zpp, which forces to report FAILURE errors using a TypeException instead of a Warning, like it would happen in strict mode. Adds a zend_parse_parameters_throw() convenience function, which invokes zpp with this flag. Converts all cases I could identify, where we currently have throwing zpp usage in constructors and replaces them with this API. Error handling is still replaced to EH_THROW in some cases to handle other, domain-specific errors in constructors.
* Patch improvement:Dmitry Stogov2015-03-301-48/+7
| | | | | | | | Removed the corresponding core code. Fixed ext/com_dotnet and ext/date. Refactored ext/intl changes. Improved ext/fileinfo and ext/pdo changes. Fixed tests.
* Converted intl extension to use IntlException in constructors.Danack2015-03-151-8/+49
|
* trailing whitespace removalStanislav Malyshev2015-01-101-2/+2
|
* cleanup intl typesStanislav Malyshev2014-12-291-1/+1
|
* first shot remove TSRMLS_* thingsAnatol Belski2014-12-131-39/+39
|
* s/PHP 5/PHP 7/Johannes Schlüter2014-09-191-1/+1
|
* master renames phase 1Anatol Belski2014-08-251-2/+2
|
* ported ext/intl, bugfixes to goAnatol Belski2014-08-191-2/+2
|
* basic macro replacements, all at onceAnatol Belski2014-08-191-2/+2
|
* Refactoring ext/intl (incompleted)Xinchen Hui2014-06-281-6/+6
|
* Use better data structures (incomplete)Dmitry Stogov2014-02-101-1/+1
|
* 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
| * Remove executable bit from filesGustavo André dos Santos Lopes2012-07-301-0/+0
| |
* | BreakIterator and RuleBasedBreakiterator addedGustavo André dos Santos Lopes2012-06-041-1/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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().
* | - Added the ability for the intl exception to throw exceptions when a global ↵Gustavo André dos Santos Lopes2012-01-081-2/+23
|/ | | | error is set.
* cleanup some code, improve error handlingStanislav Malyshev2009-12-231-4/+13
|
* merge errors supportStanislav Malyshev2009-07-071-0/+3
|
* revent wrong partStanislav Malyshev2009-05-101-3/+1
|
* little errors cleanupStanislav Malyshev2009-05-101-4/+12
|
* MFH:Felipe Pena2008-08-111-4/+4
| | | | | | | - Added arginfo - Fixed WS - Changed C++ comments to C comments
* Merge intl extension into coreStanislav Malyshev2008-07-071-0/+215