Re: [PHP-DOC] [HEADSUP] New phpweb branch

2008-08-18 Thread Philip Olson

That being said, I'd like to switch docs.php.net over to the new
branch if there are no objections?



Sounds like a good idea. Also, let's work together on getting the new  
doc box up and running... see you on IRC soon. :)


Regards,
Philip


Re: [PHP-DOC] License change? Bye bye OPL, hello CC?

2008-08-18 Thread Friedhelm Betz

hi,

late in the game, but a big +1 from me.
Friedhelm

Georg Richter wrote:

Mehdi Achour schrieb:

+1 for me!

/Georg

Fine with me.

Mehdi

On Tue, Jul 8, 2008 at 8:35 PM, Nuno Lopes <[EMAIL PROTECTED]> wrote:


I'm fine with this license change as well. But please include the full
license text in the appendix, just in case..

Nuno



 Hola,
I too am for an open yet fair license. Awhile ago I wrote the  
following

(and it appears I never followed up on it there!):

 http://news.php.net/php.doc.license/176

It lists three possible candidates with the one Hannes posted here 
as  one
of them. I do like this CC license because it's common,  
understandable,
short, and has a pretty website :) If we voted this  second I'd vote 
for it.
However, I'm unclear how our required "manner  specified" for 
attribution
would be. I guess a link, and a certain  phrase kinda like "The 
Official PHP

Manual" or fancier words...

Regards,
Philip












[PHP-DOC] cvs: php-src /ext/standard basic_functions.c

2008-08-18 Thread Pierre-Alain Joye
pajoye  Mon Aug 18 07:09:20 2008 UTC

  Modified files:  
/php-src/ext/standard   basic_functions.c 
  Log:
  - [DOC] make putenv behaves like unix putenv on Windows:
   .  FOO=1234 => set FOO to 1234
   .  FOO= => set FOO to an empty string
   .  FOO= => unset FOO
   . Use Set/GetEnvironmnent variable only
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/basic_functions.c?r1=1.918&r2=1.919&diff_format=u
Index: php-src/ext/standard/basic_functions.c
diff -u php-src/ext/standard/basic_functions.c:1.918 
php-src/ext/standard/basic_functions.c:1.919
--- php-src/ext/standard/basic_functions.c:1.918Sat Aug 16 10:57:26 2008
+++ php-src/ext/standard/basic_functions.c  Mon Aug 18 07:09:20 2008
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: basic_functions.c,v 1.918 2008/08/16 10:57:26 bjori Exp $ */
+/* $Id: basic_functions.c,v 1.919 2008/08/18 07:09:20 pajoye Exp $ */
 
 #include "php.h"
 #include "php_streams.h"
@@ -61,7 +61,11 @@
 #include 
 #endif
 
-#include
+#ifndef PHP_WIN32
+# include
+#else
+# include "win32/inet.h"
+#endif
 
 #if HAVE_ARPA_INET_H
 # include 
@@ -4391,15 +4395,39 @@
/* SAPI method returns an emalloc()'d string */
ptr = sapi_getenv(str, str_len TSRMLS_CC);
if (ptr) {
-   RETURN_RT_STRING(ptr, ZSTR_AUTOFREE);
+   RETURN_STRING(ptr, ZSTR_AUTOFREE);
}
+#ifdef PHP_WIN32
+   {
+   char dummybuf;
+   int size;
 
+   SetLastError(0);
+   /*If the given bugger is not large enough to hold the data, the 
return value is 
+   the buffer size,  in characters, required to hold the string 
and its terminating 
+   null character. We use this return value to alloc the final 
buffer. */
+   size = GetEnvironmentVariableA(str, &dummybuf, 0);
+   if (GetLastError() == ERROR_ENVVAR_NOT_FOUND) {
+   /* The environment variable doesn't exist. */
+   RETURN_FALSE;
+   }
+
+   if (size == 0) {
+   /* env exists, but it is empty */
+   RETURN_EMPTY_STRING();
+   }
+
+   ptr = emalloc(size);
+   size = GetEnvironmentVariableA(str, ptr, size);
+   RETURN_STRING(ptr, 0);
+   }
+#else
/* system method returns a const */
ptr = getenv(str);
if (ptr) {
RETURN_RT_STRING(ptr, ZSTR_DUPLICATE);
}
-
+#endif
RETURN_FALSE;
 }
 /* }}} */
@@ -4419,14 +4447,33 @@
if (setting_len) {
char *p, **env;
putenv_entry pe;
+#ifdef PHP_WIN32
+   char *value = NULL;
+   int equals = 0;
+#endif
 
pe.putenv_string = estrndup(setting, setting_len);
pe.key = estrndup(setting, setting_len);
if ((p = strchr(pe.key, '='))) {/* nullify the '=' if 
there is one */
*p = '\0';
+#ifdef PHP_WIN32
+   equals = 1;
+#endif
}
+
pe.key_len = strlen(pe.key);
 
+#ifdef PHP_WIN32
+   if (equals) {
+   if (pe.key_len < setting_len - 2) {
+   value = p + 1;
+   } else {
+   /* empty string*/
+   value = p;
+   }
+   }
+#endif
+
zend_hash_del(&BG(putenv_ht), pe.key, pe.key_len+1);
 
/* find previous value */
@@ -4443,23 +4490,19 @@
}
}
 
-#if _MSC_VER >= 1300
-   /* VS.Net has a bug in putenv() when setting a variable that
-* is already set; if the SetEnvironmentVariable() API call
-* fails, the Crt will double free() a string.
-* We try to avoid this by setting our own value first */
-   SetEnvironmentVariable(pe.key, "bugbug");
-#endif
-
 #if HAVE_UNSETENV
if (!p) { /* no '=' means we want to unset it */
unsetenv(pe.putenv_string);
}
if (!p || putenv(pe.putenv_string) == 0) { /* success */
 #else
+# ifndef PHP_WIN32
if (putenv(pe.putenv_string) == 0) { /* success */
+# else
+   if (SetEnvironmentVariableA(pe.key, value) != 0) { /* success */
+# endif
 #endif
-   zend_hash_add(&BG(putenv_ht), pe.key, pe.key_len+1, 
(void **) &pe, sizeof(putenv_entry), NULL);
+   zend_hash_add(&BG(putenv_ht), pe.key, pe.key_len + 1, 
(void **) &pe, sizeof(putenv_entry), NULL);
 #ifdef HAVE_TZSET
if (!strncmp(pe.key, "TZ", pe.key_len)) {
tzset();




[PHP-DOC] cvs: php-src(PHP_5_3) /ext/standard basic_functions.c

2008-08-18 Thread Pierre-Alain Joye
pajoye  Mon Aug 18 07:11:01 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/standard   basic_functions.c 
  Log:
  - [DOC] MFH: make putenv behaves like unix putenv on Windows:
   .  FOO=1234 => set FOO to 1234
   .  FOO= => set FOO to an empty string
   .  FOO= => unset FOO
   . Use Set/GetEnvironmnent variable only
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/basic_functions.c?r1=1.725.2.31.2.64.2.52&r2=1.725.2.31.2.64.2.53&diff_format=u
Index: php-src/ext/standard/basic_functions.c
diff -u php-src/ext/standard/basic_functions.c:1.725.2.31.2.64.2.52 
php-src/ext/standard/basic_functions.c:1.725.2.31.2.64.2.53
--- php-src/ext/standard/basic_functions.c:1.725.2.31.2.64.2.52 Sat Aug 16 
11:11:46 2008
+++ php-src/ext/standard/basic_functions.c  Mon Aug 18 07:11:00 2008
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: basic_functions.c,v 1.725.2.31.2.64.2.52 2008/08/16 11:11:46 bjori Exp 
$ */
+/* $Id: basic_functions.c,v 1.725.2.31.2.64.2.53 2008/08/18 07:11:00 pajoye 
Exp $ */
 
 #include "php.h"
 #include "php_streams.h"
@@ -63,7 +63,11 @@
 #include 
 #endif
 
-#include
+#ifndef PHP_WIN32
+# include
+#else
+# include "win32/inet.h"
+#endif
 
 #if HAVE_ARPA_INET_H
 # include 
@@ -3874,10 +3878,6 @@
 # if HAVE_UNSETENV
unsetenv(pe->key);
 # elif defined(PHP_WIN32)
-   char *del_string = emalloc(pe->key_len+2);
-   snprintf(del_string, pe->key_len+2, "%s=", pe->key);
-   putenv(del_string);
-   efree(del_string);
SetEnvironmentVariable(pe->key, NULL);
 # else
char **env;
@@ -4402,13 +4402,37 @@
if (ptr) {
RETURN_STRING(ptr, 0);
}
+#ifdef PHP_WIN32
+   {
+   char dummybuf;
+   int size;
 
+   SetLastError(0);
+   /*If the given bugger is not large enough to hold the data, the 
return value is 
+   the buffer size,  in characters, required to hold the string 
and its terminating 
+   null character. We use this return value to alloc the final 
buffer. */
+   size = GetEnvironmentVariableA(str, &dummybuf, 0);
+   if (GetLastError() == ERROR_ENVVAR_NOT_FOUND) {
+   /* The environment variable doesn't exist. */
+   RETURN_FALSE;
+   }
+
+   if (size == 0) {
+   /* env exists, but it is empty */
+   RETURN_EMPTY_STRING();
+   }
+
+   ptr = emalloc(size);
+   size = GetEnvironmentVariableA(str, ptr, size);
+   RETURN_STRING(ptr, 0);
+   }
+#else
/* system method returns a const */
ptr = getenv(str);
if (ptr) {
RETURN_STRING(ptr, 1);
}
-
+#endif
RETURN_FALSE;
 }
 /* }}} */
@@ -4428,13 +4452,31 @@
if (setting_len) {
char *p, **env;
putenv_entry pe;
+#ifdef PHP_WIN32
+   char *value = NULL;
+   int equals = 0;
+#endif
 
pe.putenv_string = estrndup(setting, setting_len);
pe.key = estrndup(setting, setting_len);
if ((p = strchr(pe.key, '='))) {/* nullify the '=' if 
there is one */
*p = '\0';
+#ifdef PHP_WIN32
+   equals = 1;
+#endif
}
+
pe.key_len = strlen(pe.key);
+#ifdef PHP_WIN32
+   if (equals) {
+   if (pe.key_len < setting_len - 2) {
+   value = p + 1;
+   } else {
+   /* empty string*/
+   value = p;
+   }
+   }
+#endif
 
if (PG(safe_mode)) {
/* Check the protected list */
@@ -4485,21 +4527,17 @@
}
}
 
-#if _MSC_VER >= 1300
-   /* VS.Net has a bug in putenv() when setting a variable that
-* is already set; if the SetEnvironmentVariable() API call
-* fails, the Crt will double free() a string.
-* We try to avoid this by setting our own value first */
-   SetEnvironmentVariable(pe.key, "bugbug");
-#endif
-
 #if HAVE_UNSETENV
if (!p) { /* no '=' means we want to unset it */
unsetenv(pe.putenv_string);
}
if (!p || putenv(pe.putenv_string) == 0) { /* success */
 #else
+# ifndef PHP_WIN32
if (putenv(pe.putenv_string) == 0) { /* success */
+# else
+   if (SetEnvironmentVariableA(pe.key, value) != 0) { /* success */
+# endif
 #endif
zend_hash_add(&BG(putenv_ht), pe.key, pe.key_len + 1, 
(void **) &pe, sizeof(putenv_en