Added private constructor to IntlTimeZone.

This commit is contained in:
Gustavo André dos Santos Lopes 2012-06-01 17:17:35 +02:00
parent f3802db7a0
commit 72beff0d41
3 changed files with 10 additions and 0 deletions

View File

@ -524,6 +524,7 @@ ZEND_END_ARG_INFO()
* Every 'IntlTimeZone' class method has an entry in this table
*/
static zend_function_entry TimeZone_class_functions[] = {
PHP_ME(IntlTimeZone, __construct, ainfo_tz_void, ZEND_ACC_PRIVATE)
PHP_ME_MAPPING(createTimeZone, intltz_create_time_zone, ainfo_tz_idarg, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC)
PHP_ME_MAPPING(fromDateTimeZone, intltz_from_date_time_zone, ainfo_tz_idarg, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC)
PHP_ME_MAPPING(createDefault, intltz_create_default, ainfo_tz_void, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC)

View File

@ -34,6 +34,13 @@ extern "C" {
}
#include "common/common_enum.h"
U_CFUNC PHP_METHOD(IntlTimeZone, __construct)
{
zend_throw_exception( NULL,
"An object of this type cannot be created with the new operator",
0 TSRMLS_CC );
}
U_CFUNC PHP_FUNCTION(intltz_create_time_zone)
{
char *str_id;

View File

@ -19,6 +19,8 @@
#include <php.h>
PHP_METHOD(IntlTimeZone, __construct)
PHP_FUNCTION(intltz_create_time_zone);
PHP_FUNCTION(intltz_from_date_time_zone);