[PHP-CVS] svn: /php/php-src/trunk/sapi/cli/ php_cli.c

2011-02-22 Thread Johannes Schlüter
johannes Tue, 22 Feb 2011 12:51:43 +

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

Log:
Declare vars first. Fix Windows build.

Changed paths:
U   php/php-src/trunk/sapi/cli/php_cli.c

Modified: php/php-src/trunk/sapi/cli/php_cli.c
===
--- php/php-src/trunk/sapi/cli/php_cli.c2011-02-22 11:02:45 UTC (rev 
308563)
+++ php/php-src/trunk/sapi/cli/php_cli.c2011-02-22 12:51:43 UTC (rev 
308564)
@@ -253,6 +253,8 @@
 {
 #ifdef PHP_WRITE_STDOUT
long ret;
+#else
+   size_t ret;
 #endif

if (cli_shell_callbacks.cli_shell_write) {
@@ -274,8 +276,6 @@

return ret;
 #else
-   size_t ret;
-
ret = fwrite(str, 1, MIN(str_length, 16384), stdout);
return ret;
 #endif

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

[PHP-CVS] svn: /php/php-src/trunk/sapi/cli/ php_cli_readline.c php_cli_readline.h

2011-02-22 Thread Pierre Joye
pajoye   Tue, 22 Feb 2011 12:59:50 +

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

Log:
- missing files

Changed paths:
A   php/php-src/trunk/sapi/cli/php_cli_readline.c
A   php/php-src/trunk/sapi/cli/php_cli_readline.h

Added: php/php-src/trunk/sapi/cli/php_cli_readline.c
===
--- php/php-src/trunk/sapi/cli/php_cli_readline.c	(rev 0)
+++ php/php-src/trunk/sapi/cli/php_cli_readline.c	2011-02-22 12:59:50 UTC (rev 308565)
@@ -0,0 +1,448 @@
+/*
+   +--+
+   | PHP Version 5|
+   +--+
+   | Copyright (c) 1997-2011 The PHP Group|
+   +--+
+   | This source file is subject to version 3.01 of the PHP license,  |
+   | that is bundled with this package in the file LICENSE, and is|
+   | available through the world-wide-web at the following url:   |
+   | http://www.php.net/license/3_01.txt  |
+   | If you did not receive a copy of the PHP license and are unable to   |
+   | obtain it through the world-wide-web, please send a note to  |
+   | lice...@php.net so we can mail you a copy immediately.   |
+   +--+
+   | Author: Marcus Boerger he...@php.net   |
+   | Johannes Schlueter johan...@php.net|
+   +--+
+*/
+
+/* $Id: php_cli_readline.c 306939 2011-01-01 02:19:59Z felipe $ */
+
+#include php.h
+
+#if (HAVE_LIBREADLINE || HAVE_LIBEDIT)  !defined(COMPILE_DL_READLINE)
+
+#ifndef HAVE_RL_COMPLETION_MATCHES
+#define rl_completion_matches completion_matches
+#endif
+
+#include php_globals.h
+#include php_variables.h
+#include zend_hash.h
+#include zend_modules.h
+
+#include SAPI.h
+
+#if HAVE_SETLOCALE
+#include locale.h
+#endif
+#include zend.h
+#include zend_extensions.h
+#include php_ini.h
+#include php_globals.h
+#include php_main.h
+#include fopen_wrappers.h
+#include ext/standard/php_standard.h
+
+#ifdef __riscos__
+#include unixlib/local.h
+#endif
+
+#if HAVE_LIBEDIT
+#include editline/readline.h
+#else
+#include readline/readline.h
+#include readline/history.h
+#endif
+
+#include zend_compile.h
+#include zend_execute.h
+#include zend_highlight.h
+#include zend_indent.h
+
+typedef enum {
+	body,
+	sstring,
+	dstring,
+	sstring_esc,
+	dstring_esc,
+	comment_line,
+	comment_block,
+	heredoc_start,
+	heredoc,
+	outside,
+} php_code_type;
+
+int cli_is_valid_code(char *code, int len, char **prompt TSRMLS_DC) /* {{{ */
+{
+	int valid_end = 1, last_valid_end;
+	int brackets_count = 0;
+	int brace_count = 0;
+	int i;
+	php_code_type code_type = body;
+	char *heredoc_tag;
+	int heredoc_len;
+
+	for (i = 0; i  len; ++i) {
+		switch(code_type) {
+			default:
+switch(code[i]) {
+	case '{':
+		brackets_count++;
+		valid_end = 0;
+		break;
+	case '}':
+		if (brackets_count  0) {
+			brackets_count--;
+		}
+		valid_end = brackets_count ? 0 : 1;
+		break;
+	case '(':
+		brace_count++;
+		valid_end = 0;
+		break;
+	case ')':
+		if (brace_count  0) {
+			brace_count--;
+		}
+		valid_end = 0;
+		break;
+	case ';':
+		valid_end = brace_count == 0  brackets_count == 0;
+		break;
+	case ' ':
+	case '\r':
+	case '\n':
+	case '\t':
+		break;
+	case '\'':
+		code_type = sstring;
+		break;
+	case '':
+		code_type = dstring;
+		break;
+	case '#':
+		code_type = comment_line;
+		break;
+	case '/':
+		if (code[i+1] == '/') {
+			i++;
+			code_type = comment_line;
+			break;
+		}
+		if (code[i+1] == '*') {
+			last_valid_end = valid_end;
+			valid_end = 0;
+			code_type = comment_block;
+			i++;
+			break;
+		}
+		valid_end = 0;
+		break;
+	case '%':
+		if (!CG(asp_tags)) {
+			valid_end = 0;
+			break;
+		}
+		/* no break */
+	case '?':
+		if (code[i+1] == '') {
+			i++;
+			code_type = outside;
+			break;
+		}
+		valid_end = 0;
+		break;
+	case '':
+		valid_end = 0;
+		if (i + 2  len  code[i+1] == ''  code[i+2] == '') {
+			i += 2;
+			code_type = heredoc_start;
+			heredoc_len = 0;
+		}
+		break;
+	default:
+		valid_end = 0;
+		break;
+}
+break;
+			case sstring:
+if (code[i] == '\\') {
+	code_type = sstring_esc;
+} else {
+	if (code[i] == '\'') {
+		code_type = body;
+	}
+}
+break;
+			case 

[PHP-CVS] svn: /php/php-src/trunk/sapi/cli/ php_cli_readline.c php_cli_readline.h

2011-02-22 Thread Pierre Joye
pajoye   Tue, 22 Feb 2011 13:09:15 +

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

Log:
-not needed, buildconf helps...

Changed paths:
D   php/php-src/trunk/sapi/cli/php_cli_readline.c
D   php/php-src/trunk/sapi/cli/php_cli_readline.h

Deleted: php/php-src/trunk/sapi/cli/php_cli_readline.c
===
--- php/php-src/trunk/sapi/cli/php_cli_readline.c	2011-02-22 12:59:50 UTC (rev 308565)
+++ php/php-src/trunk/sapi/cli/php_cli_readline.c	2011-02-22 13:09:15 UTC (rev 308566)
@@ -1,448 +0,0 @@
-/*
-   +--+
-   | PHP Version 5|
-   +--+
-   | Copyright (c) 1997-2011 The PHP Group|
-   +--+
-   | This source file is subject to version 3.01 of the PHP license,  |
-   | that is bundled with this package in the file LICENSE, and is|
-   | available through the world-wide-web at the following url:   |
-   | http://www.php.net/license/3_01.txt  |
-   | If you did not receive a copy of the PHP license and are unable to   |
-   | obtain it through the world-wide-web, please send a note to  |
-   | lice...@php.net so we can mail you a copy immediately.   |
-   +--+
-   | Author: Marcus Boerger he...@php.net   |
-   | Johannes Schlueter johan...@php.net|
-   +--+
-*/
-
-/* $Id: php_cli_readline.c 306939 2011-01-01 02:19:59Z felipe $ */
-
-#include php.h
-
-#if (HAVE_LIBREADLINE || HAVE_LIBEDIT)  !defined(COMPILE_DL_READLINE)
-
-#ifndef HAVE_RL_COMPLETION_MATCHES
-#define rl_completion_matches completion_matches
-#endif
-
-#include php_globals.h
-#include php_variables.h
-#include zend_hash.h
-#include zend_modules.h
-
-#include SAPI.h
-
-#if HAVE_SETLOCALE
-#include locale.h
-#endif
-#include zend.h
-#include zend_extensions.h
-#include php_ini.h
-#include php_globals.h
-#include php_main.h
-#include fopen_wrappers.h
-#include ext/standard/php_standard.h
-
-#ifdef __riscos__
-#include unixlib/local.h
-#endif
-
-#if HAVE_LIBEDIT
-#include editline/readline.h
-#else
-#include readline/readline.h
-#include readline/history.h
-#endif
-
-#include zend_compile.h
-#include zend_execute.h
-#include zend_highlight.h
-#include zend_indent.h
-
-typedef enum {
-	body,
-	sstring,
-	dstring,
-	sstring_esc,
-	dstring_esc,
-	comment_line,
-	comment_block,
-	heredoc_start,
-	heredoc,
-	outside,
-} php_code_type;
-
-int cli_is_valid_code(char *code, int len, char **prompt TSRMLS_DC) /* {{{ */
-{
-	int valid_end = 1, last_valid_end;
-	int brackets_count = 0;
-	int brace_count = 0;
-	int i;
-	php_code_type code_type = body;
-	char *heredoc_tag;
-	int heredoc_len;
-
-	for (i = 0; i  len; ++i) {
-		switch(code_type) {
-			default:
-switch(code[i]) {
-	case '{':
-		brackets_count++;
-		valid_end = 0;
-		break;
-	case '}':
-		if (brackets_count  0) {
-			brackets_count--;
-		}
-		valid_end = brackets_count ? 0 : 1;
-		break;
-	case '(':
-		brace_count++;
-		valid_end = 0;
-		break;
-	case ')':
-		if (brace_count  0) {
-			brace_count--;
-		}
-		valid_end = 0;
-		break;
-	case ';':
-		valid_end = brace_count == 0  brackets_count == 0;
-		break;
-	case ' ':
-	case '\r':
-	case '\n':
-	case '\t':
-		break;
-	case '\'':
-		code_type = sstring;
-		break;
-	case '':
-		code_type = dstring;
-		break;
-	case '#':
-		code_type = comment_line;
-		break;
-	case '/':
-		if (code[i+1] == '/') {
-			i++;
-			code_type = comment_line;
-			break;
-		}
-		if (code[i+1] == '*') {
-			last_valid_end = valid_end;
-			valid_end = 0;
-			code_type = comment_block;
-			i++;
-			break;
-		}
-		valid_end = 0;
-		break;
-	case '%':
-		if (!CG(asp_tags)) {
-			valid_end = 0;
-			break;
-		}
-		/* no break */
-	case '?':
-		if (code[i+1] == '') {
-			i++;
-			code_type = outside;
-			break;
-		}
-		valid_end = 0;
-		break;
-	case '':
-		valid_end = 0;
-		if (i + 2  len  code[i+1] == ''  code[i+2] == '') {
-			i += 2;
-			code_type = heredoc_start;
-			heredoc_len = 0;
-		}
-		break;
-	default:
-		valid_end = 0;
-		break;
-}
-break;
-			case sstring:
-if (code[i] == '\\') {
-	code_type = sstring_esc;
-} else {
-	if (code[i] == '\'') {
-		code_type = body;
-	}
-}

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/mysqli/tests/mysqli_debug_mysqlnd_control_string.phpt trunk/ext/mysqli/tests/mysqli_debug_mysqlnd_control_string.phpt

2011-02-22 Thread Johannes Schlüter
johannes Tue, 22 Feb 2011 14:49:32 +

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

Log:
- Fix tests. temp dir might be something other than /tmp

Changed paths:
U   
php/php-src/branches/PHP_5_3/ext/mysqli/tests/mysqli_debug_mysqlnd_control_string.phpt
U   
php/php-src/trunk/ext/mysqli/tests/mysqli_debug_mysqlnd_control_string.phpt

Modified: 
php/php-src/branches/PHP_5_3/ext/mysqli/tests/mysqli_debug_mysqlnd_control_string.phpt
===
--- 
php/php-src/branches/PHP_5_3/ext/mysqli/tests/mysqli_debug_mysqlnd_control_string.phpt
  2011-02-22 14:05:12 UTC (rev 308567)
+++ 
php/php-src/branches/PHP_5_3/ext/mysqli/tests/mysqli_debug_mysqlnd_control_string.phpt
  2011-02-22 14:49:32 UTC (rev 308568)
@@ -223,5 +223,5 @@
require_once(clean_table.inc);
 ?
 --EXPECTF--
-[083][control string 'n:O,/tmp/mysqli_debug_phpt.trace'] Trace file has not 
been written.
+[083][control string 'n:O,%smysqli_debug_phpt.trace'] Trace file has not been 
written.
 done%s

Modified: 
php/php-src/trunk/ext/mysqli/tests/mysqli_debug_mysqlnd_control_string.phpt
===
--- php/php-src/trunk/ext/mysqli/tests/mysqli_debug_mysqlnd_control_string.phpt 
2011-02-22 14:05:12 UTC (rev 308567)
+++ php/php-src/trunk/ext/mysqli/tests/mysqli_debug_mysqlnd_control_string.phpt 
2011-02-22 14:49:32 UTC (rev 308568)
@@ -223,5 +223,5 @@
require_once(clean_table.inc);
 ?
 --EXPECTF--
-[083][control string 'n:O,/tmp/mysqli_debug_phpt.trace'] Trace file has not 
been written.
+[083][control string 'n:O,%smysqli_debug_phpt.trace'] Trace file has not been 
written.
 done%s

-- 
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/pdo/ pdo_stmt.c

2011-02-22 Thread Ilia Alshanetsky
iliaaTue, 22 Feb 2011 15:48:25 +

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

Log:
Fixed compiler warning

Changed paths:
U   php/php-src/branches/PHP_5_3/ext/pdo/pdo_stmt.c

Modified: php/php-src/branches/PHP_5_3/ext/pdo/pdo_stmt.c
===
--- php/php-src/branches/PHP_5_3/ext/pdo/pdo_stmt.c 2011-02-22 14:49:32 UTC 
(rev 308568)
+++ php/php-src/branches/PHP_5_3/ext/pdo/pdo_stmt.c 2011-02-22 15:48:25 UTC 
(rev 308569)
@@ -2183,7 +2183,7 @@
php_stream_printf(out TSRMLS_CC, Key: Name: 
[%d] %.*s\n, len, len, str);
}

-   php_stream_printf(out TSRMLS_CC, paramno=%d\nname=[%d] 
\%.*s\\nis_param=%d\nparam_type=%d\n,
+   php_stream_printf(out TSRMLS_CC, 
paramno=%ld\nname=[%d] \%.*s\\nis_param=%d\nparam_type=%d\n,
param-paramno, param-namelen, param-namelen, 
param-name ? param-name : ,
param-is_param,
param-param_type);

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