summaryrefslogtreecommitdiff
path: root/ext/intl/timezone/timezone_methods.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Replace zend_bool uses with boolNikita Popov2021-01-151-3/+3
| | | | | | | We're starting to see a mix between uses of zend_bool and bool. Replace all usages with the standard bool type everywhere. Of course, zend_bool is retained as an alias.
* Make convert_to_*_ex simple aliases of convert_to_*Nikita Popov2021-01-141-1/+1
| | | | | | | | | | | | | Historically, the _ex variants separated the zval first, if a conversion was necessary. This distinction no longer makes sense since PHP 7. The only difference that was still left is that _ex checked whether the type is the same first, but the usage of these macros did not actually distinguish on whether such an inlined check is valuable or not in a given context. Also drop the unused convert_to_explicit_type macros.
* Use true/false instead of TRUE/FALSE in intlNikita Popov2020-11-091-1/+1
| | | | And drop the U_DEFINE_TRUE_AND_FALSE flag.
* Remove proto comments from C filesMax Semenik2020-07-061-6/+2
| | | | Closes GH-5758
* Fix some UNKNOWN default valuesMáté Kocsis2020-06-091-1/+1
| | | | In ext/ffi, ext/intl, ext/mysqli, and ext/pcntl
* Use RETURN_THROWS() after try_convert_to_string()Máté Kocsis2020-01-031-1/+1
|
* Use RETURN_THROWS() after zend_parse_method_parameters()Máté Kocsis2020-01-021-10/+10
|
* Use RETURN_THROWS() during ZPP in most of the extensionsMáté Kocsis2019-12-311-13/+13
| | | | Except for some bigger ones: reflection, sodium, spl
* Cleanup return values for Intl when parameter parsing is unsuccessfulMáté Kocsis2019-10-301-24/+26
| | | | Closes GH-4871.
* Remove mention of PHP major version in Copyright headersGabriel Caruso2019-09-251-2/+0
| | | | Closes GH-4732.
* Merge branch 'PHP-7.4'Nikita Popov2019-06-051-1/+3
|\
| * Allow exceptions in __toString()Nikita Popov2019-06-051-1/+3
| | | | | | | | | | | | | | | | | | | | RFC: https://wiki.php.net/rfc/tostring_exceptions And convert some object to string conversion related recoverable fatal errors into Error exceptions. Improve exception safety of internal code performing string conversions.
* | Intl: Don't separately report "bad arguments" errorsNikita Popov2019-03-111-44/+0
|/ | | | | zpp will be throwing for these now, don't report them in addition to that.
* Require ICU ≥ 50.1Christoph M. Becker2018-09-151-8/+0
| | | | | | | | | | | | | | | | | Given that ICU is a set of lively developed libraries, that ICU 50.1 has been released on 2012-11-05, and PHP 7.4 is scheduled to be released seven years after it, we consider it appropriate to ditch these legacy versions. Particularly, that would be a reasonable groundwork to implement part two of the “Deprecate and remove INTL_IDNA_VARIANT_2003” RFC[1], namely to default idn_to_ascii()'s and idn_to_utf8()'s $variant parameter to INTL_IDNA_VARIANT_UTS46, which is not defined in ICU < 4.6. See also the related discussion on internals@[2]. [1] <https://wiki.php.net/rfc/deprecate-and-remove-intl_idna_variant_2003> [2] <http://news.php.net/php.internals/101626>ff
* Fixed incorrrecr zval_dtor() usage to replace value of argument passed by ↵Dmitry Stogov2018-07-051-5/+3
| | | | reference, that may lead to memory leaks.
* Simplify namespace accessAnatol Belski2018-04-011-2/+2
| | | | The icu namespace is an alias which resolves to the real namespace.
* Utilize the recommended way to handle the icu namespaceAnatol Belski2018-03-311-0/+4
|
* Removed useless separationsDmitry Stogov2017-12-071-4/+2
|
* Update IntlTimeZone methods for ICU 52Sara Golemon2016-04-181-0/+78
| | | | | | | | Adds: string IntlTimeZone::getWindowsID(string id) string IntlTimeZone::getIDForWindowsID(string winID[, string region]) And matching procedural functions
* More zpp cleanup in ext/intlNikita Popov2015-10-061-2/+2
|
* Cleanup (avoid string reallocations)Dmitry Stogov2015-07-011-24/+10
|
* Avoid zval duplication in ZVAL_ZVAL() macro (it was necessary only in few ↵Dmitry Stogov2015-06-121-1/+1
| | | | | | places). Switch from ZVAL_ZVAL() to simpler macros where possible (it makes sense to review remaining places)
* trailing whitespace removalStanislav Malyshev2015-01-101-2/+2
|
* cleanup intl typesStanislav Malyshev2014-12-291-22/+21
|
* eliminate usage of deprecated zend_get_parameters_exStanislav Malyshev2014-12-281-17/+8
|
* first shot remove TSRMLS_* thingsAnatol Belski2014-12-131-77/+77
|
* s/PHP 5/PHP 7/Johannes Schlüter2014-09-191-1/+1
|
* first show to make 's' work with size_tAnatol Belski2014-08-271-7/+7
|
* master renames phase 7PRE_AST_MERGEAnatol Belski2014-08-251-1/+1
|
* master renames phase 1Anatol Belski2014-08-251-22/+22
|
* yet trivial fixesAnatol Belski2014-08-201-1/+1
|
* ported ext/intl, bugfixes to goAnatol Belski2014-08-191-12/+12
|
* basic macro replacements, all at onceAnatol Belski2014-08-191-15/+15
|
* Separate argument passed by referenceDmitry Stogov2014-07-081-1/+1
|
* Fixed compilation problemsDmitry Stogov2014-06-301-2/+2
|
* Fixed reference handling in intltz_get_canonical_idXinchen Hui2014-06-301-0/+1
|
* Fixed reference handling in intltz_get_offsetXinchen Hui2014-06-301-0/+2
|
* Fixed retval with zend_call_methodXinchen Hui2014-06-291-1/+1
|
* Refactoring ext/intl (incompleted)Xinchen Hui2014-06-281-36/+47
|
* Merge branch 'datefmt_tz_cal_interop'Gustavo André dos Santos Lopes2012-07-221-0/+3
|\ | | | | | | | | | | | | | | * 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/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Fix undeclared intl_locale_get_default()Gustavo André dos Santos Lopes2012-06-251-1/+1
|/ | | | | | | | 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-2/+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.
* Added private constructor to IntlTimeZone.Gustavo André dos Santos Lopes2012-06-031-0/+7
|
* Added IntlTimeZone::fromDateTimeZone() and ::toDateTimeZone.Gustavo André dos Santos Lopes2012-05-171-0/+57
| | | | | | | | | | | | | | | | | | | | 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.
* Compatibility with old versions of ICU (4.0+).Gustavo André dos Santos Lopes2012-04-011-0/+6
|
* Added support for new method TimeZone::getUnknown() added in ICU 49.Gustavo André dos Santos Lopes2012-04-011-0/+14
|
* Initial checkin of calendar/timezone code.Gustavo André dos Santos Lopes2012-04-011-0/+572