Re: [PHP-CVS] cvs: php-src /sapi/cli php_cli.c

2009-04-08 Thread Arnaud Le Blanc
Hi,

On Wed, 2009-04-08 at 00:14 +, Felipe Pena wrote:
 felipeWed Apr  8 00:14:37 2009 UTC
 
   Modified files:  
 /php-src/sapi/cli php_cli.c 
   Log:
   - Fix ZTS build
   
 http://cvs.php.net/viewvc.cgi/php-src/sapi/cli/php_cli.c?r1=1.207r2=1.208diff_format=u
 Index: php-src/sapi/cli/php_cli.c
 diff -u php-src/sapi/cli/php_cli.c:1.207 php-src/sapi/cli/php_cli.c:1.208
 --- php-src/sapi/cli/php_cli.c:1.207  Tue Apr  7 16:10:35 2009
 +++ php-src/sapi/cli/php_cli.cWed Apr  8 00:14:37 2009
 @@ -20,7 +20,7 @@
 +--+
  */
  
 -/* $Id: php_cli.c,v 1.207 2009/04/07 16:10:35 lbarnaud Exp $ */
 +/* $Id: php_cli.c,v 1.208 2009/04/08 00:14:37 felipe Exp $ */
  
  #include php.h
  #include php_globals.h
 @@ -234,7 +234,7 @@
  #define STDOUT_FILENO 1
  #endif
  
 -static inline int sapi_cli_select(int fd)
 +static inline int sapi_cli_select(int fd TSRMLS_DC)
  {
   fd_set wfd, dfd;
   struct timeval tv;
 @@ -253,14 +253,14 @@
   return ret != -1;
  }
  
 -static inline size_t sapi_cli_single_write(const char *str, uint str_length) 
 /* {{{ */
 +static inline size_t sapi_cli_single_write(const char *str, uint str_length 
 TSRMLS_DC) /* {{{ */
  {
  #ifdef PHP_WRITE_STDOUT
   long ret;
  
   do {
   ret = write(STDOUT_FILENO, str, str_length);
 - } while (ret = 0  errno == EAGAIN  sapi_cli_select(STDOUT_FILENO));
 + } while (ret = 0  errno == EAGAIN  sapi_cli_select(STDOUT_FILENO 
 TSRMLS_CC));
  
   if (ret = 0) {
   return 0;
 @@ -291,7 +291,7 @@
  
   while (remaining  0)
   {
 - ret = sapi_cli_single_write(ptr, remaining);
 + ret = sapi_cli_single_write(ptr, remaining TSRMLS_CC);
   if (!ret) {
  #ifndef PHP_CLI_WIN32_NO_CONSOLE
   php_handle_aborted_connection();
 @@ -1173,7 +1173,7 @@
   pos = 0;
   
   if (php_last_char != '\0'  
 php_last_char != '\n') {
 - sapi_cli_single_write(\n, 1);
 + sapi_cli_single_write(\n, 1 
 TSRMLS_CC);
   }
  
   if (EG(exception)) {
 
 
 

Thanks :)

Regards,

Arnaud



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



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

2009-04-07 Thread Arnaud Le Blanc
lbarnaudTue Apr  7 16:10:35 2009 UTC

  Modified files:  
/php-src/sapi/cli   php_cli.c 
  Log:
  Fixed bug #47893 (CLI aborts on non blocking stdout)
  
  
http://cvs.php.net/viewvc.cgi/php-src/sapi/cli/php_cli.c?r1=1.206r2=1.207diff_format=u
Index: php-src/sapi/cli/php_cli.c
diff -u php-src/sapi/cli/php_cli.c:1.206 php-src/sapi/cli/php_cli.c:1.207
--- php-src/sapi/cli/php_cli.c:1.206Tue Mar 10 23:40:02 2009
+++ php-src/sapi/cli/php_cli.c  Tue Apr  7 16:10:35 2009
@@ -20,7 +20,7 @@
+--+
 */
 
-/* $Id: php_cli.c,v 1.206 2009/03/10 23:40:02 helly Exp $ */
+/* $Id: php_cli.c,v 1.207 2009/04/07 16:10:35 lbarnaud Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -91,6 +91,12 @@
 
 #include php_getopt.h
 
+#ifndef PHP_WIN32
+# define php_select(m, r, w, e, t) select(m, r, w, e, t)
+#else
+# include win32/select.h
+#endif
+
 PHPAPI extern char *php_ini_opened_path;
 PHPAPI extern char *php_ini_scanned_files;
 
@@ -228,15 +234,38 @@
 #define STDOUT_FILENO 1
 #endif
 
+static inline int sapi_cli_select(int fd)
+{
+   fd_set wfd, dfd;
+   struct timeval tv;
+   int ret;
+
+   FD_ZERO(wfd);
+   FD_ZERO(dfd);
+
+   PHP_SAFE_FD_SET(fd, wfd);
+
+   tv.tv_sec = FG(default_socket_timeout);
+   tv.tv_usec = 0;
+
+   ret = php_select(fd+1, dfd, wfd, dfd, tv);
+
+   return ret != -1;
+}
+
 static inline size_t sapi_cli_single_write(const char *str, uint str_length) 
/* {{{ */
 {
 #ifdef PHP_WRITE_STDOUT
long ret;
 
-   ret = write(STDOUT_FILENO, str, str_length);
+   do {
+   ret = write(STDOUT_FILENO, str, str_length);
+   } while (ret = 0  errno == EAGAIN  sapi_cli_select(STDOUT_FILENO));
+
if (ret = 0) {
return 0;
}
+
return ret;
 #else
size_t ret;



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



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

2009-04-07 Thread Felipe Pena
felipe  Wed Apr  8 00:14:37 2009 UTC

  Modified files:  
/php-src/sapi/cli   php_cli.c 
  Log:
  - Fix ZTS build
  
http://cvs.php.net/viewvc.cgi/php-src/sapi/cli/php_cli.c?r1=1.207r2=1.208diff_format=u
Index: php-src/sapi/cli/php_cli.c
diff -u php-src/sapi/cli/php_cli.c:1.207 php-src/sapi/cli/php_cli.c:1.208
--- php-src/sapi/cli/php_cli.c:1.207Tue Apr  7 16:10:35 2009
+++ php-src/sapi/cli/php_cli.c  Wed Apr  8 00:14:37 2009
@@ -20,7 +20,7 @@
+--+
 */
 
-/* $Id: php_cli.c,v 1.207 2009/04/07 16:10:35 lbarnaud Exp $ */
+/* $Id: php_cli.c,v 1.208 2009/04/08 00:14:37 felipe Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -234,7 +234,7 @@
 #define STDOUT_FILENO 1
 #endif
 
-static inline int sapi_cli_select(int fd)
+static inline int sapi_cli_select(int fd TSRMLS_DC)
 {
fd_set wfd, dfd;
struct timeval tv;
@@ -253,14 +253,14 @@
return ret != -1;
 }
 
-static inline size_t sapi_cli_single_write(const char *str, uint str_length) 
/* {{{ */
+static inline size_t sapi_cli_single_write(const char *str, uint str_length 
TSRMLS_DC) /* {{{ */
 {
 #ifdef PHP_WRITE_STDOUT
long ret;
 
do {
ret = write(STDOUT_FILENO, str, str_length);
-   } while (ret = 0  errno == EAGAIN  sapi_cli_select(STDOUT_FILENO));
+   } while (ret = 0  errno == EAGAIN  sapi_cli_select(STDOUT_FILENO 
TSRMLS_CC));
 
if (ret = 0) {
return 0;
@@ -291,7 +291,7 @@
 
while (remaining  0)
{
-   ret = sapi_cli_single_write(ptr, remaining);
+   ret = sapi_cli_single_write(ptr, remaining TSRMLS_CC);
if (!ret) {
 #ifndef PHP_CLI_WIN32_NO_CONSOLE
php_handle_aborted_connection();
@@ -1173,7 +1173,7 @@
pos = 0;

if (php_last_char != '\0'  
php_last_char != '\n') {
-   sapi_cli_single_write(\n, 1);
+   sapi_cli_single_write(\n, 1 
TSRMLS_CC);
}
 
if (EG(exception)) {



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



[PHP-CVS] cvs: php-src /sapi/cli php_cli.c ZendEngine2 zend.c zend_exceptions.c zend_exceptions.h zend_execute_API.c

2009-01-02 Thread Marcus Boerger
helly   Fri Jan  2 13:14:17 2009 UTC

  Modified files:  
/ZendEngine2zend.c zend_execute_API.c zend_exceptions.c 
zend_exceptions.h 
/php-src/sapi/cli   php_cli.c 
  Log:
  - Catch exceptions in cli -a
  
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend.c?r1=1.427r2=1.428diff_format=u
Index: ZendEngine2/zend.c
diff -u ZendEngine2/zend.c:1.427 ZendEngine2/zend.c:1.428
--- ZendEngine2/zend.c:1.427Wed Dec 31 12:24:56 2008
+++ ZendEngine2/zend.c  Fri Jan  2 13:14:16 2009
@@ -17,7 +17,7 @@
+--+
 */
 
-/* $Id: zend.c,v 1.427 2008/12/31 12:24:56 helly Exp $ */
+/* $Id: zend.c,v 1.428 2009/01/02 13:14:16 helly Exp $ */
 
 #include zend.h
 #include zend_extensions.h
@@ -1728,10 +1728,10 @@
}
} else {

zend_exception_restore(TSRMLS_C);
-   
zend_exception_error(EG(exception) TSRMLS_CC);
+   
zend_exception_error(EG(exception), E_ERROR TSRMLS_CC);
}
} else {
-   zend_exception_error(EG(exception) 
TSRMLS_CC);
+   zend_exception_error(EG(exception), 
E_ERROR TSRMLS_CC);
}
}
destroy_op_array(EG(active_op_array) TSRMLS_CC);
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_execute_API.c?r1=1.470r2=1.471diff_format=u
Index: ZendEngine2/zend_execute_API.c
diff -u ZendEngine2/zend_execute_API.c:1.470 
ZendEngine2/zend_execute_API.c:1.471
--- ZendEngine2/zend_execute_API.c:1.470Wed Dec 31 11:12:29 2008
+++ ZendEngine2/zend_execute_API.c  Fri Jan  2 13:14:17 2009
@@ -17,7 +17,7 @@
+--+
 */
 
-/* $Id: zend_execute_API.c,v 1.470 2008/12/31 11:12:29 sebastian Exp $ */
+/* $Id: zend_execute_API.c,v 1.471 2009/01/02 13:14:17 helly Exp $ */
 
 #include stdio.h
 #include signal.h
@@ -1312,7 +1312,7 @@
 
result = zend_u_eval_string(type, str, retval_ptr, string_name 
TSRMLS_CC);
if (handle_exceptions  EG(exception)) {
-   zend_exception_error(EG(exception) TSRMLS_CC);
+   zend_exception_error(EG(exception), E_ERROR TSRMLS_CC);
result = FAILURE;
}
return result;
@@ -1387,7 +1387,7 @@
zend_execute(CG(active_op_array) TSRMLS_CC);
 
if (EG(exception)) {
-   zend_exception_error(EG(exception) TSRMLS_CC);
+   zend_exception_error(EG(exception), E_ERROR TSRMLS_CC);
}
 
CG(active_op_array)-last -= 1; /* get rid of that ZEND_RETURN */
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_exceptions.c?r1=1.131r2=1.132diff_format=u
Index: ZendEngine2/zend_exceptions.c
diff -u ZendEngine2/zend_exceptions.c:1.131 ZendEngine2/zend_exceptions.c:1.132
--- ZendEngine2/zend_exceptions.c:1.131 Wed Dec 31 11:12:28 2008
+++ ZendEngine2/zend_exceptions.c   Fri Jan  2 13:14:17 2009
@@ -19,7 +19,7 @@
+--+
 */
 
-/* $Id: zend_exceptions.c,v 1.131 2008/12/31 11:12:28 sebastian Exp $ */
+/* $Id: zend_exceptions.c,v 1.132 2009/01/02 13:14:17 helly Exp $ */
 
 #include zend.h
 #include zend_API.h
@@ -817,8 +817,8 @@
 }
 /* }}} */
 
-/* This function doesn't return as it calls E_ERROR */
-ZEND_API void zend_exception_error(zval *exception TSRMLS_DC) /* {{{ */
+/* This function doesn't return if it uses E_ERROR */
+ZEND_API void zend_exception_error(zval *exception, int severity TSRMLS_DC) /* 
{{{ */
 {
zend_class_entry *ce_exception = Z_OBJCE_P(exception);
if (instanceof_function(ce_exception, default_exception_ce TSRMLS_CC)) {
@@ -861,10 +861,10 @@
zend_error_va(E_ERROR, Z_STRVAL(copy), Z_LVAL_P(line), 
Uncaught %R\n  thrown, Z_TYPE_P(str), Z_UNIVAL_P(str));
zval_dtor(copy);
} else {
-   zend_error_va(E_ERROR, Z_STRVAL_P(file), 
Z_LVAL_P(line), Uncaught %R\n  thrown, Z_TYPE_P(str), Z_UNIVAL_P(str));
+   zend_error_va(severity, Z_STRVAL_P(file), 
Z_LVAL_P(line), Uncaught %R\n  thrown, Z_TYPE_P(str), Z_UNIVAL_P(str));
}
} else {
-   zend_error(E_ERROR, Uncaught exception '%v', 
ce_exception-name);
+   zend_error(severity, Uncaught exception '%v', 
ce_exception-name);
}
 }
 /* }}} */
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_exceptions.h?r1=1.32r2=1.33diff_format=u
Index: ZendEngine2/zend_exceptions.h
diff -u ZendEngine2/zend_exceptions.h:1.32 ZendEngine2/zend_exceptions.h:1.33
--- ZendEngine2/zend_exceptions.h:1.32  Wed Dec 31 11:12:28 2008

[PHP-CVS] cvs: php-src /sapi/cli php_cli.c /sapi/embed php_embed.c

2008-12-31 Thread Marcus Boerger
helly   Wed Dec 31 14:15:42 2008 UTC

  Modified files:  
/php-src/sapi/cli   php_cli.c 
/php-src/sapi/embed php_embed.c 
  Log:
  - WS
  
http://cvs.php.net/viewvc.cgi/php-src/sapi/cli/php_cli.c?r1=1.202r2=1.203diff_format=u
Index: php-src/sapi/cli/php_cli.c
diff -u php-src/sapi/cli/php_cli.c:1.202 php-src/sapi/cli/php_cli.c:1.203
--- php-src/sapi/cli/php_cli.c:1.202Wed Dec 31 11:12:39 2008
+++ php-src/sapi/cli/php_cli.c  Wed Dec 31 14:15:41 2008
@@ -20,7 +20,7 @@
+--+
 */
 
-/* $Id: php_cli.c,v 1.202 2008/12/31 11:12:39 sebastian Exp $ */
+/* $Id: php_cli.c,v 1.203 2008/12/31 14:15:41 helly Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -429,6 +429,7 @@
STANDARD_SAPI_MODULE_PROPERTIES
 };
 /* }}} */
+
 /* {{{ arginfo ext/standard/dl.c */
 ZEND_BEGIN_ARG_INFO(arginfo_dl, 0)
ZEND_ARG_INFO(0, extension_filename)
http://cvs.php.net/viewvc.cgi/php-src/sapi/embed/php_embed.c?r1=1.29r2=1.30diff_format=u
Index: php-src/sapi/embed/php_embed.c
diff -u php-src/sapi/embed/php_embed.c:1.29 php-src/sapi/embed/php_embed.c:1.30
--- php-src/sapi/embed/php_embed.c:1.29 Wed Dec 31 11:12:40 2008
+++ php-src/sapi/embed/php_embed.c  Wed Dec 31 14:15:41 2008
@@ -15,7 +15,7 @@
| Author: Edin Kadribasic ed...@php.net  |
+--+
 */
-/* $Id: php_embed.c,v 1.29 2008/12/31 11:12:40 sebastian Exp $ */
+/* $Id: php_embed.c,v 1.30 2008/12/31 14:15:41 helly Exp $ */
 
 #include php_embed.h
 #include ext/standard/dl.h
@@ -140,6 +140,7 @@
STANDARD_SAPI_MODULE_PROPERTIES
 };
 /* }}} */
+
 /* {{{ arginfo ext/standard/dl.c */
 ZEND_BEGIN_ARG_INFO(arginfo_dl, 0)
ZEND_ARG_INFO(0, extension_filename)



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



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

2008-11-24 Thread Arnaud Le Blanc
lbarnaudTue Nov 25 03:49:21 2008 UTC

  Modified files:  
/php-src/sapi/cli   php_cli.c 
  Log:
  Fixed endless loop in cli when ignore_user_abort is on
  
  
http://cvs.php.net/viewvc.cgi/php-src/sapi/cli/php_cli.c?r1=1.200r2=1.201diff_format=u
Index: php-src/sapi/cli/php_cli.c
diff -u php-src/sapi/cli/php_cli.c:1.200 php-src/sapi/cli/php_cli.c:1.201
--- php-src/sapi/cli/php_cli.c:1.200Mon Nov 17 11:26:25 2008
+++ php-src/sapi/cli/php_cli.c  Tue Nov 25 03:49:21 2008
@@ -20,7 +20,7 @@
+--+
 */
 
-/* $Id: php_cli.c,v 1.200 2008/11/17 11:26:25 felipe Exp $ */
+/* $Id: php_cli.c,v 1.201 2008/11/25 03:49:21 lbarnaud Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -264,11 +264,10 @@
{
ret = sapi_cli_single_write(ptr, remaining);
if (!ret) {
-#ifdef PHP_CLI_WIN32_NO_CONSOLE
-   break;
-#else
+#ifndef PHP_CLI_WIN32_NO_CONSOLE
php_handle_aborted_connection();
 #endif
+   break;
}
ptr += ret;
remaining -= ret;



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



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

2008-08-14 Thread Antony Dovgal
tony2001Thu Aug 14 09:46:12 2008 UTC

  Modified files:  
/php-src/sapi/cli   php_cli.c 
  Log:
  nuke unused var
  
  
http://cvs.php.net/viewvc.cgi/php-src/sapi/cli/php_cli.c?r1=1.195r2=1.196diff_format=u
Index: php-src/sapi/cli/php_cli.c
diff -u php-src/sapi/cli/php_cli.c:1.195 php-src/sapi/cli/php_cli.c:1.196
--- php-src/sapi/cli/php_cli.c:1.195Wed Aug 13 06:17:15 2008
+++ php-src/sapi/cli/php_cli.c  Thu Aug 14 09:46:12 2008
@@ -20,7 +20,7 @@
+--+
 */
 
-/* $Id: php_cli.c,v 1.195 2008/08/13 06:17:15 dmitry Exp $ */
+/* $Id: php_cli.c,v 1.196 2008/08/14 09:46:12 tony2001 Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -578,8 +578,6 @@
  */
 static int cli_seek_file_begin(zend_file_handle *file_handle, char 
*script_file, int *lineno TSRMLS_DC)
 {
-   int c;
-
*lineno = 1;
 
file_handle-type = ZEND_HANDLE_FP;



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



[PHP-CVS] cvs: php-src /sapi/cli php_cli.c ZendEngine2 zend_language_scanner.l zend_language_scanner_defs.h

2008-08-13 Thread Dmitry Stogov
dmitry  Wed Aug 13 06:17:15 2008 UTC

  Modified files:  
/ZendEngine2zend_language_scanner.l zend_language_scanner_defs.h 
/php-src/sapi/cli   php_cli.c 
  Log:
  Fixed bug #45779 (regression with shebang lines processing)
  
  
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_language_scanner.l?r1=1.193r2=1.194diff_format=u
Index: ZendEngine2/zend_language_scanner.l
diff -u ZendEngine2/zend_language_scanner.l:1.193 
ZendEngine2/zend_language_scanner.l:1.194
--- ZendEngine2/zend_language_scanner.l:1.193   Tue Aug 12 09:39:39 2008
+++ ZendEngine2/zend_language_scanner.l Wed Aug 13 06:17:15 2008
@@ -21,7 +21,7 @@
+--+
 */
 
-/* $Id: zend_language_scanner.l,v 1.193 2008/08/12 09:39:39 helly Exp $ */
+/* $Id: zend_language_scanner.l,v 1.194 2008/08/13 06:17:15 dmitry Exp $ */
 
 #if 0
 # define YYDEBUG(s, c) printf(state: %d char: %c\n, s, c)
@@ -1340,6 +1340,7 @@
while (++YYCURSOR  YYLIMIT) {
if (*YYCURSOR == '\n') {
++YYCURSOR;
+   CG(zend_lineno)++;
goto restart;
}
 
@@ -1347,6 +1348,7 @@
if (++YYCURSOR  YYLIMIT  *YYCURSOR == '\n') 
{ /* match \r\n as single newline */
++YYCURSOR;
}
+   CG(zend_lineno)++;
goto restart;
}
}
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_language_scanner_defs.h?r1=1.9r2=1.10diff_format=u
Index: ZendEngine2/zend_language_scanner_defs.h
diff -u ZendEngine2/zend_language_scanner_defs.h:1.9 
ZendEngine2/zend_language_scanner_defs.h:1.10
--- ZendEngine2/zend_language_scanner_defs.h:1.9Mon Jul 28 06:09:56 2008
+++ ZendEngine2/zend_language_scanner_defs.hWed Aug 13 06:17:15 2008
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.13.5 on Mon Jul 28 15:05:16 2008 */
+/* Generated by re2c 0.13.5 on Tue Aug 12 20:42:02 2008 */
 #line 3 Zend/zend_language_scanner_defs.h
 
 enum YYCONDTYPE {
http://cvs.php.net/viewvc.cgi/php-src/sapi/cli/php_cli.c?r1=1.194r2=1.195diff_format=u
Index: php-src/sapi/cli/php_cli.c
diff -u php-src/sapi/cli/php_cli.c:1.194 php-src/sapi/cli/php_cli.c:1.195
--- php-src/sapi/cli/php_cli.c:1.194Wed Aug 13 00:49:59 2008
+++ php-src/sapi/cli/php_cli.c  Wed Aug 13 06:17:15 2008
@@ -20,7 +20,7 @@
+--+
 */
 
-/* $Id: php_cli.c,v 1.194 2008/08/13 00:49:59 jani Exp $ */
+/* $Id: php_cli.c,v 1.195 2008/08/13 06:17:15 dmitry Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -590,23 +590,6 @@
return FAILURE;
}
file_handle-filename = script_file;
-   /* #!php support */
-   c = fgetc(file_handle-handle.fp);
-   if (c == '#') {
-   while (c != '\n'  c != '\r') {
-   c = fgetc(file_handle-handle.fp);  /* skip to end 
of line */
-   }
-   /* handle situations where line is terminated by \r\n */
-   if (c == '\r') {
-   if (fgetc(file_handle-handle.fp) != '\n') {
-   long pos = ftell(file_handle-handle.fp);
-   fseek(file_handle-handle.fp, pos - 1, 
SEEK_SET);
-   }
-   }
-   *lineno = 2;
-   } else {
-   rewind(file_handle-handle.fp);
-   }
return SUCCESS;
 }
 /* }}} */



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



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

2008-07-25 Thread Antony Dovgal
tony2001Fri Jul 25 15:05:33 2008 UTC

  Modified files:  
/php-src/sapi/cli   php_cli.c 
  Log:
  fix warnings
  
  
http://cvs.php.net/viewvc.cgi/php-src/sapi/cli/php_cli.c?r1=1.192r2=1.193diff_format=u
Index: php-src/sapi/cli/php_cli.c
diff -u php-src/sapi/cli/php_cli.c:1.192 php-src/sapi/cli/php_cli.c:1.193
--- php-src/sapi/cli/php_cli.c:1.192Thu Jul 24 09:11:48 2008
+++ php-src/sapi/cli/php_cli.c  Fri Jul 25 15:05:33 2008
@@ -20,7 +20,7 @@
+--+
 */
 
-/* $Id: php_cli.c,v 1.192 2008/07/24 09:11:48 lbarnaud Exp $ */
+/* $Id: php_cli.c,v 1.193 2008/07/25 15:05:33 tony2001 Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -296,7 +296,7 @@
 
 static void sapi_cli_register_variables(zval *track_vars_array TSRMLS_DC) /* 
{{{ */
 {
-   size_t len;
+   unsigned int len;
char   *docroot = ;
 
/* In CGI mode, we consider the environment to be a part of the server



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



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

2008-03-25 Thread Marcus Boerger
helly   Tue Mar 25 21:58:03 2008 UTC

  Modified files:  
/php-src/sapi/cli   php_cli.c 
  Log:
  - Use sizeof rather than strlen and cleanup
  
http://cvs.php.net/viewvc.cgi/php-src/sapi/cli/php_cli.c?r1=1.187r2=1.188diff_format=u
Index: php-src/sapi/cli/php_cli.c
diff -u php-src/sapi/cli/php_cli.c:1.187 php-src/sapi/cli/php_cli.c:1.188
--- php-src/sapi/cli/php_cli.c:1.187Wed Mar 19 16:37:49 2008
+++ php-src/sapi/cli/php_cli.c  Tue Mar 25 21:58:03 2008
@@ -20,7 +20,7 @@
+--+
 */
 
-/* $Id: php_cli.c,v 1.187 2008/03/19 16:37:49 rasmus Exp $ */
+/* $Id: php_cli.c,v 1.188 2008/03/25 21:58:03 helly Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -115,13 +115,13 @@
PHP_MODE_SHOW_INI_CONFIG
 };
 
-#define HARDCODED_INI  \
-   html_errors=0\n   \
-   register_argc_argv=1\n\
-   implicit_flush=1\n\
-   output_buffering=0\n  \
-   max_execution_time=0\n\
-   max_input_time=-1\n
+const char HARDCODED_INI[] =
+   html_errors=0\n
+   register_argc_argv=1\n
+   implicit_flush=1\n
+   output_buffering=0\n
+   max_execution_time=0\n
+   max_input_time=-1\n\0;
 
 static char *php_optarg = NULL;
 static int php_optind = 1;
@@ -671,10 +671,9 @@
setmode(_fileno(stderr), O_BINARY); /* make the stdio mode 
be binary */
 #endif
 
-   ini_entries_len = strlen(HARDCODED_INI);
-   cli_sapi_module.ini_entries = malloc(ini_entries_len+2);
-   memcpy(cli_sapi_module.ini_entries, HARDCODED_INI, ini_entries_len+1);
-   cli_sapi_module.ini_entries[ini_entries_len+1] = 0;
+   ini_entries_len = sizeof(HARDCODED_INI)-2;
+   cli_sapi_module.ini_entries = malloc(sizeof(HARDCODED_INI));
+   memcpy(cli_sapi_module.ini_entries, HARDCODED_INI, 
sizeof(HARDCODED_INI));
 
while ((c = php_getopt(argc, argv, OPTIONS, php_optarg, php_optind, 
0, 2))!=-1) {
switch (c) {



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



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

2008-02-03 Thread Marcus Boerger
helly   Sun Feb  3 17:50:06 2008 UTC

  Modified files:  
/php-src/sapi/cli   php_cli.c 
  Log:
  - MFB Sync
  
http://cvs.php.net/viewvc.cgi/php-src/sapi/cli/php_cli.c?r1=1.184r2=1.185diff_format=u
Index: php-src/sapi/cli/php_cli.c
diff -u php-src/sapi/cli/php_cli.c:1.184 php-src/sapi/cli/php_cli.c:1.185
--- php-src/sapi/cli/php_cli.c:1.184Tue Jan 29 20:01:43 2008
+++ php-src/sapi/cli/php_cli.c  Sun Feb  3 17:50:06 2008
@@ -20,7 +20,7 @@
+--+
 */
 
-/* $Id: php_cli.c,v 1.184 2008/01/29 20:01:43 dmitry Exp $ */
+/* $Id: php_cli.c,v 1.185 2008/02/03 17:50:06 helly Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -168,13 +168,14 @@
{'-', 0, NULL} /* end of args */
 };
 
-static int print_module_info(zend_module_entry *module TSRMLS_DC)
+static int print_module_info(zend_module_entry *module TSRMLS_DC) /* {{{ */
 {
php_printf(%s\n, module-name);
return ZEND_HASH_APPLY_KEEP;
 }
+/* }}} */
 
-static int module_name_cmp(const void *a, const void *b TSRMLS_DC)
+static int module_name_cmp(const void *a, const void *b TSRMLS_DC) /* {{{ */
 {
Bucket *f = *((Bucket **) a);
Bucket *s = *((Bucket **) b);
@@ -182,8 +183,9 @@
return strcasecmp(((zend_module_entry *)f-pData)-name,
  ((zend_module_entry *)s-pData)-name);
 }
+/* }}} */
 
-static void print_modules(TSRMLS_D)
+static void print_modules(TSRMLS_D) /* {{{ */
 {
HashTable sorted_registry;
zend_module_entry tmp;
@@ -194,21 +196,23 @@
zend_hash_apply(sorted_registry, (apply_func_t) print_module_info 
TSRMLS_CC);
zend_hash_destroy(sorted_registry);
 }
+/* }}} */
 
-static int print_extension_info(zend_extension *ext TSRMLS_DC)
+static int print_extension_info(zend_extension *ext TSRMLS_DC) /* {{{ */
 {
php_printf(%s\n, ext-name);
return ZEND_HASH_APPLY_KEEP;
 }
+/* }}} */
 
-static int extension_name_cmp(const zend_llist_element **f,
- const 
zend_llist_element **s TSRMLS_DC)
+static int extension_name_cmp(const zend_llist_element **f, const 
zend_llist_element **s TSRMLS_DC) /* {{{ */
 {
return strcmp(((zend_extension *)(*f)-data)-name,
  ((zend_extension *)(*s)-data)-name);
 }
+/* }}} */
 
-static void print_extensions(TSRMLS_D)
+static void print_extensions(TSRMLS_D) /* {{{ */
 {
zend_llist sorted_exts;
 
@@ -218,12 +222,13 @@
zend_llist_apply(sorted_exts, (llist_apply_func_t) 
print_extension_info TSRMLS_CC);
zend_llist_destroy(sorted_exts);
 }
+/* }}} */
 
 #ifndef STDOUT_FILENO
 #define STDOUT_FILENO 1
 #endif
 
-static inline size_t sapi_cli_single_write(const char *str, uint str_length)
+static inline size_t sapi_cli_single_write(const char *str, uint str_length) 
/* {{{ */
 {
 #ifdef PHP_WRITE_STDOUT
long ret;
@@ -240,8 +245,9 @@
return ret;
 #endif
 }
+/* }}} */
 
-static int sapi_cli_ub_write(const char *str, uint str_length TSRMLS_DC)
+static int sapi_cli_ub_write(const char *str, uint str_length TSRMLS_DC) /* 
{{{ */
 {
const char *ptr = str;
uint remaining = str_length;
@@ -270,9 +276,9 @@
 
return str_length;
 }
+/* }}} */
 
-
-static void sapi_cli_flush(void *server_context)
+static void sapi_cli_flush(void *server_context) /* {{{ */
 {
/* Ignore EBADF here, it's caused by the fact that STDIN/STDOUT/STDERR 
streams
 * are/could be closed before fflush() is called.
@@ -283,11 +289,12 @@
 #endif
}
 }
+/* }}} */
 
 static char *php_self = ;
 static char *script_filename = ;
 
-static void sapi_cli_register_variables(zval *track_vars_array TSRMLS_DC)
+static void sapi_cli_register_variables(zval *track_vars_array TSRMLS_DC) /* 
{{{ */
 {
/* In CGI mode, we consider the environment to be a part of the server
 * variables
@@ -303,14 +310,15 @@
/* just make it available */
php_register_variable(DOCUMENT_ROOT, , track_vars_array TSRMLS_CC);
 }
+/* }}} */
 
-
-static void sapi_cli_log_message(char *message)
+static void sapi_cli_log_message(char *message) /* {{{ */
 {
fprintf(stderr, %s\n, message);
 }
+/* }}} */
 
-static int sapi_cli_deactivate(TSRMLS_D)
+static int sapi_cli_deactivate(TSRMLS_D) /* {{{ */
 {
fflush(stdout);
if(SG(request_info).argv0) {
@@ -319,59 +327,59 @@
}
return SUCCESS;
 }
+/* }}} */
 
-static char* sapi_cli_read_cookies(TSRMLS_D)
+static char* sapi_cli_read_cookies(TSRMLS_D) /* {{{ */
 {
return NULL;
 }
+/* }}} */
 
-static int sapi_cli_header_handler(sapi_header_struct *h, sapi_headers_struct 
*s TSRMLS_DC)
+static int sapi_cli_header_handler(sapi_header_struct *h, sapi_headers_struct 
*s TSRMLS_DC) /* {{{ */
 {
/* free allocated header line */
efree(h-header);
/* avoid pushing headers into SAPI headers list */

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

2008-01-29 Thread Dmitry Stogov
dmitry  Tue Jan 29 20:01:43 2008 UTC

  Modified files:  
/php-src/sapi/cli   php_cli.c 
  Log:
  Fixed bug #43968 (Extending internal class causes a crash)
  The fix is a workaround for GCC optizer bug.
  
  
http://cvs.php.net/viewvc.cgi/php-src/sapi/cli/php_cli.c?r1=1.183r2=1.184diff_format=u
Index: php-src/sapi/cli/php_cli.c
diff -u php-src/sapi/cli/php_cli.c:1.183 php-src/sapi/cli/php_cli.c:1.184
--- php-src/sapi/cli/php_cli.c:1.183Mon Dec 31 07:12:19 2007
+++ php-src/sapi/cli/php_cli.c  Tue Jan 29 20:01:43 2008
@@ -20,7 +20,7 @@
+--+
 */
 
-/* $Id: php_cli.c,v 1.183 2007/12/31 07:12:19 sebastian Exp $ */
+/* $Id: php_cli.c,v 1.184 2008/01/29 20:01:43 dmitry Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -590,7 +590,7 @@
 int main(int argc, char *argv[])
 #endif
 {
-   int exit_status = SUCCESS;
+   volatile int exit_status = SUCCESS;
int c;
zend_file_handle file_handle;
 /* temporary locals */
@@ -601,8 +601,8 @@
char *arg_free=NULL, **arg_excp=arg_free;
char *script_file=NULL;
int interactive=0;
-   int module_started = 0;
-   int request_started = 0;
+   volatile int module_started = 0;
+   volatile int request_started = 0;
int lineno = 0;
char *exec_direct=NULL, *exec_run=NULL, *exec_begin=NULL, 
*exec_end=NULL;
const char *param_error=NULL;
@@ -1232,8 +1232,9 @@
if (exec_end  zend_eval_string_ex(exec_end, 
NULL, Command line end code, 1 TSRMLS_CC) == FAILURE) {
exit_status=254;
}
-   
+
break;
+   }
 #ifdef HAVE_REFLECTION
case PHP_MODE_REFLECTION_FUNCTION:
case PHP_MODE_REFLECTION_CLASS:
@@ -1314,7 +1315,6 @@
zend_printf(Additional .ini files 
parsed:  %s\n, php_ini_scanned_files ? php_ini_scanned_files : (none));
break;
}
-   }
}
 
} zend_end_try();

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



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

2007-08-08 Thread Stanislav Malyshev
stasWed Aug  8 23:56:19 2007 UTC

  Modified files:  
/php-src/sapi/cli   php_cli.c 
  Log:
  remove unneeded variables
  
  
http://cvs.php.net/viewvc.cgi/php-src/sapi/cli/php_cli.c?r1=1.179r2=1.180diff_format=u
Index: php-src/sapi/cli/php_cli.c
diff -u php-src/sapi/cli/php_cli.c:1.179 php-src/sapi/cli/php_cli.c:1.180
--- php-src/sapi/cli/php_cli.c:1.179Sun May  6 12:57:27 2007
+++ php-src/sapi/cli/php_cli.c  Wed Aug  8 23:56:19 2007
@@ -20,7 +20,7 @@
+--+
 */
 
-/* $Id: php_cli.c,v 1.179 2007/05/06 12:57:27 johannes Exp $ */
+/* $Id: php_cli.c,v 1.180 2007/08/08 23:56:19 stas Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -609,10 +609,6 @@
int hide_argv = 0;
 /* end of temporary locals */
 #ifdef ZTS
-   zend_compiler_globals *compiler_globals;
-   zend_executor_globals *executor_globals;
-   php_core_globals *core_globals;
-   sapi_globals_struct *sapi_globals;
void ***tsrm_ls;
 #endif
 #ifdef PHP_CLI_WIN32_NO_CONSOLE
@@ -650,6 +646,7 @@
 
 #ifdef ZTS
tsrm_startup(1, 1, 0, NULL);
+   tsrm_ls = ts_resource(0);
 #endif
 
cli_sapi_module.ini_defaults = sapi_cli_ini_defaults;
@@ -719,14 +716,6 @@
cli_sapi_module.executable_location = argv[0];
cli_sapi_module.additional_functions = additional_functions;
 
-#ifdef ZTS
-   compiler_globals = ts_resource(compiler_globals_id);
-   executor_globals = ts_resource(executor_globals_id);
-   core_globals = ts_resource(core_globals_id);
-   sapi_globals = ts_resource(sapi_globals_id);
-   tsrm_ls = ts_resource(0);
-#endif
-
/* startup after we get the above ini override se we get things right */
if (cli_sapi_module.startup(cli_sapi_module)==FAILURE) {
/* there is no way to see if we must call zend_ini_deactivate()

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



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

2007-05-06 Thread Johannes Schl
johannesSun May  6 12:57:28 2007 UTC

  Modified files:  
/php-src/sapi/cli   php_cli.c 
  Log:
  - Fix build without reflection
  # reflection_what is used fby --ri, too
  
  
http://cvs.php.net/viewvc.cgi/php-src/sapi/cli/php_cli.c?r1=1.178r2=1.179diff_format=u
Index: php-src/sapi/cli/php_cli.c
diff -u php-src/sapi/cli/php_cli.c:1.178 php-src/sapi/cli/php_cli.c:1.179
--- php-src/sapi/cli/php_cli.c:1.178Sat May  5 12:46:30 2007
+++ php-src/sapi/cli/php_cli.c  Sun May  6 12:57:27 2007
@@ -20,7 +20,7 @@
+--+
 */
 
-/* $Id: php_cli.c,v 1.178 2007/05/05 12:46:30 helly Exp $ */
+/* $Id: php_cli.c,v 1.179 2007/05/06 12:57:27 johannes Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -595,9 +595,7 @@
zend_file_handle file_handle;
 /* temporary locals */
enum behavior_mode behavior = PHP_MODE_STANDARD;
-#ifdef HAVE_REFLECTION
char *reflection_what = NULL;
-#endif
int orig_optind=php_optind;
char *orig_optarg=php_optarg;
char *arg_free=NULL, **arg_excp=arg_free;

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



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

2007-05-05 Thread Marcus Boerger
helly   Sat May  5 12:09:21 2007 UTC

  Modified files:  
/php-src/sapi/cli   php_cli.c 
  Log:
  - Simplify/use consts
  
http://cvs.php.net/viewvc.cgi/php-src/sapi/cli/php_cli.c?r1=1.176r2=1.177diff_format=u
Index: php-src/sapi/cli/php_cli.c
diff -u php-src/sapi/cli/php_cli.c:1.176 php-src/sapi/cli/php_cli.c:1.177
--- php-src/sapi/cli/php_cli.c:1.176Fri May  4 22:09:30 2007
+++ php-src/sapi/cli/php_cli.c  Sat May  5 12:09:21 2007
@@ -20,7 +20,7 @@
+--+
 */
 
-/* $Id: php_cli.c,v 1.176 2007/05/04 22:09:30 helly Exp $ */
+/* $Id: php_cli.c,v 1.177 2007/05/05 12:09:21 helly Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -168,10 +168,10 @@
{'-', 0, NULL} /* end of args */
 };
 
-static int print_module_info(zend_module_entry *module, void *arg TSRMLS_DC)
+static int print_module_info(zend_module_entry *module TSRMLS_DC)
 {
php_printf(%s\n, module-name);
-   return 0;
+   return ZEND_HASH_APPLY_KEEP;
 }
 
 static int module_name_cmp(const void *a, const void *b TSRMLS_DC)
@@ -191,14 +191,14 @@
zend_hash_init(sorted_registry, 50, NULL, NULL, 1);
zend_hash_copy(sorted_registry, module_registry, NULL, tmp, 
sizeof(zend_module_entry));
zend_hash_sort(sorted_registry, zend_qsort, module_name_cmp, 0 
TSRMLS_CC);
-   zend_hash_apply_with_argument(sorted_registry, (apply_func_arg_t) 
print_module_info, NULL TSRMLS_CC);
+   zend_hash_apply(sorted_registry, (apply_func_t) print_module_info 
TSRMLS_CC);
zend_hash_destroy(sorted_registry);
 }
 
 static int print_extension_info(zend_extension *ext, void *arg TSRMLS_DC)
 {
php_printf(%s\n, ext-name);
-   return 0;
+   return ZEND_HASH_APPLY_KEEP;
 }
 
 static int extension_name_cmp(const zend_llist_element **f,
@@ -215,7 +215,7 @@
zend_llist_copy(sorted_exts, zend_extensions);
sorted_exts.dtor = NULL;
zend_llist_sort(sorted_exts, extension_name_cmp TSRMLS_CC);
-   zend_llist_apply_with_argument(sorted_exts, 
(llist_apply_with_arg_func_t) print_extension_info, NULL TSRMLS_CC);
+   zend_llist_apply(sorted_exts, (llist_apply_func_t) 
print_extension_info TSRMLS_CC);
zend_llist_destroy(sorted_exts);
 }
 

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



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

2007-05-05 Thread Marcus Boerger
helly   Sat May  5 12:46:30 2007 UTC

  Modified files:  
/php-src/sapi/cli   php_cli.c 
  Log:
  - Fix function signature
  
http://cvs.php.net/viewvc.cgi/php-src/sapi/cli/php_cli.c?r1=1.177r2=1.178diff_format=u
Index: php-src/sapi/cli/php_cli.c
diff -u php-src/sapi/cli/php_cli.c:1.177 php-src/sapi/cli/php_cli.c:1.178
--- php-src/sapi/cli/php_cli.c:1.177Sat May  5 12:09:21 2007
+++ php-src/sapi/cli/php_cli.c  Sat May  5 12:46:30 2007
@@ -20,7 +20,7 @@
+--+
 */
 
-/* $Id: php_cli.c,v 1.177 2007/05/05 12:09:21 helly Exp $ */
+/* $Id: php_cli.c,v 1.178 2007/05/05 12:46:30 helly Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -195,7 +195,7 @@
zend_hash_destroy(sorted_registry);
 }
 
-static int print_extension_info(zend_extension *ext, void *arg TSRMLS_DC)
+static int print_extension_info(zend_extension *ext TSRMLS_DC)
 {
php_printf(%s\n, ext-name);
return ZEND_HASH_APPLY_KEEP;

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



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

2007-05-04 Thread Marcus Boerger
helly   Fri May  4 22:09:31 2007 UTC

  Modified files:  
/php-src/sapi/cli   php_cli.c 
  Log:
  - WS/CS
  
http://cvs.php.net/viewvc.cgi/php-src/sapi/cli/php_cli.c?r1=1.175r2=1.176diff_format=u
Index: php-src/sapi/cli/php_cli.c
diff -u php-src/sapi/cli/php_cli.c:1.175 php-src/sapi/cli/php_cli.c:1.176
--- php-src/sapi/cli/php_cli.c:1.175Wed Apr 25 09:53:20 2007
+++ php-src/sapi/cli/php_cli.c  Fri May  4 22:09:30 2007
@@ -20,7 +20,7 @@
+--+
 */
 
-/* $Id: php_cli.c,v 1.175 2007/04/25 09:53:20 bjori Exp $ */
+/* $Id: php_cli.c,v 1.176 2007/05/04 22:09:30 helly Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -1306,7 +1306,7 @@
zend_module_entry *module;
 
if (zend_hash_find(module_registry, 
lcname, len+1, (void**)module) == FAILURE) {
-   if(!strcmp(reflection_what, 
main)) {
+   if (!strcmp(reflection_what, 
main)) {

display_ini_entries(NULL);
} else {
zend_printf(Extension 
'%s' not present.\n, reflection_what);

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



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

2007-04-25 Thread Hannes Magnusson
bjori   Wed Apr 25 09:53:20 2007 UTC

  Modified files:  
/php-src/sapi/cli   php_cli.c 
  Log:
  rename --ri core to --ri main
  # the man has spoken
  
  
http://cvs.php.net/viewvc.cgi/php-src/sapi/cli/php_cli.c?r1=1.174r2=1.175diff_format=u
Index: php-src/sapi/cli/php_cli.c
diff -u php-src/sapi/cli/php_cli.c:1.174 php-src/sapi/cli/php_cli.c:1.175
--- php-src/sapi/cli/php_cli.c:1.174Mon Apr 23 21:24:54 2007
+++ php-src/sapi/cli/php_cli.c  Wed Apr 25 09:53:20 2007
@@ -20,7 +20,7 @@
+--+
 */
 
-/* $Id: php_cli.c,v 1.174 2007/04/23 21:24:54 bjori Exp $ */
+/* $Id: php_cli.c,v 1.175 2007/04/25 09:53:20 bjori Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -1306,7 +1306,7 @@
zend_module_entry *module;
 
if (zend_hash_find(module_registry, 
lcname, len+1, (void**)module) == FAILURE) {
-   if(!strcmp(reflection_what, 
core)) {
+   if(!strcmp(reflection_what, 
main)) {

display_ini_entries(NULL);
} else {
zend_printf(Extension 
'%s' not present.\n, reflection_what);

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



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

2007-04-17 Thread Jani Taskinen
sniper  Tue Apr 17 19:48:16 2007 UTC

  Modified files:  
/php-src/sapi/cli   php_cli.c 
  Log:
  MFB
  
http://cvs.php.net/viewvc.cgi/php-src/sapi/cli/php_cli.c?r1=1.170r2=1.171diff_format=u
Index: php-src/sapi/cli/php_cli.c
diff -u php-src/sapi/cli/php_cli.c:1.170 php-src/sapi/cli/php_cli.c:1.171
--- php-src/sapi/cli/php_cli.c:1.170Thu Feb 22 10:06:02 2007
+++ php-src/sapi/cli/php_cli.c  Tue Apr 17 19:48:16 2007
@@ -20,7 +20,7 @@
+--+
 */
 
-/* $Id: php_cli.c,v 1.170 2007/02/22 10:06:02 tony2001 Exp $ */
+/* $Id: php_cli.c,v 1.171 2007/04/17 19:48:16 sniper Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -663,7 +663,10 @@
while ((c = php_getopt(argc, argv, OPTIONS, php_optarg, php_optind, 
0))!=-1) {
switch (c) {
case 'c':
-   cli_sapi_module.php_ini_path_override = 
strdup(php_optarg);
+   if (cli_sapi_module.php_ini_path_override) {
+   
free(cli_sapi_module.php_ini_path_override);
+   }
+   cli_sapi_module.php_ini_path_override = 
strdup(php_optarg);
break;
case 'n':
cli_sapi_module.php_ini_ignore = 1;

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



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

2007-02-22 Thread Antony Dovgal
tony2001Thu Feb 22 10:06:02 2007 UTC

  Modified files:  
/php-src/sapi/cli   php_cli.c 
  Log:
  check for NULL, then add flag
  
  
http://cvs.php.net/viewvc.cgi/php-src/sapi/cli/php_cli.c?r1=1.169r2=1.170diff_format=u
Index: php-src/sapi/cli/php_cli.c
diff -u php-src/sapi/cli/php_cli.c:1.169 php-src/sapi/cli/php_cli.c:1.170
--- php-src/sapi/cli/php_cli.c:1.169Wed Feb 21 21:56:45 2007
+++ php-src/sapi/cli/php_cli.c  Thu Feb 22 10:06:02 2007
@@ -20,7 +20,7 @@
+--+
 */
 
-/* $Id: php_cli.c,v 1.169 2007/02/21 21:56:45 tony2001 Exp $ */
+/* $Id: php_cli.c,v 1.170 2007/02/22 10:06:02 tony2001 Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -487,12 +487,6 @@
s_out = php_stream_open_wrapper_ex(php://stdout, wb, 0, NULL, 
sc_out);
s_err = php_stream_open_wrapper_ex(php://stderr, wb, 0, NULL, 
sc_err);
 
-#if PHP_DEBUG
-   /* do not close stdout and stderr */
-   s_out-flags |= PHP_STREAM_FLAG_NO_CLOSE;
-   s_err-flags |= PHP_STREAM_FLAG_NO_CLOSE;
-#endif
-
if (s_in==NULL || s_out==NULL || s_err==NULL) {
FREE_ZVAL(zin);
FREE_ZVAL(zout);
@@ -502,7 +496,13 @@
if (s_err) php_stream_close(s_err);
return;
}
-   
+
+#if PHP_DEBUG
+   /* do not close stdout and stderr */
+   s_out-flags |= PHP_STREAM_FLAG_NO_CLOSE;
+   s_err-flags |= PHP_STREAM_FLAG_NO_CLOSE;
+#endif
+
s_in_process = s_in;
 
php_stream_to_zval(s_in,  zin);

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



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

2006-11-24 Thread Antony Dovgal
tony2001Fri Nov 24 11:54:48 2006 UTC

  Modified files:  
/php-src/sapi/cli   php_cli.c 
  Log:
  call sapi_deactivate()  friends on error 
  fixes leak with `php-cli -n -c ..`
  
  
http://cvs.php.net/viewvc.cgi/php-src/sapi/cli/php_cli.c?r1=1.163r2=1.164diff_format=u
Index: php-src/sapi/cli/php_cli.c
diff -u php-src/sapi/cli/php_cli.c:1.163 php-src/sapi/cli/php_cli.c:1.164
--- php-src/sapi/cli/php_cli.c:1.163Fri Sep 22 17:42:08 2006
+++ php-src/sapi/cli/php_cli.c  Fri Nov 24 11:54:48 2006
@@ -20,7 +20,7 @@
+--+
 */
 
-/* $Id: php_cli.c,v 1.163 2006/09/22 17:42:08 iliaa Exp $ */
+/* $Id: php_cli.c,v 1.164 2006/11/24 11:54:48 tony2001 Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -718,7 +718,7 @@
if (cli_sapi_module.php_ini_path_override  
cli_sapi_module.php_ini_ignore) {
PUTS(You cannot use both -n and -c switch. Use -h for 
help.\n);
exit_status=1;
-   goto out_err;
+   goto err;
}
 
while ((c = php_getopt(argc, argv, OPTIONS, php_optarg, 
php_optind, 0)) != -1) {

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



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

2006-09-15 Thread Antony Dovgal
tony2001Fri Sep 15 08:18:10 2006 UTC

  Modified files:  
/php-src/sapi/cli   php_cli.c 
  Log:
  fix leaks with `php -d option=value -c /path -h`
  
  
http://cvs.php.net/viewvc.cgi/php-src/sapi/cli/php_cli.c?r1=1.161r2=1.162diff_format=u
Index: php-src/sapi/cli/php_cli.c
diff -u php-src/sapi/cli/php_cli.c:1.161 php-src/sapi/cli/php_cli.c:1.162
--- php-src/sapi/cli/php_cli.c:1.161Tue Aug 22 12:05:10 2006
+++ php-src/sapi/cli/php_cli.c  Fri Sep 15 08:18:10 2006
@@ -20,7 +20,7 @@
+--+
 */
 
-/* $Id: php_cli.c,v 1.161 2006/08/22 12:05:10 dmitry Exp $ */
+/* $Id: php_cli.c,v 1.162 2006/09/15 08:18:10 tony2001 Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -628,6 +628,7 @@
 #endif
 
cli_sapi_module.ini_defaults = sapi_cli_ini_defaults;
+   cli_sapi_module.php_ini_path_override = NULL;
cli_sapi_module.phpinfo_as_text = 1;
sapi_startup(cli_sapi_module);
 
@@ -1248,12 +1249,6 @@
}
}
 
-   if (cli_sapi_module.php_ini_path_override) {
-   free(cli_sapi_module.php_ini_path_override);
-   }
-   if (cli_sapi_module.ini_entries) {
-   free(cli_sapi_module.ini_entries);
-   }
} zend_end_try();
 
 out:
@@ -1264,6 +1259,13 @@
exit_status = EG(exit_status);
}
 out_err:   
+   if (cli_sapi_module.php_ini_path_override) {
+   free(cli_sapi_module.php_ini_path_override);
+   }
+   if (cli_sapi_module.ini_entries) {
+   free(cli_sapi_module.ini_entries);
+   }
+
if (module_started) {
php_module_shutdown(TSRMLS_C);
}

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



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

2006-08-22 Thread Dmitry Stogov
dmitry  Tue Aug 22 12:05:10 2006 UTC

  Modified files:  
/php-src/sapi/cli   php_cli.c 
  Log:
  Fixed bug #38543 (shutdown_executor() may segfault when memory_limit is too 
low).
  
  
http://cvs.php.net/viewvc.cgi/php-src/sapi/cli/php_cli.c?r1=1.160r2=1.161diff_format=u
Index: php-src/sapi/cli/php_cli.c
diff -u php-src/sapi/cli/php_cli.c:1.160 php-src/sapi/cli/php_cli.c:1.161
--- php-src/sapi/cli/php_cli.c:1.160Tue Jun 27 08:26:54 2006
+++ php-src/sapi/cli/php_cli.c  Tue Aug 22 12:05:10 2006
@@ -20,7 +20,7 @@
+--+
 */
 
-/* $Id: php_cli.c,v 1.160 2006/06/27 08:26:54 tony2001 Exp $ */
+/* $Id: php_cli.c,v 1.161 2006/08/22 12:05:10 dmitry Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -577,6 +577,7 @@
char *script_file=NULL;
int interactive=0;
int module_started = 0;
+   int request_started = 0;
int lineno = 0;
char *exec_direct=NULL, *exec_run=NULL, *exec_begin=NULL, 
*exec_end=NULL;
const char *param_error=NULL;
@@ -713,6 +714,7 @@
if (php_request_startup(TSRMLS_C)==FAILURE) {
goto err;
}
+   request_started = 1;
php_cli_usage(argv[0]);
php_output_end_all(TSRMLS_C);
exit_status=0;
@@ -722,6 +724,7 @@
if (php_request_startup(TSRMLS_C)==FAILURE) {
goto err;
}
+   request_started = 1;
php_print_info(0x TSRMLS_CC);
php_output_end_all(TSRMLS_C);
exit_status=0;
@@ -731,6 +734,7 @@
if (php_request_startup(TSRMLS_C)==FAILURE) {
goto err;
}
+   request_started = 1;
php_printf([PHP Modules]\n);
print_modules(TSRMLS_C);
php_printf(\n[Zend Modules]\n);
@@ -745,6 +749,7 @@
goto err;
}
 
+   request_started = 1;
php_printf(PHP %s (%s) (built: %s %s) 
%s\nCopyright (c) 1997-2006 The PHP Group\n%s,
PHP_VERSION, sapi_module.name, 
__DATE__, __TIME__,
 #if ZEND_DEBUG  defined(HAVE_GCOV)
@@ -995,10 +1000,10 @@
if (php_request_startup(TSRMLS_C)==FAILURE) {
*arg_excp = arg_free;
fclose(file_handle.handle.fp);
-   php_request_shutdown((void *) 0);
PUTS(Could not startup.\n);
goto err;
}
+   request_started = 1;
CG(start_lineno) = lineno;
*arg_excp = arg_free; /* reconstuct argv */
 
@@ -1252,7 +1257,9 @@
} zend_end_try();
 
 out:
-   php_request_shutdown((void *) 0);
+   if (request_started) {
+   php_request_shutdown((void *) 0);
+   }
if (exit_status == 0) {
exit_status = EG(exit_status);
}

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



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

2006-06-20 Thread Antony Dovgal
tony2001Tue Jun 20 13:01:08 2006 UTC

  Modified files:  
/php-src/sapi/cli   php_cli.c 
  Log:
  initialize pointers
  
  
http://cvs.php.net/viewvc.cgi/php-src/sapi/cli/php_cli.c?r1=1.157r2=1.158diff_format=u
Index: php-src/sapi/cli/php_cli.c
diff -u php-src/sapi/cli/php_cli.c:1.157 php-src/sapi/cli/php_cli.c:1.158
--- php-src/sapi/cli/php_cli.c:1.157Mon Jun 19 14:53:03 2006
+++ php-src/sapi/cli/php_cli.c  Tue Jun 20 13:01:08 2006
@@ -20,7 +20,7 @@
+--+
 */
 
-/* $Id: php_cli.c,v 1.157 2006/06/19 14:53:03 mike Exp $ */
+/* $Id: php_cli.c,v 1.158 2006/06/20 13:01:08 tony2001 Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -563,7 +563,7 @@
 /* temporary locals */
int behavior=PHP_MODE_STANDARD;
 #ifdef HAVE_REFLECTION
-   char *reflection_what;
+   char *reflection_what = NULL;
 #endif
int orig_optind=php_optind;
char *orig_optarg=php_optarg;
@@ -1189,7 +1189,7 @@
case PHP_MODE_REFLECTION_CLASS:
case PHP_MODE_REFLECTION_EXTENSION:
{
-   zend_class_entry *pce;
+   zend_class_entry *pce = NULL;
zval *arg, *ref;
zend_execute_data execute_data;
 

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



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

2006-06-19 Thread Michael Wallner
mikeMon Jun 19 14:53:03 2006 UTC

  Modified files:  
/php-src/sapi/cli   php_cli.c 
  Log:
  MFB52: Fix Bug #37780 memory leak trying to execute a non existing file (CLI)
  
  
http://cvs.php.net/viewvc.cgi/php-src/sapi/cli/php_cli.c?r1=1.156r2=1.157diff_format=u
Index: php-src/sapi/cli/php_cli.c
diff -u php-src/sapi/cli/php_cli.c:1.156 php-src/sapi/cli/php_cli.c:1.157
--- php-src/sapi/cli/php_cli.c:1.156Sat Jun  3 22:00:30 2006
+++ php-src/sapi/cli/php_cli.c  Mon Jun 19 14:53:03 2006
@@ -20,7 +20,7 @@
+--+
 */
 
-/* $Id: php_cli.c,v 1.156 2006/06/03 22:00:30 johannes Exp $ */
+/* $Id: php_cli.c,v 1.157 2006/06/19 14:53:03 mike Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -313,6 +313,14 @@
return NULL;
 }
 
+static int sapi_cli_header_handler(sapi_header_struct *h, sapi_headers_struct 
*s TSRMLS_DC)
+{
+   /* free allocated header line */
+   efree(h-header);
+   /* avoid pushing headers into SAPI headers list */
+   return 0;
+}
+
 static int sapi_cli_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
 {
/* We do nothing here, this function is needed to prevent that the 
fallback
@@ -374,7 +382,7 @@
 
php_error,  /* error 
handler */
 
-   NULL,   /* header 
handler */
+   sapi_cli_header_handler,/* header handler */
sapi_cli_send_headers,  /* send headers handler */
sapi_cli_send_header,   /* send header handler */
 
@@ -1254,6 +1262,7 @@
return exit_status;
 
 err:
+   sapi_deactivate(TSRMLS_C);
zend_ini_deactivate(TSRMLS_C);
exit_status = 1;
goto out_err;

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



Re: [PHP-CVS] cvs: php-src /sapi/cli php_cli.c

2006-06-19 Thread Andrei Zmievski

Why can't you have a NULL header function?

-Andrei

On Jun 19, 2006, at 7:53 AM, Michael Wallner wrote:


mikeMon Jun 19 14:53:03 2006 UTC

  Modified files:
/php-src/sapi/cli   php_cli.c
  Log:
  MFB52: Fix Bug #37780 memory leak trying to execute a non existing  
file (CLI)



http://cvs.php.net/viewvc.cgi/php-src/sapi/cli/php_cli.c? 
r1=1.156r2=1.157diff_format=u

Index: php-src/sapi/cli/php_cli.c
diff -u php-src/sapi/cli/php_cli.c:1.156  
php-src/sapi/cli/php_cli.c:1.157

--- php-src/sapi/cli/php_cli.c:1.156Sat Jun  3 22:00:30 2006
+++ php-src/sapi/cli/php_cli.c  Mon Jun 19 14:53:03 2006
@@ -20,7 +20,7 @@
 
+-- 
+

 */

-/* $Id: php_cli.c,v 1.156 2006/06/03 22:00:30 johannes Exp $ */
+/* $Id: php_cli.c,v 1.157 2006/06/19 14:53:03 mike Exp $ */

 #include php.h
 #include php_globals.h
@@ -313,6 +313,14 @@
return NULL;
 }

+static int sapi_cli_header_handler(sapi_header_struct *h,  
sapi_headers_struct *s TSRMLS_DC)

+{
+   /* free allocated header line */
+   efree(h-header);
+   /* avoid pushing headers into SAPI headers list */
+   return 0;
+}
+
 static int sapi_cli_send_headers(sapi_headers_struct *sapi_headers  
TSRMLS_DC)

 {
 	/* We do nothing here, this function is needed to prevent that the  
fallback

@@ -374,7 +382,7 @@

php_error,  /* error 
handler */

-   NULL,   /* header 
handler */
+   sapi_cli_header_handler,/* header handler */
sapi_cli_send_headers,  /* send headers handler */
sapi_cli_send_header,   /* send header handler */

@@ -1254,6 +1262,7 @@
return exit_status;

 err:
+   sapi_deactivate(TSRMLS_C);
zend_ini_deactivate(TSRMLS_C);
exit_status = 1;
goto out_err;

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


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



Re: [PHP-CVS] cvs: php-src /sapi/cli php_cli.c

2006-06-19 Thread Michael Wallner

Andrei Zmievski wrote:

Why can't you have a NULL header function?



You can, but it just seemed like a waste of memory to maintain
a list of headers to send for the CLI SAPI.


On Jun 19, 2006, at 7:53 AM, Michael Wallner wrote:


mikeMon Jun 19 14:53:03 2006 UTC

  Modified files:
/php-src/sapi/cliphp_cli.c
  Log:
  MFB52: Fix Bug #37780 memory leak trying to execute a non existing 
file (CLI)


Regards,
--
Michael

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



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

2006-02-21 Thread Johannes Schl
johannesTue Feb 21 21:14:36 2006 UTC

  Modified files:  
/php-src/sapi/cli   php_cli.c 
  Log:
  - List --rf/--rc/--re only with enabled reflection
  
http://cvs.php.net/viewcvs.cgi/php-src/sapi/cli/php_cli.c?r1=1.146r2=1.147diff_format=u
Index: php-src/sapi/cli/php_cli.c
diff -u php-src/sapi/cli/php_cli.c:1.146 php-src/sapi/cli/php_cli.c:1.147
--- php-src/sapi/cli/php_cli.c:1.146Tue Feb 21 20:12:43 2006
+++ php-src/sapi/cli/php_cli.c  Tue Feb 21 21:14:36 2006
@@ -20,7 +20,7 @@
+--+
 */
 
-/* $Id: php_cli.c,v 1.146 2006/02/21 20:12:43 dmitry Exp $ */
+/* $Id: php_cli.c,v 1.147 2006/02/21 21:14:36 johannes Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -438,10 +438,12 @@
  args...  Arguments passed to script. 
Use -- args when first argument\n
   starts with - or script is 
read from stdin\n
\n
+#if (HAVE_REFLECTION)
  --rf name  Show information about 
function name.\n
  --rc name  Show information about 
class name.\n
  --re name  Show information about 
extension name.\n
\n
+#endif
, prog, prog, prog, prog, prog, prog);
 }
 /* }}} */

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



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

2006-01-07 Thread Marcus Boerger
helly   Sat Jan  7 16:46:30 2006 UTC

  Modified files:  
/php-src/sapi/cli   php_cli.c 
  Log:
  - Show whether this is the shell or just the starnge mode
  
http://cvs.php.net/viewcvs.cgi/php-src/sapi/cli/php_cli.c?r1=1.143r2=1.144diff_format=u
Index: php-src/sapi/cli/php_cli.c
diff -u php-src/sapi/cli/php_cli.c:1.143 php-src/sapi/cli/php_cli.c:1.144
--- php-src/sapi/cli/php_cli.c:1.143Sun Jan  1 13:09:58 2006
+++ php-src/sapi/cli/php_cli.c  Sat Jan  7 16:46:30 2006
@@ -20,7 +20,7 @@
+--+
 */
 
-/* $Id: php_cli.c,v 1.143 2006/01/01 13:09:58 sniper Exp $ */
+/* $Id: php_cli.c,v 1.144 2006/01/07 16:46:30 helly Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -783,7 +783,11 @@
 
case 'a':   /* interactive mode */
if (!interactive) {
+#if (HAVE_LIBREADLINE || HAVE_LIBEDIT)  !defined(COMPILE_DL_READLINE)
+   printf(Interactive shell\n\n);
+#else
printf(Interactive mode enabled\n\n);
+#endif
fflush(stdout);
interactive=1;
}

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



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

2005-12-10 Thread Marcus Boerger
helly   Sat Dec 10 08:43:56 2005 EDT

  Modified files:  
/php-src/sapi/cli   php_cli.c 
  Log:
  - Rewrite --r* and add --rfunction
  
  
http://cvs.php.net/diff.php/php-src/sapi/cli/php_cli.c?r1=1.139r2=1.140ty=u
Index: php-src/sapi/cli/php_cli.c
diff -u php-src/sapi/cli/php_cli.c:1.139 php-src/sapi/cli/php_cli.c:1.140
--- php-src/sapi/cli/php_cli.c:1.139Mon Dec  5 20:08:40 2005
+++ php-src/sapi/cli/php_cli.c  Sat Dec 10 08:43:51 2005
@@ -20,7 +20,7 @@
+--+
 */
 
-/* $Id: php_cli.c,v 1.139 2005/12/06 01:08:40 sniper Exp $ */
+/* $Id: php_cli.c,v 1.140 2005/12/10 13:43:51 helly Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -87,6 +87,7 @@
 #include zend_execute.h
 #include zend_highlight.h
 #include zend_indent.h
+#include zend_exceptions.h
 
 #include php_getopt.h
 
@@ -101,8 +102,9 @@
 #define PHP_MODE_STRIP 5
 #define PHP_MODE_CLI_DIRECT6
 #define PHP_MODE_PROCESS_STDIN 7
-#define PHP_MODE_REFLECTION_CLASS   8
-#define PHP_MODE_REFLECTION_EXTENSION   9
+#define PHP_MODE_REFLECTION_FUNCTION8
+#define PHP_MODE_REFLECTION_CLASS   9
+#define PHP_MODE_REFLECTION_EXTENSION   10
 
 static char *php_optarg = NULL;
 static int php_optind = 1;
@@ -137,8 +139,9 @@
{'v', 0, version},
{'z', 1, zend-extension},
 #ifdef HAVE_REFLECTION
-   {10,  1, rclass},
-   {11,  1, rextension},
+   {10,  1, rfunction},
+   {11,  1, rclass},
+   {12,  1, rextension},
 #endif
{'-', 0, NULL} /* end of args */
 };
@@ -922,10 +925,14 @@
 
 #ifdef HAVE_REFLECTION
case 10:
-   behavior=PHP_MODE_REFLECTION_CLASS;
+   behavior=PHP_MODE_REFLECTION_FUNCTION;
reflection_what = php_optarg;
break;
case 11:
+   behavior=PHP_MODE_REFLECTION_CLASS;
+   reflection_what = php_optarg;
+   break;
+   case 12:
behavior=PHP_MODE_REFLECTION_EXTENSION;
reflection_what = php_optarg;
break;
@@ -1164,53 +1171,47 @@

break;
 #ifdef HAVE_REFLECTION
+   case PHP_MODE_REFLECTION_FUNCTION:
case PHP_MODE_REFLECTION_CLASS:
case PHP_MODE_REFLECTION_EXTENSION:
{
-   zend_class_entry *reflection_ce;
-   zval *arg;
-   
-   if (behavior == 
PHP_MODE_REFLECTION_CLASS) {
-   zend_class_entry **ppce;
-
-   if 
(zend_lookup_class(reflection_what, strlen(reflection_what), ppce TSRMLS_CC) 
== FAILURE) {
-   zend_printf(Class %s 
not found\n, reflection_what);
-   exit_status=254;
-
+   zend_class_entry *pce;
+   zval *arg, *ref;
+   zend_execute_data execute_data;
+
+   switch (behavior) {
+   case 
PHP_MODE_REFLECTION_FUNCTION:
+   pce = 
reflection_function_ptr;
break;
-   }
-
-   reflection_ce = 
reflection_class_ptr;
-   } else if (behavior == 
PHP_MODE_REFLECTION_EXTENSION) {
-   char *lcname = 
do_alloca(strlen(reflection_what) + 1);
-   struct _zend_module_entry 
*module;
-
-   zend_str_tolower_copy(lcname, 
reflection_what, strlen(reflection_what));
-   if 
(zend_hash_find(module_registry, lcname,  strlen(reflection_what) + 1, (void 
**)module) == FAILURE) {
-   zend_printf(Extension 
%s not found\n, reflection_what);
-
-   free_alloca(lcname);
-
-   exit_status=254;
+   case PHP_MODE_REFLECTION_CLASS:
+   pce = 
reflection_class_ptr;
+   break;
+ 

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

2005-12-10 Thread Marcus Boerger
helly   Sat Dec 10 21:40:52 2005 EDT

  Modified files:  
/php-src/sapi/cli   php_cli.c 
  Log:
  - Add method support to --rfunction
  
http://cvs.php.net/diff.php/php-src/sapi/cli/php_cli.c?r1=1.141r2=1.142ty=u
Index: php-src/sapi/cli/php_cli.c
diff -u php-src/sapi/cli/php_cli.c:1.141 php-src/sapi/cli/php_cli.c:1.142
--- php-src/sapi/cli/php_cli.c:1.141Sat Dec 10 21:16:24 2005
+++ php-src/sapi/cli/php_cli.c  Sat Dec 10 21:40:49 2005
@@ -20,7 +20,7 @@
+--+
 */
 
-/* $Id: php_cli.c,v 1.141 2005/12/11 02:16:24 helly Exp $ */
+/* $Id: php_cli.c,v 1.142 2005/12/11 02:40:49 helly Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -1188,7 +1188,11 @@
 
switch (behavior) {
case 
PHP_MODE_REFLECTION_FUNCTION:
-   pce = 
reflection_function_ptr;
+   if 
(strstr(reflection_what, ::)) {
+   pce = 
reflection_method_ptr;
+   } else {
+   pce = 
reflection_function_ptr;
+   }
break;
case PHP_MODE_REFLECTION_CLASS:
pce = 
reflection_class_ptr;

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



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

2005-12-05 Thread Jani Taskinen
sniper  Mon Dec  5 20:08:42 2005 EDT

  Modified files:  
/php-src/sapi/cli   php_cli.c 
  Log:
  nuke php3 legacy
  
http://cvs.php.net/diff.php/php-src/sapi/cli/php_cli.c?r1=1.138r2=1.139ty=u
Index: php-src/sapi/cli/php_cli.c
diff -u php-src/sapi/cli/php_cli.c:1.138 php-src/sapi/cli/php_cli.c:1.139
--- php-src/sapi/cli/php_cli.c:1.138Thu Nov 17 18:20:39 2005
+++ php-src/sapi/cli/php_cli.c  Mon Dec  5 20:08:40 2005
@@ -20,7 +20,7 @@
+--+
 */
 
-/* $Id: php_cli.c,v 1.138 2005/11/17 23:20:39 helly Exp $ */
+/* $Id: php_cli.c,v 1.139 2005/12/06 01:08:40 sniper Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -1117,7 +1117,7 @@
{
char *input;
size_t len, index = 0;
-   pval *argn, *argi;
+   zval *argn, *argi;
 
cli_register_file_handles(TSRMLS_C);

@@ -1128,7 +1128,7 @@
Z_TYPE_P(argi) = IS_LONG;
Z_LVAL_P(argi) = index;
INIT_PZVAL(argi);
-   zend_hash_update(EG(symbol_table), argi, 
sizeof(argi), argi, sizeof(pval *), NULL);
+   zend_hash_update(EG(symbol_table), argi, 
sizeof(argi), argi, sizeof(zval *), NULL);
while (exit_status == SUCCESS  
(input=php_stream_gets(s_in_process, NULL, 0)) != NULL) {
len = strlen(input);
while (len--  (input[len]=='\n' || 
input[len]=='\r')) {
@@ -1139,7 +1139,7 @@
Z_STRLEN_P(argn) = ++len;
Z_STRVAL_P(argn) = estrndup(input, len);
INIT_PZVAL(argn);
-   zend_hash_update(EG(symbol_table), 
argn, sizeof(argn), argn, sizeof(pval *), NULL);
+   zend_hash_update(EG(symbol_table), 
argn, sizeof(argn), argn, sizeof(zval *), NULL);
Z_LVAL_P(argi) = ++index;
if (exec_run) {
if 
(zend_eval_string_ex(exec_run, NULL, Command line run code, 1 TSRMLS_CC) == 
FAILURE) {

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



[PHP-CVS] cvs: php-src /sapi/cli php_cli.c php_cli_readline.c

2005-11-17 Thread Jani Taskinen
sniper  Thu Nov 17 03:36:14 2005 EDT

  Modified files:  
/php-src/sapi/cli   php_cli.c php_cli_readline.c 
  Log:
  - Fix compile failure when ext/readline is compiled as shared
  
http://cvs.php.net/diff.php/php-src/sapi/cli/php_cli.c?r1=1.136r2=1.137ty=u
Index: php-src/sapi/cli/php_cli.c
diff -u php-src/sapi/cli/php_cli.c:1.136 php-src/sapi/cli/php_cli.c:1.137
--- php-src/sapi/cli/php_cli.c:1.136Tue Nov 15 10:30:41 2005
+++ php-src/sapi/cli/php_cli.c  Thu Nov 17 03:36:11 2005
@@ -20,7 +20,7 @@
+--+
 */
 
-/* $Id: php_cli.c,v 1.136 2005/11/15 15:30:41 iliaa Exp $ */
+/* $Id: php_cli.c,v 1.137 2005/11/17 08:36:11 sniper Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -72,11 +72,12 @@
 #include unixlib/local.h
 #endif
 
-#if HAVE_LIBREADLINE || HAVE_LIBEDIT
+#if (HAVE_LIBREADLINE || HAVE_LIBEDIT)  !defined(COMPILE_DL_READLINE)
 #include readline/readline.h
 #if !HAVE_LIBEDIT
 #include readline/history.h
 #endif
+#include php_cli_readline.h
 #endif /* HAVE_LIBREADLINE || HAVE_LIBEDIT */
 
 #include zend_compile.h
@@ -84,9 +85,7 @@
 #include zend_highlight.h
 #include zend_indent.h
 
-
 #include php_getopt.h
-#include php_cli_readline.h
 
 #ifndef O_BINARY
 #define O_BINARY 0
@@ -104,7 +103,7 @@
 
 static char *php_optarg = NULL;
 static int php_optind = 1;
-#if HAVE_LIBREADLINE || HAVE_LIBEDIT
+#if (HAVE_LIBREADLINE || HAVE_LIBEDIT)  !defined(COMPILE_DL_READLINE)
 static char php_last_char = '\0';
 #endif
 
@@ -218,7 +217,7 @@
uint remaining = str_length;
size_t ret;
 
-#if HAVE_LIBREADLINE || HAVE_LIBEDIT
+#if (HAVE_LIBREADLINE || HAVE_LIBEDIT)  !defined(COMPILE_DL_READLINE)
if (!str_length) {
return 0;
}
@@ -396,7 +395,7 @@
   %s [options] -- [args...]\n
   %s [options] -a\n
\n
-#if HAVE_LIBREADLINE || HAVE_LIBEDIT
+#if (HAVE_LIBREADLINE || HAVE_LIBEDIT)  !defined(COMPILE_DL_READLINE)
  -a   Run as interactive shell\n
 #else
  -a   Run interactively\n
@@ -1002,7 +1001,7 @@
cli_register_file_handles(TSRMLS_C);
}
 
-#if HAVE_LIBREADLINE || HAVE_LIBEDIT
+#if (HAVE_LIBREADLINE || HAVE_LIBEDIT)  !defined(COMPILE_DL_READLINE)
if (interactive) {
char *line;
size_t size = 4096, pos = 0, len;
http://cvs.php.net/diff.php/php-src/sapi/cli/php_cli_readline.c?r1=1.5r2=1.6ty=u
Index: php-src/sapi/cli/php_cli_readline.c
diff -u php-src/sapi/cli/php_cli_readline.c:1.5 
php-src/sapi/cli/php_cli_readline.c:1.6
--- php-src/sapi/cli/php_cli_readline.c:1.5 Mon Nov  7 14:12:37 2005
+++ php-src/sapi/cli/php_cli_readline.c Thu Nov 17 03:36:12 2005
@@ -17,9 +17,12 @@
+--+
 */
 
-/* $Id: php_cli_readline.c,v 1.5 2005/11/07 19:12:37 helly Exp $ */
+/* $Id: php_cli_readline.c,v 1.6 2005/11/17 08:36:12 sniper Exp $ */
 
 #include php.h
+
+#if (HAVE_LIBREADLINE || HAVE_LIBEDIT)  !defined(COMPILE_DL_READLINE)
+
 #include php_globals.h
 #include php_variables.h
 #include zend_hash.h
@@ -42,20 +45,16 @@
 #include unixlib/local.h
 #endif
 
-#if HAVE_LIBREADLINE || HAVE_LIBEDIT
 #include readline/readline.h
 #if !HAVE_LIBEDIT
 #include readline/history.h
 #endif
-#endif /* HAVE_LIBREADLINE || HAVE_LIBEDIT */
 
 #include zend_compile.h
 #include zend_execute.h
 #include zend_highlight.h
 #include zend_indent.h
 
-#if HAVE_LIBREADLINE || HAVE_LIBEDIT
-
 /* {{{ cli_is_valid_code
  */
 typedef enum {

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



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

2005-11-17 Thread Marcus Boerger
helly   Thu Nov 17 18:20:40 2005 EDT

  Modified files:  
/php-src/sapi/cli   php_cli.c 
  Log:
  - Reflection was moved into its own extension
  
http://cvs.php.net/diff.php/php-src/sapi/cli/php_cli.c?r1=1.137r2=1.138ty=u
Index: php-src/sapi/cli/php_cli.c
diff -u php-src/sapi/cli/php_cli.c:1.137 php-src/sapi/cli/php_cli.c:1.138
--- php-src/sapi/cli/php_cli.c:1.137Thu Nov 17 03:36:11 2005
+++ php-src/sapi/cli/php_cli.c  Thu Nov 17 18:20:39 2005
@@ -20,7 +20,7 @@
+--+
 */
 
-/* $Id: php_cli.c,v 1.137 2005/11/17 08:36:11 sniper Exp $ */
+/* $Id: php_cli.c,v 1.138 2005/11/17 23:20:39 helly Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -28,7 +28,10 @@
 #include zend_hash.h
 #include zend_modules.h
 #include zend_interfaces.h
-#include zend_reflection_api.h
+
+#ifdef HAVE_REFLECTION
+#include ext/reflection/php_reflection.h
+#endif
 
 #include SAPI.h
 
@@ -133,8 +136,10 @@
{'?', 0, usage},/* help alias (both '?' and 'usage') */
{'v', 0, version},
{'z', 1, zend-extension},
+#ifdef HAVE_REFLECTION
{10,  1, rclass},
{11,  1, rextension},
+#endif
{'-', 0, NULL} /* end of args */
 };
 
@@ -567,7 +572,9 @@
zend_file_handle file_handle;
 /* temporary locals */
int behavior=PHP_MODE_STANDARD;
+#ifdef HAVE_REFLECTION
char *reflection_what;
+#endif
int orig_optind=php_optind;
char *orig_optarg=php_optarg;
char *arg_free=NULL, **arg_excp=arg_free;
@@ -913,6 +920,7 @@
hide_argv = 1;
break;
 
+#ifdef HAVE_REFLECTION
case 10:
behavior=PHP_MODE_REFLECTION_CLASS;
reflection_what = php_optarg;
@@ -921,7 +929,7 @@
behavior=PHP_MODE_REFLECTION_EXTENSION;
reflection_what = php_optarg;
break;
-
+#endif
default:
break;
}
@@ -1155,6 +1163,7 @@
}

break;
+#ifdef HAVE_REFLECTION
case PHP_MODE_REFLECTION_CLASS:
case PHP_MODE_REFLECTION_EXTENSION:
{
@@ -1205,6 +1214,7 @@
 
break;
}
+#endif /* reflection */
}
}
 

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



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

2005-11-15 Thread Ilia Alshanetsky
iliaa   Tue Nov 15 10:30:47 2005 EDT

  Modified files:  
/php-src/sapi/cli   php_cli.c 
  Log:
  MFB51: Fixed memory leak on php-cli -h
  
  
http://cvs.php.net/diff.php/php-src/sapi/cli/php_cli.c?r1=1.135r2=1.136ty=u
Index: php-src/sapi/cli/php_cli.c
diff -u php-src/sapi/cli/php_cli.c:1.135 php-src/sapi/cli/php_cli.c:1.136
--- php-src/sapi/cli/php_cli.c:1.135Fri Nov 11 19:38:00 2005
+++ php-src/sapi/cli/php_cli.c  Tue Nov 15 10:30:41 2005
@@ -20,7 +20,7 @@
+--+
 */
 
-/* $Id: php_cli.c,v 1.135 2005/11/12 00:38:00 sniper Exp $ */
+/* $Id: php_cli.c,v 1.136 2005/11/15 15:30:41 iliaa Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -700,14 +700,13 @@
 
case 'h': /* help  quit */
case '?':
-   php_output_startup();
-   php_output_activate(TSRMLS_C);
+   if (php_request_startup(TSRMLS_C)==FAILURE) {
+   goto err;
+   }
php_cli_usage(argv[0]);
php_end_ob_buffers(1 TSRMLS_CC);
exit_status=0;
-   zend_ini_deactivate(TSRMLS_C);
-   goto out_err;
-
+   goto out;
 
case 'i': /* php info  quit */
if (php_request_startup(TSRMLS_C)==FAILURE) {

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



Re: [PHP-CVS] cvs: php-src /sapi/cli php_cli.c

2005-11-12 Thread Rasmus Lerdorf

Jani Taskinen wrote:

sniper  Fri Nov 11 19:38:04 2005 EDT

  Modified files:  
/php-src/sapi/cli	php_cli.c 
  Log:
  - Fix the php -v output when neither --enable-debug or --enable-gcov 
is used. 
  #

  # Rasmus, now it should give proper output, please test.


Yup, fixed.

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



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

2005-11-11 Thread Jani Taskinen
sniper  Fri Nov 11 19:38:04 2005 EDT

  Modified files:  
/php-src/sapi/cli   php_cli.c 
  Log:
  - Fix the php -v output when neither --enable-debug or --enable-gcov 
is used. 
  #
  # Rasmus, now it should give proper output, please test.
  
  
http://cvs.php.net/diff.php/php-src/sapi/cli/php_cli.c?r1=1.134r2=1.135ty=u
Index: php-src/sapi/cli/php_cli.c
diff -u php-src/sapi/cli/php_cli.c:1.134 php-src/sapi/cli/php_cli.c:1.135
--- php-src/sapi/cli/php_cli.c:1.134Sun Nov  6 17:41:51 2005
+++ php-src/sapi/cli/php_cli.c  Fri Nov 11 19:38:00 2005
@@ -20,7 +20,7 @@
+--+
 */
 
-/* $Id: php_cli.c,v 1.134 2005/11/06 22:41:51 sniper Exp $ */
+/* $Id: php_cli.c,v 1.135 2005/11/12 00:38:00 sniper Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -744,6 +744,8 @@
(DEBUG),
 #elif defined(HAVE_GCOV)
(GCOV),
+#else
+   ,
 #endif
get_zend_version()
);

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



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

2005-11-06 Thread Jani Taskinen
sniper  Sun Nov  6 17:41:51 2005 EDT

  Modified files:  
/php-src/sapi/cli   php_cli.c 
  Log:
  - Fixed minor memory leak triggered by: -dzlib.output_compression=1 -m
  
http://cvs.php.net/diff.php/php-src/sapi/cli/php_cli.c?r1=1.133r2=1.134ty=u
Index: php-src/sapi/cli/php_cli.c
diff -u php-src/sapi/cli/php_cli.c:1.133 php-src/sapi/cli/php_cli.c:1.134
--- php-src/sapi/cli/php_cli.c:1.133Wed Oct 19 17:57:35 2005
+++ php-src/sapi/cli/php_cli.c  Sun Nov  6 17:41:51 2005
@@ -20,7 +20,7 @@
+--+
 */
 
-/* $Id: php_cli.c,v 1.133 2005/10/19 21:57:35 iliaa Exp $ */
+/* $Id: php_cli.c,v 1.134 2005/11/06 22:41:51 sniper Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -719,8 +719,9 @@
goto out;
 
case 'm': /* list compiled in modules */
-   php_output_startup();
-   php_output_activate(TSRMLS_C);
+   if (php_request_startup(TSRMLS_C)==FAILURE) {
+   goto err;
+   }
php_printf([PHP Modules]\n);
print_modules(TSRMLS_C);
php_printf(\n[Zend Modules]\n);
@@ -728,19 +729,24 @@
php_printf(\n);
php_end_ob_buffers(1 TSRMLS_CC);
exit_status=0;
-   sapi_deactivate(TSRMLS_C);
-   zend_ini_deactivate(TSRMLS_C);
-   goto out_err;
+   goto out;
 
case 'v': /* show php version  quit */
-   if (php_request_startup(TSRMLS_C)==FAILURE) {
+   if (php_request_startup(TSRMLS_C) == FAILURE) {
goto err;
}
-#if ZEND_DEBUG
-   php_printf(PHP %s (%s) (built: %s %s) 
(DEBUG)\nCopyright (c) 1997-2005 The PHP Group\n%s, PHP_VERSION, 
sapi_module.name, __DATE__, __TIME__, get_zend_version());
-#else
-   php_printf(PHP %s (%s) (built: %s 
%s)\nCopyright (c) 1997-2005 The PHP Group\n%s, PHP_VERSION, sapi_module.name, 
__DATE__, __TIME__, get_zend_version());
+
+   php_printf(PHP %s (%s) (built: %s %s) 
%s\nCopyright (c) 1997-2005 The PHP Group\n%s,
+   PHP_VERSION, sapi_module.name, 
__DATE__, __TIME__,
+#if ZEND_DEBUG  defined(HAVE_GCOV)
+   (DEBUG GCOV),
+#elif ZEND_DEBUG
+   (DEBUG),
+#elif defined(HAVE_GCOV)
+   (GCOV),
 #endif
+   get_zend_version()
+   );
php_end_ob_buffers(1 TSRMLS_CC);
exit_status=0;
goto out;

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



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

2005-10-19 Thread Ilia Alshanetsky
iliaa   Wed Oct 19 17:57:36 2005 EDT

  Modified files:  
/php-src/sapi/cli   php_cli.c 
  Log:
  Fixed -m memory leak
  
  
http://cvs.php.net/diff.php/php-src/sapi/cli/php_cli.c?r1=1.132r2=1.133ty=u
Index: php-src/sapi/cli/php_cli.c
diff -u php-src/sapi/cli/php_cli.c:1.132 php-src/sapi/cli/php_cli.c:1.133
--- php-src/sapi/cli/php_cli.c:1.132Tue Oct 11 14:58:27 2005
+++ php-src/sapi/cli/php_cli.c  Wed Oct 19 17:57:35 2005
@@ -20,7 +20,7 @@
+--+
 */
 
-/* $Id: php_cli.c,v 1.132 2005/10/11 18:58:27 sniper Exp $ */
+/* $Id: php_cli.c,v 1.133 2005/10/19 21:57:35 iliaa Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -728,6 +728,7 @@
php_printf(\n);
php_end_ob_buffers(1 TSRMLS_CC);
exit_status=0;
+   sapi_deactivate(TSRMLS_C);
zend_ini_deactivate(TSRMLS_C);
goto out_err;
 

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



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

2005-10-11 Thread Jani Taskinen
sniper  Tue Oct 11 14:58:34 2005 EDT

  Modified files:  
/php-src/sapi/cli   php_cli.c 
  Log:
  - Removed confusing dot.
  
http://cvs.php.net/diff.php/php-src/sapi/cli/php_cli.c?r1=1.131r2=1.132ty=u
Index: php-src/sapi/cli/php_cli.c
diff -u php-src/sapi/cli/php_cli.c:1.131 php-src/sapi/cli/php_cli.c:1.132
--- php-src/sapi/cli/php_cli.c:1.131Thu Oct  6 16:29:13 2005
+++ php-src/sapi/cli/php_cli.c  Tue Oct 11 14:58:27 2005
@@ -20,7 +20,7 @@
+--+
 */
 
-/* $Id: php_cli.c,v 1.131 2005/10/06 20:29:13 johannes Exp $ */
+/* $Id: php_cli.c,v 1.132 2005/10/11 18:58:27 sniper Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -530,7 +530,7 @@
*lineno = 1;
 
if (!(file_handle-handle.fp = VCWD_FOPEN(script_file, rb))) {
-   php_printf(Could not open input file: %s.\n, script_file);
+   php_printf(Could not open input file: %s\n, script_file);
return FAILURE;
}
file_handle-filename = script_file;

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



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

2005-08-08 Thread Hartmut Holzgraefe
hholzgraMon Aug  8 04:45:39 2005 EDT

  Modified files:  
/php-src/sapi/cli   php_cli.c 
  Log:
  fix extension loading from command line, resources didn't work 
  (still related to Bug #33899)
  
  
http://cvs.php.net/diff.php/php-src/sapi/cli/php_cli.c?r1=1.127r2=1.128ty=u
Index: php-src/sapi/cli/php_cli.c
diff -u php-src/sapi/cli/php_cli.c:1.127 php-src/sapi/cli/php_cli.c:1.128
--- php-src/sapi/cli/php_cli.c:1.127Mon Jun 20 20:12:35 2005
+++ php-src/sapi/cli/php_cli.c  Mon Aug  8 04:45:33 2005
@@ -20,7 +20,7 @@
+--+
 */
 
-/* $Id: php_cli.c,v 1.127 2005/06/21 00:12:35 iliaa Exp $ */
+/* $Id: php_cli.c,v 1.128 2005/08/08 08:45:33 hholzgra Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -438,7 +438,7 @@
if (!strcasecmp(name, extension)) { /* load function module */
zval extension, zval;
ZVAL_STRING(extension, value, 0);
-   php_dl(extension, MODULE_PERSISTENT, zval TSRMLS_CC);
+   php_dl(extension, MODULE_TEMPORARY, zval TSRMLS_CC);
} else {
zend_alter_ini_entry(name, strlen(name)+1, value, 
strlen(value), PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE);
}

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



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

2005-06-20 Thread Ilia Alshanetsky
iliaa   Mon Jun 20 20:12:37 2005 EDT

  Modified files:  
/php-src/sapi/cli   php_cli.c 
  Log:
  Fixed possible memory corruption.
  
  
http://cvs.php.net/diff.php/php-src/sapi/cli/php_cli.c?r1=1.126r2=1.127ty=u
Index: php-src/sapi/cli/php_cli.c
diff -u php-src/sapi/cli/php_cli.c:1.126 php-src/sapi/cli/php_cli.c:1.127
--- php-src/sapi/cli/php_cli.c:1.126Mon Jun  6 03:11:08 2005
+++ php-src/sapi/cli/php_cli.c  Mon Jun 20 20:12:35 2005
@@ -20,7 +20,7 @@
+--+
 */
 
-/* $Id: php_cli.c,v 1.126 2005/06/06 07:11:08 helly Exp $ */
+/* $Id: php_cli.c,v 1.127 2005/06/21 00:12:35 iliaa Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -213,6 +213,9 @@
size_t ret;
 
 #if HAVE_LIBREADLINE || HAVE_LIBEDIT
+   if (!str_length) {
+   return 0;
+   }
php_last_char = str[str_length-1];
 #endif
 

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



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

2005-06-06 Thread Marcus Boerger
helly   Mon Jun  6 03:11:10 2005 EDT

  Modified files:  
/php-src/sapi/cli   php_cli.c 
  Log:
  - Expose -a as special mode and show whether it is a shell or not
  
http://cvs.php.net/diff.php/php-src/sapi/cli/php_cli.c?r1=1.125r2=1.126ty=u
Index: php-src/sapi/cli/php_cli.c
diff -u php-src/sapi/cli/php_cli.c:1.125 php-src/sapi/cli/php_cli.c:1.126
--- php-src/sapi/cli/php_cli.c:1.125Tue May 17 10:33:15 2005
+++ php-src/sapi/cli/php_cli.c  Mon Jun  6 03:11:08 2005
@@ -20,7 +20,7 @@
+--+
 */
 
-/* $Id: php_cli.c,v 1.125 2005/05/17 14:33:15 johannes Exp $ */
+/* $Id: php_cli.c,v 1.126 2005/06/06 07:11:08 helly Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -385,8 +385,13 @@
   %s [options] [-B begin_code] -R code [-E 
end_code] [--] [args...]\n
   %s [options] [-B begin_code] -F file [-E 
end_code] [--] [args...]\n
   %s [options] -- [args...]\n
+  %s [options] -a\n
\n
+#if HAVE_LIBREADLINE || HAVE_LIBEDIT
+ -a   Run as interactive shell\n
+#else
  -a   Run interactively\n
+#endif
  -c path|file Look for php.ini file in 
this directory\n
  -n   No php.ini file will be 
used\n
  -d foo[=bar] Define INI entry foo with 
value 'bar'\n
@@ -410,7 +415,7 @@
  args...  Arguments passed to script. 
Use -- args when first argument\n
   starts with - or script is 
read from stdin\n
\n
-   , prog, prog, prog, prog, prog);
+   , prog, prog, prog, prog, prog, prog);
 }
 /* }}} */
 

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



[PHP-CVS] cvs: php-src /sapi/cli php_cli.c php_cli_readline.c

2005-05-17 Thread Johannes Schl
johannesTue May 17 10:33:15 2005 EDT

  Modified files:  
/php-src/sapi/cli   php_cli.c php_cli_readline.c 
  Log:
  - Fix readline loop-condition
  - Fix cli_is_valid_code detection
  
http://cvs.php.net/diff.php/php-src/sapi/cli/php_cli.c?r1=1.124r2=1.125ty=u
Index: php-src/sapi/cli/php_cli.c
diff -u php-src/sapi/cli/php_cli.c:1.124 php-src/sapi/cli/php_cli.c:1.125
--- php-src/sapi/cli/php_cli.c:1.124Sat May 14 15:33:18 2005
+++ php-src/sapi/cli/php_cli.c  Tue May 17 10:33:15 2005
@@ -20,7 +20,7 @@
+--+
 */
 
-/* $Id: php_cli.c,v 1.124 2005/05/14 19:33:18 helly Exp $ */
+/* $Id: php_cli.c,v 1.125 2005/05/17 14:33:15 johannes Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -978,12 +978,11 @@
 
history_file = tilde_expand(~/.php_history);
rl_attempted_completion_function = 
cli_code_completion;
-   /*rl_completion_append_character = '(';*/
rl_special_prefixes = $;
read_history(history_file);
 
EG(exit_status) = 0;
-   while ((line = readline(pos ? prompt : php  
)) != NULL) {
+   while ((line = readline(prompt)) != NULL) {
if (strcmp(line, exit) == 0 || 
strcmp(line, quit) == 0) {
free(line);
break;
http://cvs.php.net/diff.php/php-src/sapi/cli/php_cli_readline.c?r1=1.1r2=1.2ty=u
Index: php-src/sapi/cli/php_cli_readline.c
diff -u php-src/sapi/cli/php_cli_readline.c:1.1 
php-src/sapi/cli/php_cli_readline.c:1.2
--- php-src/sapi/cli/php_cli_readline.c:1.1 Sat May 14 15:33:18 2005
+++ php-src/sapi/cli/php_cli_readline.c Tue May 17 10:33:15 2005
@@ -17,7 +17,7 @@
+--+
 */
 
-/* $Id: php_cli_readline.c,v 1.1 2005/05/14 19:33:18 helly Exp $ */
+/* $Id: php_cli_readline.c,v 1.2 2005/05/17 14:33:15 johannes Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -73,7 +73,7 @@
 
 int cli_is_valid_code(char *code, int len, char **prompt TSRMLS_DC)
 {
-   int valid_end = 1;
+   int valid_end = 1, last_valid_end;
int brackets_count = 0;
int brace_count = 0;
int i;
@@ -109,6 +109,7 @@
valid_end = brace_count == 0  
brackets_count == 0;
break;
case ' ':
+   case '\r':
case '\n':
case '\t':
break;
@@ -118,6 +119,9 @@
case '':
code_type = dstring;
break;
+   case '#':
+   code_type = comment_line;
+   break;
case '/':
if (code[i+1] == '/') {
i++;
@@ -125,6 +129,8 @@
break;
}
if (code[i+1] == '*') {
+   last_valid_end = 
valid_end;
+   valid_end = 0;
code_type = 
comment_block;
i++;
break;
@@ -190,6 +196,7 @@
case comment_block:
if (code[i-1] == '*'  code[i] == '/') {
code_type = body;
+   valid_end = last_valid_end;
}
break;
case heredoc_start:

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



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

2005-03-22 Thread Antony Dovgal
tony2001Tue Mar 22 10:08:54 2005 EDT

  Modified files:  
/php-src/sapi/cli   php_cli.c 
  Log:
  fix #28803 (enabled debug causes bailout errors with CLI on AIX
  because of fflush() called on already closed filedescriptor)
  
  
http://cvs.php.net/diff.php/php-src/sapi/cli/php_cli.c?r1=1.121r2=1.122ty=u
Index: php-src/sapi/cli/php_cli.c
diff -u php-src/sapi/cli/php_cli.c:1.121 php-src/sapi/cli/php_cli.c:1.122
--- php-src/sapi/cli/php_cli.c:1.121Fri Mar 18 17:11:53 2005
+++ php-src/sapi/cli/php_cli.c  Tue Mar 22 10:08:52 2005
@@ -19,7 +19,7 @@
+--+
 */
 
-/* $Id: php_cli.c,v 1.121 2005/03/18 22:11:53 sniper Exp $ */
+/* $Id: php_cli.c,v 1.122 2005/03/22 15:08:52 tony2001 Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -220,7 +220,10 @@
 
 static void sapi_cli_flush(void *server_context)
 {
-   if (fflush(stdout)==EOF) {
+   /* Ignore EBADF here, it's caused by the fact that STDIN/STDOUT/STDERR 
streams
+* are/could be closed before fflush() is called.
+*/
+   if (fflush(stdout)==EOF  errno!=EBADF) {
 #ifndef PHP_CLI_WIN32_NO_CONSOLE
php_handle_aborted_connection();
 #endif

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



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

2005-03-18 Thread Jani Taskinen
sniper  Fri Mar 18 17:11:53 2005 EDT

  Modified files:  
/php-src/sapi/cli   php_cli.c 
  Log:
  Revert bad idea. (no more error for invalid -d options)
  
http://cvs.php.net/diff.php/php-src/sapi/cli/php_cli.c?r1=1.120r2=1.121ty=u
Index: php-src/sapi/cli/php_cli.c
diff -u php-src/sapi/cli/php_cli.c:1.120 php-src/sapi/cli/php_cli.c:1.121
--- php-src/sapi/cli/php_cli.c:1.120Thu Mar 17 08:43:32 2005
+++ php-src/sapi/cli/php_cli.c  Fri Mar 18 17:11:53 2005
@@ -19,7 +19,7 @@
+--+
 */
 
-/* $Id: php_cli.c,v 1.120 2005/03/17 13:43:32 sniper Exp $ */
+/* $Id: php_cli.c,v 1.121 2005/03/18 22:11:53 sniper Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -395,7 +395,7 @@
 }
 /* }}} */
 
-static int define_command_line_ini_entry(char *arg TSRMLS_DC)
+static void define_command_line_ini_entry(char *arg TSRMLS_DC)
 {
char *name, *value;
 
@@ -413,9 +413,8 @@
ZVAL_STRING(extension, value, 0);
php_dl(extension, MODULE_PERSISTENT, zval TSRMLS_CC);
} else {
-   return zend_alter_ini_entry(name, strlen(name)+1, value, 
strlen(value), PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE);
+   zend_alter_ini_entry(name, strlen(name)+1, value, 
strlen(value), PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE);
}
-   return SUCCESS;
 }
 
 
@@ -662,10 +661,7 @@
switch (c) {
 
case 'd': /* define ini entries on command line */
-   if (define_command_line_ini_entry(php_optarg 
TSRMLS_CC) == FAILURE) {
-   zend_printf(Invalid php.ini entry 
'%s'.\n, php_optarg);
-   goto err;
-   }
+   define_command_line_ini_entry(php_optarg 
TSRMLS_CC);
break;
 
case 'h': /* help  quit */

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



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

2005-03-17 Thread Jani Taskinen
sniper  Thu Mar 17 08:43:33 2005 EDT

  Modified files:  
/php-src/sapi/cli   php_cli.c 
  Log:
  - Made CLI option -d output error and exit if an non-existing (or 
unmodifyable) entry is passed
  
http://cvs.php.net/diff.php/php-src/sapi/cli/php_cli.c?r1=1.119r2=1.120ty=u
Index: php-src/sapi/cli/php_cli.c
diff -u php-src/sapi/cli/php_cli.c:1.119 php-src/sapi/cli/php_cli.c:1.120
--- php-src/sapi/cli/php_cli.c:1.119Thu Mar 17 02:31:22 2005
+++ php-src/sapi/cli/php_cli.c  Thu Mar 17 08:43:32 2005
@@ -19,7 +19,7 @@
+--+
 */
 
-/* $Id: php_cli.c,v 1.119 2005/03/17 07:31:22 derick Exp $ */
+/* $Id: php_cli.c,v 1.120 2005/03/17 13:43:32 sniper Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -395,7 +395,7 @@
 }
 /* }}} */
 
-static void define_command_line_ini_entry(char *arg TSRMLS_DC)
+static int define_command_line_ini_entry(char *arg TSRMLS_DC)
 {
char *name, *value;
 
@@ -413,8 +413,9 @@
ZVAL_STRING(extension, value, 0);
php_dl(extension, MODULE_PERSISTENT, zval TSRMLS_CC);
} else {
-   zend_alter_ini_entry(name, strlen(name)+1, value, 
strlen(value), PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE);
+   return zend_alter_ini_entry(name, strlen(name)+1, value, 
strlen(value), PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE);
}
+   return SUCCESS;
 }
 
 
@@ -661,7 +662,10 @@
switch (c) {
 
case 'd': /* define ini entries on command line */
-   define_command_line_ini_entry(php_optarg 
TSRMLS_CC);
+   if (define_command_line_ini_entry(php_optarg 
TSRMLS_CC) == FAILURE) {
+   zend_printf(Invalid php.ini entry 
'%s'.\n, php_optarg);
+   goto err;
+   }
break;
 
case 'h': /* help  quit */

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



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

2005-03-16 Thread Derick Rethans
derick  Thu Mar 17 02:31:24 2005 EDT

  Modified files:  
/php-src/sapi/cli   php_cli.c 
  Log:
  - ZTS fixes
  #- Andrei, it would be nice if you could test ZTS builds too before you
  #  commit...
  
  
http://cvs.php.net/diff.php/php-src/sapi/cli/php_cli.c?r1=1.118r2=1.119ty=u
Index: php-src/sapi/cli/php_cli.c
diff -u php-src/sapi/cli/php_cli.c:1.118 php-src/sapi/cli/php_cli.c:1.119
--- php-src/sapi/cli/php_cli.c:1.118Tue Mar 15 17:41:12 2005
+++ php-src/sapi/cli/php_cli.c  Thu Mar 17 02:31:22 2005
@@ -19,7 +19,7 @@
+--+
 */
 
-/* $Id: php_cli.c,v 1.118 2005/03/15 22:41:12 andrei Exp $ */
+/* $Id: php_cli.c,v 1.119 2005/03/17 07:31:22 derick Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -395,7 +395,7 @@
 }
 /* }}} */
 
-static void define_command_line_ini_entry(char *arg)
+static void define_command_line_ini_entry(char *arg TSRMLS_DC)
 {
char *name, *value;
 
@@ -661,7 +661,7 @@
switch (c) {
 
case 'd': /* define ini entries on command line */
-   define_command_line_ini_entry(php_optarg);
+   define_command_line_ini_entry(php_optarg 
TSRMLS_CC);
break;
 
case 'h': /* help  quit */

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



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

2005-03-15 Thread Andrei Zmievski
andrei  Tue Mar 15 17:41:13 2005 EDT

  Modified files:  
/php-src/sapi/cli   php_cli.c 
  Log:
  Make it possible to load shared extensions from command line via
  -dextension= mechanism.
  
  
http://cvs.php.net/diff.php/php-src/sapi/cli/php_cli.c?r1=1.117r2=1.118ty=u
Index: php-src/sapi/cli/php_cli.c
diff -u php-src/sapi/cli/php_cli.c:1.117 php-src/sapi/cli/php_cli.c:1.118
--- php-src/sapi/cli/php_cli.c:1.117Sat Mar 12 09:07:35 2005
+++ php-src/sapi/cli/php_cli.c  Tue Mar 15 17:41:12 2005
@@ -19,7 +19,7 @@
+--+
 */
 
-/* $Id: php_cli.c,v 1.117 2005/03/12 14:07:35 wez Exp $ */
+/* $Id: php_cli.c,v 1.118 2005/03/15 22:41:12 andrei Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -407,7 +407,14 @@
} else {
value = 1;
}
-   zend_alter_ini_entry(name, strlen(name)+1, value, strlen(value), 
PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE);
+
+   if (!strcasecmp(name, extension)) { /* load function module */
+   zval extension, zval;
+   ZVAL_STRING(extension, value, 0);
+   php_dl(extension, MODULE_PERSISTENT, zval TSRMLS_CC);
+   } else {
+   zend_alter_ini_entry(name, strlen(name)+1, value, 
strlen(value), PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE);
+   }
 }
 
 

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



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

2005-03-12 Thread Wez Furlong
wez Sat Mar 12 09:07:35 2005 EDT

  Modified files:  
/php-src/sapi/cli   php_cli.c 
  Log:
  it's 2005 already
  # and we're all too lazy to go through and update all the copyright years :)
  
  
http://cvs.php.net/diff.php/php-src/sapi/cli/php_cli.c?r1=1.116r2=1.117ty=u
Index: php-src/sapi/cli/php_cli.c
diff -u php-src/sapi/cli/php_cli.c:1.116 php-src/sapi/cli/php_cli.c:1.117
--- php-src/sapi/cli/php_cli.c:1.116Wed Jan 19 21:02:09 2005
+++ php-src/sapi/cli/php_cli.c  Sat Mar 12 09:07:35 2005
@@ -2,7 +2,7 @@
+--+
| PHP Version 5|
+--+
-   | Copyright (c) 1997-2004 The PHP Group|
+   | Copyright (c) 1997-2005 The PHP Group|
+--+
| This source file is subject to version 3.0 of the PHP license,   |
| that is bundled with this package in the file LICENSE, and is|
@@ -19,7 +19,7 @@
+--+
 */
 
-/* $Id: php_cli.c,v 1.116 2005/01/20 02:02:09 sniper Exp $ */
+/* $Id: php_cli.c,v 1.117 2005/03/12 14:07:35 wez Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -693,9 +693,9 @@
goto err;
}
 #if ZEND_DEBUG
-   php_printf(PHP %s (%s) (built: %s %s) 
(DEBUG)\nCopyright (c) 1997-2004 The PHP Group\n%s, PHP_VERSION, 
sapi_module.name, __DATE__, __TIME__, get_zend_version());
+   php_printf(PHP %s (%s) (built: %s %s) 
(DEBUG)\nCopyright (c) 1997-2005 The PHP Group\n%s, PHP_VERSION, 
sapi_module.name, __DATE__, __TIME__, get_zend_version());
 #else
-   php_printf(PHP %s (%s) (built: %s 
%s)\nCopyright (c) 1997-2004 The PHP Group\n%s, PHP_VERSION, sapi_module.name, 
__DATE__, __TIME__, get_zend_version());
+   php_printf(PHP %s (%s) (built: %s 
%s)\nCopyright (c) 1997-2005 The PHP Group\n%s, PHP_VERSION, sapi_module.name, 
__DATE__, __TIME__, get_zend_version());
 #endif
php_end_ob_buffers(1 TSRMLS_CC);
exit_status=1;

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



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

2004-11-15 Thread Antony Dovgal
tony2001Mon Nov 15 09:00:49 2004 EDT

  Modified files:  
/php-src/sapi/cli   php_cli.c 
  Log:
  fix CLI leaks when using malformed option string
  
  
http://cvs.php.net/diff.php/php-src/sapi/cli/php_cli.c?r1=1.113r2=1.114ty=u
Index: php-src/sapi/cli/php_cli.c
diff -u php-src/sapi/cli/php_cli.c:1.113 php-src/sapi/cli/php_cli.c:1.114
--- php-src/sapi/cli/php_cli.c:1.113Wed Jul 14 18:30:29 2004
+++ php-src/sapi/cli/php_cli.c  Mon Nov 15 09:00:48 2004
@@ -19,7 +19,7 @@
+--+
 */
 
-/* $Id: php_cli.c,v 1.113 2004/07/14 22:30:29 edink Exp $ */
+/* $Id: php_cli.c,v 1.114 2004/11/15 14:00:48 tony2001 Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -870,7 +870,7 @@
if (param_error) {
PUTS(param_error);
exit_status=1;
-   goto out_err;
+   goto err;
}
 
CG(interactive) = interactive;

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



Re: [PHP-CVS] cvs: php-src /sapi/cli php_cli.c

2004-03-05 Thread Jan Lehnardt
Hi,
On 4 Mar 2004, at 23:49, Moriyoshi Koizumi wrote:
moriyoshi		Thu Mar  4 17:49:54 2004 EDT

  Modified files:
/php-src/sapi/cli   php_cli.c
  Log:
  - Prevent cli from printing multiple Interactive mode enabled if
the command line option is given more than once (like -aa).
MFH?

Jan
--
GPG Key: BB96 56B0
Q: Thank Jan? - A: http://geschenke.an.dasmoped.net/
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-CVS] cvs: php-src /sapi/cli php_cli.c

2004-03-05 Thread Moriyoshi Koizumi
On 2004/03/05, at 20:49, Jan Lehnardt wrote:

  - Prevent cli from printing multiple Interactive mode enabled if
the command line option is given more than once (like -aa).
MFH?
If Ilia permits.

Moriyoshi

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


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

2004-03-04 Thread Moriyoshi Koizumi
moriyoshi   Thu Mar  4 17:49:54 2004 EDT

  Modified files:  
/php-src/sapi/cli   php_cli.c 
  Log:
  - Prevent cli from printing multiple Interactive mode enabled if
the command line option is given more than once (like -aa).
  
  
http://cvs.php.net/diff.php/php-src/sapi/cli/php_cli.c?r1=1.110r2=1.111ty=u
Index: php-src/sapi/cli/php_cli.c
diff -u php-src/sapi/cli/php_cli.c:1.110 php-src/sapi/cli/php_cli.c:1.111
--- php-src/sapi/cli/php_cli.c:1.110Wed Feb 11 16:00:46 2004
+++ php-src/sapi/cli/php_cli.c  Thu Mar  4 17:49:54 2004
@@ -19,7 +19,7 @@
+--+
 */
 
-/* $Id: php_cli.c,v 1.110 2004/02/11 21:00:46 helly Exp $ */
+/* $Id: php_cli.c,v 1.111 2004/03/04 22:49:54 moriyoshi Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -714,9 +714,11 @@
switch (c) {
 
case 'a':   /* interactive mode */
-   printf(Interactive mode enabled\n\n);
-   fflush(stdout);
-   interactive=1;
+   if (interactive) {
+   printf(Interactive mode enabled\n\n);
+   fflush(stdout);
+   interactive=1;
+   }
break;
 
case 'C': /* don't chdir to the script directory */

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



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

2004-03-04 Thread Moriyoshi Koizumi
moriyoshi   Thu Mar  4 17:53:09 2004 EDT

  Modified files:  
/php-src/sapi/cli   php_cli.c 
  Log:
  - typo (must have sleep.)
  
  
http://cvs.php.net/diff.php/php-src/sapi/cli/php_cli.c?r1=1.111r2=1.112ty=u
Index: php-src/sapi/cli/php_cli.c
diff -u php-src/sapi/cli/php_cli.c:1.111 php-src/sapi/cli/php_cli.c:1.112
--- php-src/sapi/cli/php_cli.c:1.111Thu Mar  4 17:49:54 2004
+++ php-src/sapi/cli/php_cli.c  Thu Mar  4 17:53:09 2004
@@ -19,7 +19,7 @@
+--+
 */
 
-/* $Id: php_cli.c,v 1.111 2004/03/04 22:49:54 moriyoshi Exp $ */
+/* $Id: php_cli.c,v 1.112 2004/03/04 22:53:09 moriyoshi Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -714,7 +714,7 @@
switch (c) {
 
case 'a':   /* interactive mode */
-   if (interactive) {
+   if (!interactive) {
printf(Interactive mode enabled\n\n);
fflush(stdout);
interactive=1;

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



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

2004-02-05 Thread Ilia Alshanetsky
iliaa   Thu Feb  5 22:08:27 2004 EDT

  Modified files:  
/php-src/sapi/cli   php_cli.c 
  Log:
  Fixed possible memory leak with INI values.
  
  
http://cvs.php.net/diff.php/php-src/sapi/cli/php_cli.c?r1=1.108r2=1.109ty=u
Index: php-src/sapi/cli/php_cli.c
diff -u php-src/sapi/cli/php_cli.c:1.108 php-src/sapi/cli/php_cli.c:1.109
--- php-src/sapi/cli/php_cli.c:1.108Wed Feb  4 17:49:28 2004
+++ php-src/sapi/cli/php_cli.c  Thu Feb  5 22:08:27 2004
@@ -19,7 +19,7 @@
+--+
 */
 
-/* $Id: php_cli.c,v 1.108 2004/02/04 22:49:28 iliaa Exp $ */
+/* $Id: php_cli.c,v 1.109 2004/02/06 03:08:27 iliaa Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -663,7 +663,7 @@
php_cli_usage(argv[0]);
php_end_ob_buffers(1 TSRMLS_CC);
exit_status=1;
-   goto out_err;
+   goto err;
 
 
case 'i': /* php info  quit */
@@ -685,7 +685,7 @@
php_printf(\n);
php_end_ob_buffers(1 TSRMLS_CC);
exit_status=1;
-   goto out_err;
+   goto err;
 
case 'v': /* show php version  quit */
if (php_request_startup(TSRMLS_C)==FAILURE) {

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



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

2004-02-04 Thread Ilia Alshanetsky
iliaa   Wed Feb  4 17:49:29 2004 EDT

  Modified files:  
/php-src/sapi/cli   php_cli.c 
  Log:
  Parse command line ini directives passed using -d before -i, to ensure
  correct settings output.
  
  
http://cvs.php.net/diff.php/php-src/sapi/cli/php_cli.c?r1=1.107r2=1.108ty=u
Index: php-src/sapi/cli/php_cli.c
diff -u php-src/sapi/cli/php_cli.c:1.107 php-src/sapi/cli/php_cli.c:1.108
--- php-src/sapi/cli/php_cli.c:1.107Tue Jan 13 22:14:17 2004
+++ php-src/sapi/cli/php_cli.c  Wed Feb  4 17:49:28 2004
@@ -19,7 +19,7 @@
+--+
 */
 
-/* $Id: php_cli.c,v 1.107 2004/01/14 03:14:17 wez Exp $ */
+/* $Id: php_cli.c,v 1.108 2004/02/04 22:49:28 iliaa Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -641,10 +641,21 @@
exit_status=1;
goto out_err;
}
-   
+
+   /* here is the place for hard coded defaults which cannot be 
overwritten in the ini file */
+   INI_HARDCODED(register_argc_argv, 1);
+   INI_HARDCODED(html_errors, 0);
+   INI_HARDCODED(implicit_flush, 1);
+   INI_HARDCODED(output_buffering, 0);
+   INI_HARDCODED(max_execution_time, 0);
+
while ((c = php_getopt(argc, argv, OPTIONS, optarg, optind, 0)) != 
-1) {
switch (c) {
 
+   case 'd': /* define ini entries on command line */
+   define_command_line_ini_entry(optarg);
+   break;
+
case 'h': /* help  quit */
case '?':
php_output_startup();
@@ -696,12 +707,6 @@
 
/* Set some CLI defaults */
SG(options) |= SAPI_OPTION_NO_CHDIR;
-   /* here is the place for hard coded defaults which cannot be 
overwritten in the ini file */
-   INI_HARDCODED(register_argc_argv, 1);
-   INI_HARDCODED(html_errors, 0);
-   INI_HARDCODED(implicit_flush, 1);
-   INI_HARDCODED(output_buffering, 0);
-   INI_HARDCODED(max_execution_time, 0);
 
optind = orig_optind;
optarg = orig_optarg;
@@ -717,9 +722,6 @@
case 'C': /* don't chdir to the script directory */
/* This is default so NOP */
break;
-   case 'd': /* define ini entries on command line */
-   define_command_line_ini_entry(optarg);
-   break;
 
case 'e': /* enable extended info output */
CG(extended_info) = 1;

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



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

2004-01-02 Thread Edin Kadribasic
edink   Fri Jan  2 17:31:33 2004 EDT

  Modified files:  
/php-src/sapi/cli   php_cli.c 
  Log:
  Disable output buffering in CLI overriding php.ini setting.
  Fixes #26755.
  
  
Index: php-src/sapi/cli/php_cli.c
diff -u php-src/sapi/cli/php_cli.c:1.104 php-src/sapi/cli/php_cli.c:1.105
--- php-src/sapi/cli/php_cli.c:1.104Mon Dec 22 08:08:04 2003
+++ php-src/sapi/cli/php_cli.c  Fri Jan  2 17:31:32 2004
@@ -19,7 +19,7 @@
+--+
 */
 
-/* $Id: php_cli.c,v 1.104 2003/12/22 13:08:04 wez Exp $ */
+/* $Id: php_cli.c,v 1.105 2004/01/02 22:31:32 edink Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -686,6 +686,7 @@
INI_HARDCODED(register_argc_argv, 1);
INI_HARDCODED(html_errors, 0);
INI_HARDCODED(implicit_flush, 1);
+   INI_HARDCODED(output_buffering, 0);
INI_HARDCODED(max_execution_time, 0);
 
optind = orig_optind;

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



Re: [PHP-CVS] cvs: php-src /sapi/cli php_cli.c

2004-01-02 Thread Jani Taskinen
  
MFH?

--Jani

On Fri, 2 Jan 2004, Edin Kadribasic wrote:

edink  Fri Jan  2 17:31:33 2004 EDT

  Modified files:  
/php-src/sapi/cli  php_cli.c 
  Log:
  Disable output buffering in CLI overriding php.ini setting.
  Fixes #26755.
  
  
Index: php-src/sapi/cli/php_cli.c
diff -u php-src/sapi/cli/php_cli.c:1.104 php-src/sapi/cli/php_cli.c:1.105
--- php-src/sapi/cli/php_cli.c:1.104   Mon Dec 22 08:08:04 2003
+++ php-src/sapi/cli/php_cli.c Fri Jan  2 17:31:32 2004
@@ -19,7 +19,7 @@
+--+
 */
 
-/* $Id: php_cli.c,v 1.104 2003/12/22 13:08:04 wez Exp $ */
+/* $Id: php_cli.c,v 1.105 2004/01/02 22:31:32 edink Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -686,6 +686,7 @@
   INI_HARDCODED(register_argc_argv, 1);
   INI_HARDCODED(html_errors, 0);
   INI_HARDCODED(implicit_flush, 1);
+  INI_HARDCODED(output_buffering, 0);
   INI_HARDCODED(max_execution_time, 0);
 
   optind = orig_optind;



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



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

2003-12-11 Thread Ilia Alshanetsky
iliaa   Thu Dec 11 18:51:25 2003 EDT

  Modified files:  
/php-src/sapi/cli   php_cli.c 
  Log:
  Fixed extra byte allocation for STD* constants and replace magic numbers
  with sizeof().
  
  
Index: php-src/sapi/cli/php_cli.c
diff -u php-src/sapi/cli/php_cli.c:1.102 php-src/sapi/cli/php_cli.c:1.103
--- php-src/sapi/cli/php_cli.c:1.102Thu Aug 28 07:50:32 2003
+++ php-src/sapi/cli/php_cli.c  Thu Dec 11 18:51:24 2003
@@ -19,7 +19,7 @@
+--+
 */
 
-/* $Id: php_cli.c,v 1.102 2003/08/28 11:50:32 stas Exp $ */
+/* $Id: php_cli.c,v 1.103 2003/12/11 23:51:24 iliaa Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -448,22 +448,22 @@

ic.value = *zin;
ic.flags = CONST_CS;
-   ic.name = zend_strndup(STDIN, 6);
-   ic.name_len = 6;
+   ic.name = zend_strndup(ZEND_STRS(STDIN));
+   ic.name_len = sizeof(STDIN);
ic.module_number = 0;
zend_register_constant(ic TSRMLS_CC);
 
oc.value = *zout;
oc.flags = CONST_CS;
-   oc.name = zend_strndup(STDOUT, 7);
-   oc.name_len = 7;
+   oc.name = zend_strndup(ZEND_STRS(STDOUT));
+   oc.name_len = sizeof(STDOUT);
oc.module_number = 0;
zend_register_constant(oc TSRMLS_CC);
 
ec.value = *zerr;
ec.flags = CONST_CS;
-   ec.name = zend_strndup(STDERR, 7);
-   ec.name_len = 7;
+   ec.name = zend_strndup(ZEND_STRS(STDERR));
+   ec.name_len = sizeof(STDERR);
ec.module_number = 0;
zend_register_constant(ec TSRMLS_CC);
 

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



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

2003-08-17 Thread Marcus Boerger
helly   Sun Aug 17 15:14:30 2003 EDT

  Modified files:  
/php-src/sapi/cli   php_cli.c 
  Log:
  Fix warnings
  
Index: php-src/sapi/cli/php_cli.c
diff -u php-src/sapi/cli/php_cli.c:1.98 php-src/sapi/cli/php_cli.c:1.99
--- php-src/sapi/cli/php_cli.c:1.98 Tue Aug 12 21:29:51 2003
+++ php-src/sapi/cli/php_cli.c  Sun Aug 17 15:14:30 2003
@@ -19,7 +19,7 @@
+--+
 */
 
-/* $Id: php_cli.c,v 1.98 2003/08/13 01:29:51 iliaa Exp $ */
+/* $Id: php_cli.c,v 1.99 2003/08/17 19:14:30 helly Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -418,7 +418,6 @@
efree(*arg);
 }
 
-static php_stream_context *sc_in_process = NULL;
 static php_stream *s_in_process = NULL;
 
 static void cli_register_file_handles(TSRMLS_D)
@@ -440,7 +439,6 @@
return;
}

-   sc_in_process = sc_in;
s_in_process = s_in;
 
php_stream_to_zval(s_in,  zin);
@@ -525,7 +523,6 @@
int lineno = 0;
char *exec_direct=NULL, *exec_run=NULL, *exec_begin=NULL, *exec_end=NULL;
const char *param_error=NULL;
-   int scan_input = 0;
int hide_argv = 0;
 /* end of temporary locals */
 #ifdef ZTS
@@ -801,7 +798,6 @@
param_error = param_mode_conflict;
break;
}
-   scan_input = 1;
behavior=PHP_MODE_PROCESS_STDIN;
exec_end=optarg;
break;



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



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

2003-08-14 Thread Ilia Alshanetsky
iliaa   Tue Aug 12 21:29:51 2003 EDT

  Modified files:  
/php-src/sapi/cli   php_cli.c 
  Log:
  Fixed bug #20896 (-s -w modes with php-cli cause php to hang).
  
  
Index: php-src/sapi/cli/php_cli.c
diff -u php-src/sapi/cli/php_cli.c:1.97 php-src/sapi/cli/php_cli.c:1.98
--- php-src/sapi/cli/php_cli.c:1.97 Fri Aug  1 12:52:49 2003
+++ php-src/sapi/cli/php_cli.c  Tue Aug 12 21:29:51 2003
@@ -19,7 +19,7 @@
+--+
 */
 
-/* $Id: php_cli.c,v 1.97 2003/08/01 16:52:49 iliaa Exp $ */
+/* $Id: php_cli.c,v 1.98 2003/08/13 01:29:51 iliaa Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -921,7 +921,6 @@
case PHP_MODE_STRIP:
if (open_file_for_scanning(file_handle TSRMLS_CC)==SUCCESS) {
zend_strip(TSRMLS_C);
-   fclose(file_handle.handle.fp);
}
goto out;
break;
@@ -932,7 +931,6 @@
if (open_file_for_scanning(file_handle 
TSRMLS_CC)==SUCCESS) {

php_get_highlight_struct(syntax_highlighter_ini);
zend_highlight(syntax_highlighter_ini 
TSRMLS_CC);
-   fclose(file_handle.handle.fp);
}
goto out;
}



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