[PHP-CVS] svn: /php/php-src/trunk/main/ php_variables.c

2012-01-06 Thread Patrick Allaert
patrickallaert   Fri, 06 Jan 2012 13:37:51 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=321827

Log:
Changed: restoring REQUEST_TIME as a long, introducing REQUEST_TIME_FLOAT 
instead as discussed on the ML

Changed paths:
U   php/php-src/trunk/main/php_variables.c

Modified: php/php-src/trunk/main/php_variables.c
===
--- php/php-src/trunk/main/php_variables.c  2012-01-06 10:34:31 UTC (rev 
321826)
+++ php/php-src/trunk/main/php_variables.c  2012-01-06 13:37:51 UTC (rev 
321827)
@@ -581,10 +581,13 @@
}
/* store request init time */
{
-   zval new_entry;
-   Z_TYPE(new_entry) = IS_DOUBLE;
-   Z_DVAL(new_entry) = sapi_get_request_time(TSRMLS_C);
-   php_register_variable_ex(REQUEST_TIME, new_entry, array_ptr 
TSRMLS_CC);
+   zval request_time_float, request_time_long;
+   Z_TYPE(request_time_float) = IS_DOUBLE;
+   Z_DVAL(request_time_float) = sapi_get_request_time(TSRMLS_C);
+   php_register_variable_ex(REQUEST_TIME_FLOAT, 
request_time_float, array_ptr TSRMLS_CC);
+   Z_TYPE(request_time_long) = IS_LONG;
+   Z_LVAL(request_time_long) = 
zend_dval_to_lval(Z_DVAL(request_time_float));
+   php_register_variable_ex(REQUEST_TIME, request_time_long, 
array_ptr TSRMLS_CC);
}

 }

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

[PHP-CVS] svn: /php/php-src/branches/PHP_5_4/ NEWS main/php_variables.c

2012-01-06 Thread Patrick Allaert
patrickallaert   Fri, 06 Jan 2012 13:38:06 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=321828

Log:
Changed: restoring REQUEST_TIME as a long, introducing REQUEST_TIME_FLOAT 
instead as discussed on the ML

Changed paths:
U   php/php-src/branches/PHP_5_4/NEWS
U   php/php-src/branches/PHP_5_4/main/php_variables.c

Modified: php/php-src/branches/PHP_5_4/NEWS
===
--- php/php-src/branches/PHP_5_4/NEWS   2012-01-06 13:37:51 UTC (rev 321827)
+++ php/php-src/branches/PHP_5_4/NEWS   2012-01-06 13:38:06 UTC (rev 321828)
@@ -2,6 +2,10 @@
 |||
 ?? Jan 2012, PHP 5.4.0 RC6

+- Core:
+  . Restoring $_SERVER['REQUEST_TIME'] as a long and introducing
+$_SERVER['REQUEST_TIME_FLOAT'] to include microsecond precision. (Patrick)
+
 07 Jan 2012, PHP 5.4.0 RC5
 - Core:
   . Fixed bug #60613 (Segmentation fault with $cls-{expr}() syntax). (Dmitry)

Modified: php/php-src/branches/PHP_5_4/main/php_variables.c
===
--- php/php-src/branches/PHP_5_4/main/php_variables.c   2012-01-06 13:37:51 UTC 
(rev 321827)
+++ php/php-src/branches/PHP_5_4/main/php_variables.c   2012-01-06 13:38:06 UTC 
(rev 321828)
@@ -581,10 +581,13 @@
}
/* store request init time */
{
-   zval new_entry;
-   Z_TYPE(new_entry) = IS_DOUBLE;
-   Z_DVAL(new_entry) = sapi_get_request_time(TSRMLS_C);
-   php_register_variable_ex(REQUEST_TIME, new_entry, array_ptr 
TSRMLS_CC);
+   zval request_time_float, request_time_long;
+   Z_TYPE(request_time_float) = IS_DOUBLE;
+   Z_DVAL(request_time_float) = sapi_get_request_time(TSRMLS_C);
+   php_register_variable_ex(REQUEST_TIME_FLOAT, 
request_time_float, array_ptr TSRMLS_CC);
+   Z_TYPE(request_time_long) = IS_LONG;
+   Z_LVAL(request_time_long) = 
zend_dval_to_lval(Z_DVAL(request_time_float));
+   php_register_variable_ex(REQUEST_TIME, request_time_long, 
array_ptr TSRMLS_CC);
}

 }

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

[PHP-CVS] svn: /php/php-src/branches/PHP_5_4/ext/standard/tests/strings/ bug60675.phpt

2012-01-06 Thread Daniel Convissor
danielc  Fri, 06 Jan 2012 22:09:15 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=321840

Log:
Test for bug 60675.

Bug: https://bugs.php.net/60675 (Open) htmlentities(ENT_COMPAT, windows-1251) 
for ISO-8859-1 encoded scripts
  
Changed paths:
A   php/php-src/branches/PHP_5_4/ext/standard/tests/strings/bug60675.phpt

Added: php/php-src/branches/PHP_5_4/ext/standard/tests/strings/bug60675.phpt
===
--- php/php-src/branches/PHP_5_4/ext/standard/tests/strings/bug60675.phpt   
(rev 0)
+++ php/php-src/branches/PHP_5_4/ext/standard/tests/strings/bug60675.phpt   
2012-01-06 22:09:15 UTC (rev 321840)
@@ -0,0 +1,24 @@
+--TEST--
+Bug 60675: htmlentities(ENT_COMPAT, windows-1251) for ISO-8859-1 encoded 
scripts
+--CREDITS--
+Daniel Convissor dani...@php.net
+--XFAIL--
+Bug 60675 exists
+--FILE--
+?php
+
+/*
+ * This script needs to be encoded in ISO-8859-1 for the test to work.
+ * Check the encoding with file -bi
+ * If the encoding is wrong, change it with:
+ *   mv bug60675.phpt bug60675.tmp
+ *   iconv -f output of file -bi -t ISO-8859-1 bug60675.tmp  bug60675.phpt
+ *   rm bug60675.tmp
+ */
+
+$in = '�';
+echo htmlentities($in, ENT_COMPAT, 'windows-1251');
+
+?
+--EXPECT--
+#1058;#1077;#1089;#1090;#1080;#1088;#1091;#1077;#1084;

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

[PHP-CVS] svn: /php/php-src/trunk/ext/standard/tests/strings/ bug60675.phpt

2012-01-06 Thread Daniel Convissor
danielc  Fri, 06 Jan 2012 22:10:04 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=321841

Log:
Test for bug 60675.

Bug: https://bugs.php.net/60675 (Open) htmlentities(ENT_COMPAT, windows-1251) 
for ISO-8859-1 encoded scripts
  
Changed paths:
A   php/php-src/trunk/ext/standard/tests/strings/bug60675.phpt

Added: php/php-src/trunk/ext/standard/tests/strings/bug60675.phpt
===
--- php/php-src/trunk/ext/standard/tests/strings/bug60675.phpt  
(rev 0)
+++ php/php-src/trunk/ext/standard/tests/strings/bug60675.phpt  2012-01-06 
22:10:04 UTC (rev 321841)
@@ -0,0 +1,24 @@
+--TEST--
+Bug 60675: htmlentities(ENT_COMPAT, windows-1251) for ISO-8859-1 encoded 
scripts
+--CREDITS--
+Daniel Convissor dani...@php.net
+--XFAIL--
+Bug 60675 exists
+--FILE--
+?php
+
+/*
+ * This script needs to be encoded in ISO-8859-1 for the test to work.
+ * Check the encoding with file -bi
+ * If the encoding is wrong, change it with:
+ *   mv bug60675.phpt bug60675.tmp
+ *   iconv -f output of file -bi -t ISO-8859-1 bug60675.tmp  bug60675.phpt
+ *   rm bug60675.tmp
+ */
+
+$in = '�';
+echo htmlentities($in, ENT_COMPAT, 'windows-1251');
+
+?
+--EXPECT--
+#1058;#1077;#1089;#1090;#1080;#1088;#1091;#1077;#1084;

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