Commit:    72beff0d414ef45c06f118f7f60d5cd194c6a013
Author:    Gustavo André dos Santos Lopes <cataphr...@php.net>         Fri, 1 
Jun 2012 17:17:35 +0200
Parents:   f3802db7a087d056ae1a0804ea0f7b503dd9c9a3
Branches:  master

Link:       
http://git.php.net/?p=php-src.git;a=commitdiff;h=72beff0d414ef45c06f118f7f60d5cd194c6a013

Log:
Added private constructor to IntlTimeZone.

Changed paths:
  M  ext/intl/timezone/timezone_class.cpp
  M  ext/intl/timezone/timezone_methods.cpp
  M  ext/intl/timezone/timezone_methods.h


Diff:
diff --git a/ext/intl/timezone/timezone_class.cpp 
b/ext/intl/timezone/timezone_class.cpp
index 850da4a..c976eb1 100644
--- a/ext/intl/timezone/timezone_class.cpp
+++ b/ext/intl/timezone/timezone_class.cpp
@@ -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)
diff --git a/ext/intl/timezone/timezone_methods.cpp 
b/ext/intl/timezone/timezone_methods.cpp
index e596cc5..b7f31c3 100644
--- a/ext/intl/timezone/timezone_methods.cpp
+++ b/ext/intl/timezone/timezone_methods.cpp
@@ -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;
diff --git a/ext/intl/timezone/timezone_methods.h 
b/ext/intl/timezone/timezone_methods.h
index 824f72a..e153418 100644
--- a/ext/intl/timezone/timezone_methods.h
+++ b/ext/intl/timezone/timezone_methods.h
@@ -19,6 +19,8 @@
 
 #include <php.h>
 
+PHP_METHOD(IntlTimeZone, __construct)
+
 PHP_FUNCTION(intltz_create_time_zone);
 
 PHP_FUNCTION(intltz_from_date_time_zone);


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to