iliaa           Tue Nov 29 18:10:48 2005 EDT

  Modified files:              
    /php-src/ext/date   php_date.c php_date.h 
  Log:
  MFB51: fixed zts build
  
  
http://cvs.php.net/diff.php/php-src/ext/date/php_date.c?r1=1.72&r2=1.73&ty=u
Index: php-src/ext/date/php_date.c
diff -u php-src/ext/date/php_date.c:1.72 php-src/ext/date/php_date.c:1.73
--- php-src/ext/date/php_date.c:1.72    Tue Nov 29 15:48:44 2005
+++ php-src/ext/date/php_date.c Tue Nov 29 18:10:48 2005
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: php_date.c,v 1.72 2005/11/29 20:48:44 iliaa Exp $ */
+/* $Id: php_date.c,v 1.73 2005/11/29 23:10:48 iliaa Exp $ */
 
 #include "php.h"
 #include "php_streams.h"
@@ -34,6 +34,7 @@
 function_entry date_functions[] = {
        PHP_FE(strtotime, NULL)
        PHP_FE(date, NULL)
+       PHP_FE(idate, NULL)
        PHP_FE(gmdate, NULL)
        PHP_FE(mktime, NULL)
        PHP_FE(gmmktime, NULL)
@@ -793,9 +794,6 @@
                case 'Z': retval = (int) (!localtime ? offset->offset : 0); 
break;
 
                case 'U': retval = (int) t->sse; break;
-               default:
-                       php_error_docref(NULL TSRMLS_CC, E_WARNING, 
"Unrecognized date format token.");
-                       break;
        }
 
        if (!localtime) {
@@ -830,6 +828,7 @@
        char   *format;
        int     format_len;
        time_t  ts;
+       int ret; 
 
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &format, 
&format_len, &ts) == FAILURE) {
                RETURN_FALSE;
@@ -844,7 +843,12 @@
                ts = time(NULL);
        }
 
-       RETURN_LONG(php_idate(format[0], ts, 0));
+       ret = php_idate(format[0], ts, 0);
+       if (ret == -1) {
+               php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unrecognized date 
format token.");
+               RETURN_FALSE;
+       }
+       RETURN_LONG(ret);
 }
 /* }}} */
 
http://cvs.php.net/diff.php/php-src/ext/date/php_date.h?r1=1.24&r2=1.25&ty=u
Index: php-src/ext/date/php_date.h
diff -u php-src/ext/date/php_date.h:1.24 php-src/ext/date/php_date.h:1.25
--- php-src/ext/date/php_date.h:1.24    Tue Nov 29 15:27:21 2005
+++ php-src/ext/date/php_date.h Tue Nov 29 18:10:48 2005
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: php_date.h,v 1.24 2005/11/29 20:27:21 iliaa Exp $ */
+/* $Id: php_date.h,v 1.25 2005/11/29 23:10:48 iliaa Exp $ */
 
 #ifndef PHP_DATE_H
 #define PHP_DATE_H
@@ -28,6 +28,7 @@
 #define phpext_date_ptr &date_module_entry
 
 PHP_FUNCTION(date);
+PHP_FUNCTION(idate);
 PHP_FUNCTION(gmdate);
 PHP_FUNCTION(strtotime);
 

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

Reply via email to