summaryrefslogtreecommitdiff
path: root/ext/intl/php_intl.c
diff options
context:
space:
mode:
authorGustavo André dos Santos Lopes <cataphract@php.net>2012-07-22 03:54:03 +0200
committerGustavo André dos Santos Lopes <cataphract@php.net>2012-07-22 04:22:23 +0200
commit2f0775b999e7859275c614a3d2d8edd1506e0d68 (patch)
tree95b8682fb7fbf8229f3ce17064d14a7842efd812 /ext/intl/php_intl.c
parent46629e35ffadae77114088c59faf301328159d83 (diff)
downloadphp-git-2f0775b999e7859275c614a3d2d8edd1506e0d68.tar.gz
Added IntlDateFormatter::formatObject(). Refactor
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.
Diffstat (limited to 'ext/intl/php_intl.c')
-rwxr-xr-xext/intl/php_intl.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/ext/intl/php_intl.c b/ext/intl/php_intl.c
index 59272db712..f314870ac6 100755
--- a/ext/intl/php_intl.c
+++ b/ext/intl/php_intl.c
@@ -62,6 +62,7 @@
#include "dateformat/dateformat_attr.h"
#include "dateformat/dateformat_attrcpp.h"
#include "dateformat/dateformat_format.h"
+#include "dateformat/dateformat_format_object.h"
#include "dateformat/dateformat_parse.h"
#include "dateformat/dateformat_data.h"
@@ -339,6 +340,13 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_datefmt_format, 0, 0, 0)
ZEND_ARG_INFO(0, array)
ZEND_END_ARG_INFO()
+ZEND_BEGIN_ARG_INFO_EX(arginfo_datefmt_format_object, 0, 0, 1)
+ ZEND_ARG_INFO(0, object)
+ ZEND_ARG_INFO(0, format)
+ ZEND_ARG_INFO(0, locale)
+ZEND_END_ARG_INFO()
+
+
ZEND_BEGIN_ARG_INFO_EX(arginfo_datefmt_create, 0, 0, 3)
ZEND_ARG_INFO(0, locale)
ZEND_ARG_INFO(0, date_type)
@@ -695,6 +703,7 @@ zend_function_entry intl_functions[] = {
PHP_FE( datefmt_is_lenient, arginfo_msgfmt_get_locale )
PHP_FE( datefmt_set_lenient, arginfo_msgfmt_get_locale )
PHP_FE( datefmt_format, arginfo_datefmt_format )
+ PHP_FE( datefmt_format_object, arginfo_datefmt_format_object )
PHP_FE( datefmt_parse, datefmt_parse_args )
PHP_FE( datefmt_localtime , datefmt_parse_args )
PHP_FE( datefmt_get_error_code, arginfo_msgfmt_get_error_code )