[PHP-CVS] svn: /SVNROOT/ global_avail

2010-10-13 Thread Philip Olson
philip   Thu, 14 Oct 2010 04:01:48 +

Revision: http://svn.php.net/viewvc?view=revision&revision=304386

Log:
phpdoc/ru karma for Shein Alexey (conf)

Changed paths:
U   SVNROOT/global_avail

Modified: SVNROOT/global_avail
===
--- SVNROOT/global_avail2010-10-14 03:30:46 UTC (rev 304385)
+++ SVNROOT/global_avail2010-10-14 04:01:48 UTC (rev 304386)
@@ -90,7 +90,7 @@
 avail|aferreira,thiago|phpdoc/pt
 avail|machado,scar,davis,dnfeitosa,thiago,amandavale,rafa|phpdoc/pt_BR
 avail|radical,shoty|phpdoc/ro
-avail|freespace,shafff,sveta,wanderer,kozloffsky,santiago,seprize|phpdoc/ru
+avail|freespace,shafff,sveta,wanderer,kozloffsky,santiago,seprize,conf|phpdoc/ru
 
avail|cumhuronat,gulenzek,xhandros,neoprobe,faruk,infralite,flarecaster,antimon,yelekin,ecamalan|phpdoc/tr
 avail|pfischer|phpdoc/es
 avail|grossolini|web/php-wiki

-- 
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_3/ext/standard/streamsfuncs.c trunk/ext/standard/streamsfuncs.c trunk/ext/standard/tests/streams/bug46426.phpt trunk/ext/standard/tests/streams/stream_get_c

2010-10-13 Thread Gustavo André dos Santos Lopes
cataphract   Thu, 14 Oct 2010 03:15:15 +

Revision: http://svn.php.net/viewvc?view=revision&revision=304384

Log:
- [DOC] Reverted rev #304382 and rev #304380, as I figured out a way to
  fix the erratic behavior without breaking backwards compatibility. Namely,
  $offset retains SEEK_SET behavior but actually SEEK_CUR is passed to
  _php_stream_seek, if possible, by moving the offset stream->position bytes.
- Addresses bug #53006.

Bugs: http://bugs.php.net/304382 (error getting bug information)
  http://bugs.php.net/304380 (error getting bug information)
  http://bugs.php.net/53006 (Assigned) stream_get_contents offset max is 
1165
  
Changed paths:
U   php/php-src/branches/PHP_5_3/ext/standard/streamsfuncs.c
U   php/php-src/trunk/ext/standard/streamsfuncs.c
U   php/php-src/trunk/ext/standard/tests/streams/bug46426.phpt
U   
php/php-src/trunk/ext/standard/tests/streams/stream_get_contents_001.phpt

Modified: php/php-src/branches/PHP_5_3/ext/standard/streamsfuncs.c
===
--- php/php-src/branches/PHP_5_3/ext/standard/streamsfuncs.c2010-10-14 
02:47:31 UTC (rev 304383)
+++ php/php-src/branches/PHP_5_3/ext/standard/streamsfuncs.c2010-10-14 
03:15:15 UTC (rev 304384)
@@ -415,7 +415,7 @@
 {
php_stream *stream;
zval *zsrc;
-   long maxlen = PHP_STREAM_COPY_ALL, pos = 0;
+   long maxlen = PHP_STREAM_COPY_ALL, pos = -1L;
int len, newlen;
char *contents = NULL;

@@ -425,9 +425,19 @@

php_stream_from_zval(stream, &zsrc);

-   if ((pos > 0 || (pos == 0 && ZEND_NUM_ARGS() > 2)) && 
php_stream_seek(stream, pos, SEEK_SET) < 0) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to seek to 
position %ld in the stream", pos);
-   RETURN_FALSE;
+   if (pos >= 0) {
+   int seek_res = 0;
+   if (pos > stream->position) {
+   /* use SEEK_CUR to allow emulation in streams that 
don't support seeking */
+   seek_res = php_stream_seek(stream, pos - 
stream->position, SEEK_CUR);
+   } else if (pos < stream->position)  {
+   seek_res = php_stream_seek(stream, pos, SEEK_SET);
+   }
+
+   if (seek_res != 0) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to 
seek to position %ld in the stream", pos);
+   RETURN_FALSE;
+   }
}

len = php_stream_copy_to_mem(stream, &contents, maxlen, 0);

Modified: php/php-src/trunk/ext/standard/streamsfuncs.c
===
--- php/php-src/trunk/ext/standard/streamsfuncs.c   2010-10-14 02:47:31 UTC 
(rev 304383)
+++ php/php-src/trunk/ext/standard/streamsfuncs.c   2010-10-14 03:15:15 UTC 
(rev 304384)
@@ -415,7 +415,7 @@
 {
php_stream *stream;
zval *zsrc;
-   long maxlen = PHP_STREAM_COPY_ALL, pos = 0;
+   long maxlen = PHP_STREAM_COPY_ALL, pos = -1L;
int len, newlen;
char *contents = NULL;

@@ -425,12 +425,19 @@

php_stream_from_zval(stream, &zsrc);

-   if ((pos > 0L) && php_stream_seek(stream, pos, SEEK_CUR) < 0) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to seek %ld 
bytes from current position in the stream", pos);
-   RETURN_FALSE;
-   } else if (pos < 0L) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number of bytes to 
seek must be non-negative, given %ld", pos);
-   RETURN_FALSE;
+   if (pos >= 0) {
+   int seek_res = 0;
+   if (pos > stream->position) {
+   /* use SEEK_CUR to allow emulation in streams that 
don't support seeking */
+   seek_res = php_stream_seek(stream, pos - 
stream->position, SEEK_CUR);
+   } else if (pos < stream->position)  {
+   seek_res = php_stream_seek(stream, pos, SEEK_SET);
+   }
+
+   if (seek_res != 0) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to 
seek to position %ld in the stream", pos);
+   RETURN_FALSE;
+   }
}

len = php_stream_copy_to_mem(stream, &contents, maxlen, 0);

Modified: php/php-src/trunk/ext/standard/tests/streams/bug46426.phpt
===
--- php/php-src/trunk/ext/standard/tests/streams/bug46426.phpt  2010-10-14 
02:47:31 UTC (rev 304383)
+++ php/php-src/trunk/ext/standard/tests/streams/bug46426.phpt  2010-10-14 
03:15:15 UTC (rev 304384)
@@ -7,23 +7,19 @@

 fwrite($tmp, b"12345");

-fseek($tmp, 0);
-echo stream_get_contents($tmp, 2, 1); //23
+echo stream_get_contents($tmp, 2, 1);
 echo "\n";
-echo stream_get_contents($tmp, -1); //45
+echo stream_get_contents($tmp, -1);
 echo "\n";
-fseek($tmp, -1,

[PHP-CVS] svn: /php/php-src/trunk/ext/standard/ streamsfuncs.c tests/streams/bug46426.phpt tests/streams/stream_get_contents_001.phpt

2010-10-13 Thread Gustavo André dos Santos Lopes
cataphract   Thu, 14 Oct 2010 02:39:21 +

Revision: http://svn.php.net/viewvc?view=revision&revision=304382

Log:
- Ooops. Fixed tests for rev #304380 (stream_get_contents() related) and a 
small error.

Bug: http://bugs.php.net/304380 (error getting bug information)
  
Changed paths:
U   php/php-src/trunk/ext/standard/streamsfuncs.c
U   php/php-src/trunk/ext/standard/tests/streams/bug46426.phpt
U   
php/php-src/trunk/ext/standard/tests/streams/stream_get_contents_001.phpt

Modified: php/php-src/trunk/ext/standard/streamsfuncs.c
===
--- php/php-src/trunk/ext/standard/streamsfuncs.c   2010-10-14 02:38:23 UTC 
(rev 304381)
+++ php/php-src/trunk/ext/standard/streamsfuncs.c   2010-10-14 02:39:21 UTC 
(rev 304382)
@@ -425,7 +425,7 @@

php_stream_from_zval(stream, &zsrc);

-   if ((pos != 0L) && php_stream_seek(stream, pos, SEEK_CUR) < 0) {
+   if ((pos > 0L) && php_stream_seek(stream, pos, SEEK_CUR) < 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to seek %ld 
bytes from current position in the stream", pos);
RETURN_FALSE;
} else if (pos < 0L) {

Modified: php/php-src/trunk/ext/standard/tests/streams/bug46426.phpt
===
--- php/php-src/trunk/ext/standard/tests/streams/bug46426.phpt  2010-10-14 
02:38:23 UTC (rev 304381)
+++ php/php-src/trunk/ext/standard/tests/streams/bug46426.phpt  2010-10-14 
02:39:21 UTC (rev 304382)
@@ -7,19 +7,23 @@

 fwrite($tmp, b"12345");

-echo stream_get_contents($tmp, 2, 1);
+fseek($tmp, 0);
+echo stream_get_contents($tmp, 2, 1); //23
 echo "\n";
-echo stream_get_contents($tmp, -1);
+echo stream_get_contents($tmp, -1); //45
 echo "\n";
-echo stream_get_contents($tmp, -1, 0);
+fseek($tmp, -1, SEEK_CUR);
+echo stream_get_contents($tmp, -1, 0); //5
 echo "\n";
-echo stream_get_contents($tmp, -1, 2);
+fseek($tmp, 0);
+echo stream_get_contents($tmp, -1, 2); //345
 echo "\n";
-echo stream_get_contents($tmp, 0, 0);
+fseek($tmp, 0);
+echo stream_get_contents($tmp, 0, 0); //""
 echo "\n";
-echo stream_get_contents($tmp, 1, 0);
+echo stream_get_contents($tmp, 1, 0); //1
 echo "\n";
-echo stream_get_contents($tmp, -1);
+echo stream_get_contents($tmp, -1); //2345

 @unlink($tmp);

@@ -27,7 +31,7 @@
 --EXPECT--
 23
 45
-12345
+5
 345

 1

Modified: 
php/php-src/trunk/ext/standard/tests/streams/stream_get_contents_001.phpt
===
--- php/php-src/trunk/ext/standard/tests/streams/stream_get_contents_001.phpt   
2010-10-14 02:38:23 UTC (rev 304381)
+++ php/php-src/trunk/ext/standard/tests/streams/stream_get_contents_001.phpt   
2010-10-14 02:39:21 UTC (rev 304382)
@@ -9,14 +9,17 @@

 echo stream_get_contents($tmp, 2, 5), "--\n";
 echo stream_get_contents($tmp, 2), "--\n";
+fseek($tmp, 0);
 echo stream_get_contents($tmp, 2, 3), "--\n";
 echo stream_get_contents($tmp, 2, -1), "--\n";

 @unlink($tmp);

 ?>
---EXPECT--
+--EXPECTF--
 --
 --
 45--
+
+Warning: stream_get_contents(): Number of bytes to seek must be non-negative, 
given -1 in %s on line %d
 --

-- 
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/ streamsfuncs.c

2010-10-13 Thread Gustavo André dos Santos Lopes
cataphract   Thu, 14 Oct 2010 02:03:18 +

Revision: http://svn.php.net/viewvc?view=revision&revision=304380

Log:
- [DOC] Changed stream_get_contents() so that the offset is relative to the
  current position (seek with SEEK_CUR, not SEEK_SET). Only positive values are
  allowed. This breaking change is necessary to fix the erratic behavior in
  streams without a seek handlder. Addresses bug #53006.
#Note that the example on the doc page for stream_get_contents() may fail
#without this change.
#This change is also in the spirit of stream_get_contents(), whose description
#is "Reads all remaining bytes (or up to maxlen bytes) from a stream...".
#Previous behavior allowed setting the file pointer to positions before the
#current one, so they wouldn't be "remaining bytes". The previous behavior was
#also inconsistent in that it allowed an moving to offset 1, 2, ..., but not 0.

Bug: http://bugs.php.net/53006 (Assigned) stream_get_contents offset max is 1165
  
Changed paths:
U   php/php-src/trunk/ext/standard/streamsfuncs.c

Modified: php/php-src/trunk/ext/standard/streamsfuncs.c
===
--- php/php-src/trunk/ext/standard/streamsfuncs.c   2010-10-14 00:09:01 UTC 
(rev 304379)
+++ php/php-src/trunk/ext/standard/streamsfuncs.c   2010-10-14 02:03:18 UTC 
(rev 304380)
@@ -425,9 +425,12 @@

php_stream_from_zval(stream, &zsrc);

-   if ((pos > 0 || (pos == 0 && ZEND_NUM_ARGS() > 2)) && 
php_stream_seek(stream, pos, SEEK_SET) < 0) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to seek to 
position %ld in the stream", pos);
+   if ((pos != 0L) && php_stream_seek(stream, pos, SEEK_CUR) < 0) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to seek %ld 
bytes from current position in the stream", pos);
RETURN_FALSE;
+   } else if (pos < 0L) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number of bytes to 
seek must be non-negative, given %ld", pos);
+   RETURN_FALSE;
}

len = php_stream_copy_to_mem(stream, &contents, maxlen, 0);

-- 
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_3/ext/openssl/openssl.c trunk/ext/openssl/openssl.c

2010-10-13 Thread Adam Harvey
aharvey  Wed, 13 Oct 2010 09:23:39 +

Revision: http://svn.php.net/viewvc?view=revision&revision=304368

Log:
Fix vim marker folds.

Changed paths:
U   php/php-src/branches/PHP_5_3/ext/openssl/openssl.c
U   php/php-src/trunk/ext/openssl/openssl.c

Modified: php/php-src/branches/PHP_5_3/ext/openssl/openssl.c
===
--- php/php-src/branches/PHP_5_3/ext/openssl/openssl.c  2010-10-13 09:22:51 UTC 
(rev 304367)
+++ php/php-src/branches/PHP_5_3/ext/openssl/openssl.c  2010-10-13 09:23:39 UTC 
(rev 304368)
@@ -702,7 +702,7 @@
 #if OPENSSL_VERSION_NUMBER >= 0x1002L
 static inline int php_openssl_config_check_syntax(const char * section_label, 
const char * config_filename, const char * section, LHASH_OF(CONF_VALUE) * 
config TSRMLS_DC) /* {{{ */
 #else
-static inline int php_openssl_config_check_syntax(const char * section_label, 
const char * config_filename, const char * section, LHASH * config TSRMLS_DC) 
/* {{{ */
+static inline int php_openssl_config_check_syntax(const char * section_label, 
const char * config_filename, const char * section, LHASH * config TSRMLS_DC)
 #endif
 {
X509V3_CTX ctx;

Modified: php/php-src/trunk/ext/openssl/openssl.c
===
--- php/php-src/trunk/ext/openssl/openssl.c 2010-10-13 09:22:51 UTC (rev 
304367)
+++ php/php-src/trunk/ext/openssl/openssl.c 2010-10-13 09:23:39 UTC (rev 
304368)
@@ -704,7 +704,7 @@
 #if OPENSSL_VERSION_NUMBER >= 0x1002L
 static inline int php_openssl_config_check_syntax(const char * section_label, 
const char * config_filename, const char * section, LHASH_OF(CONF_VALUE) * 
config TSRMLS_DC) /* {{{ */
 #else
-static inline int php_openssl_config_check_syntax(const char * section_label, 
const char * config_filename, const char * section, LHASH * config TSRMLS_DC) 
/* {{{ */
+static inline int php_openssl_config_check_syntax(const char * section_label, 
const char * config_filename, const char * section, LHASH * config TSRMLS_DC)
 #endif
 {
X509V3_CTX ctx;

-- 
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_3/NEWS branches/PHP_5_3/Zend/tests/bug52939.phpt branches/PHP_5_3/Zend/zend_execute_API.c trunk/Zend/tests/bug52939.phpt trunk/Zend/zend_execute_API.c

2010-10-13 Thread Dmitry Stogov
dmitry   Wed, 13 Oct 2010 08:51:39 +

Revision: http://svn.php.net/viewvc?view=revision&revision=304364

Log:
Fixed bug #52939 (zend_call_function does not respect ZEND_SEND_PREFER_REF)

Bug: http://bugs.php.net/52939 (Assigned) zend_call_function does not respect 
ZEND_SEND_PREFER_REF
  
Changed paths:
U   php/php-src/branches/PHP_5_3/NEWS
U   php/php-src/branches/PHP_5_3/Zend/tests/bug52939.phpt
U   php/php-src/branches/PHP_5_3/Zend/zend_execute_API.c
U   php/php-src/trunk/Zend/tests/bug52939.phpt
U   php/php-src/trunk/Zend/zend_execute_API.c

Modified: php/php-src/branches/PHP_5_3/NEWS
===
--- php/php-src/branches/PHP_5_3/NEWS   2010-10-13 05:12:12 UTC (rev 304363)
+++ php/php-src/branches/PHP_5_3/NEWS   2010-10-13 08:51:39 UTC (rev 304364)
@@ -39,6 +39,8 @@
   in html_entity_decode that had introduced the bug (rev #185591) to other
   encodings. Additionaly, html_entity_decode() now doesn't decode " if
   ENT_NOQUOTES is given. (Gustavo)
+- Fixed bug #52939 (zend_call_function does not respect ZEND_SEND_PREFER_REF).
+  (Dmitry)
 - Fixed bug #52981 (Unicode casing table was out-of-date. Updated with
   UnicodeData-6.0.0d7.txt and included the source of the generator program with
   the distribution) (Gustavo).

Modified: php/php-src/branches/PHP_5_3/Zend/tests/bug52939.phpt
===
--- php/php-src/branches/PHP_5_3/Zend/tests/bug52939.phpt   2010-10-13 
05:12:12 UTC (rev 304363)
+++ php/php-src/branches/PHP_5_3/Zend/tests/bug52939.phpt   2010-10-13 
08:51:39 UTC (rev 304364)
@@ -10,6 +10,11 @@
 $args = array(&$ar1);
 var_dump(call_user_func_array("array_multisort", $args));
 var_dump($ar1);
+
+$ar1 = array("row1" => 2, "row2" => 1);
+$args = array($ar1);
+var_dump(call_user_func_array("array_multisort", $args));
+var_dump($ar1);
 ?>
 --EXPECT--
 bool(true)
@@ -26,3 +31,10 @@
   ["row1"]=>
   int(2)
 }
+bool(true)
+array(2) {
+  ["row1"]=>
+  int(2)
+  ["row2"]=>
+  int(1)
+}

Modified: php/php-src/branches/PHP_5_3/Zend/zend_execute_API.c
===
--- php/php-src/branches/PHP_5_3/Zend/zend_execute_API.c2010-10-13 
05:12:12 UTC (rev 304363)
+++ php/php-src/branches/PHP_5_3/Zend/zend_execute_API.c2010-10-13 
08:51:39 UTC (rev 304364)
@@ -870,7 +870,8 @@
if (Z_REFCOUNT_PP(fci->params[i]) > 1) {
zval *new_zval;

-   if (fci->no_separation) {
+   if (fci->no_separation &&
+   
!ARG_MAY_BE_SENT_BY_REF(EX(function_state).function, i + 1)) {
if(i) {
/* hack to clean up the stack */

zend_vm_stack_push_nocheck((void *) (zend_uintptr_t)i TSRMLS_CC);

Modified: php/php-src/trunk/Zend/tests/bug52939.phpt
===
--- php/php-src/trunk/Zend/tests/bug52939.phpt  2010-10-13 05:12:12 UTC (rev 
304363)
+++ php/php-src/trunk/Zend/tests/bug52939.phpt  2010-10-13 08:51:39 UTC (rev 
304364)
@@ -10,6 +10,11 @@
 $args = array(&$ar1);
 var_dump(call_user_func_array("array_multisort", $args));
 var_dump($ar1);
+
+$ar1 = array("row1" => 2, "row2" => 1);
+$args = array($ar1);
+var_dump(call_user_func_array("array_multisort", $args));
+var_dump($ar1);
 ?>
 --EXPECT--
 bool(true)
@@ -26,3 +31,10 @@
   ["row1"]=>
   int(2)
 }
+bool(true)
+array(2) {
+  ["row1"]=>
+  int(2)
+  ["row2"]=>
+  int(1)
+}

Modified: php/php-src/trunk/Zend/zend_execute_API.c
===
--- php/php-src/trunk/Zend/zend_execute_API.c   2010-10-13 05:12:12 UTC (rev 
304363)
+++ php/php-src/trunk/Zend/zend_execute_API.c   2010-10-13 08:51:39 UTC (rev 
304364)
@@ -854,7 +854,8 @@
if (!PZVAL_IS_REF(*fci->params[i]) && 
Z_REFCOUNT_PP(fci->params[i]) > 1) {
zval *new_zval;

-   if (fci->no_separation) {
+   if (fci->no_separation &&
+   
!ARG_MAY_BE_SENT_BY_REF(EX(function_state).function, i + 1)) {
if(i) {
/* hack to clean up the stack */

zend_vm_stack_push_nocheck((void *) (zend_uintptr_t)i TSRMLS_CC);

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