[PHP-CVS] cvs: php-src / README.UNICODE-UPGRADES

2005-09-23 Thread Andrei Zmievski
andrei  Fri Sep 23 17:24:31 2005 EDT

  Modified files:  
/php-srcREADME.UNICODE-UPGRADES 
  Log:
  substr() sample case
  
  
http://cvs.php.net/diff.php/php-src/README.UNICODE-UPGRADES?r1=1.4&r2=1.5&ty=u
Index: php-src/README.UNICODE-UPGRADES
diff -u php-src/README.UNICODE-UPGRADES:1.4 php-src/README.UNICODE-UPGRADES:1.5
--- php-src/README.UNICODE-UPGRADES:1.4 Wed Sep 14 14:01:41 2005
+++ php-src/README.UNICODE-UPGRADES Fri Sep 23 17:24:31 2005
@@ -262,6 +262,66 @@
 
 
 
+Upgrading Functions
+===
+
+Let's take a look at a couple of functions that have been upgraded to
+support new string types.
+
+substr()
+
+
+This functions returns part of a string based on offset and length
+parameters.
+
+   void *str;
+   int32_t str_len, cp_len;
+   zend_uchar str_type;
+
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "tl|l", &str, 
&str_len, &str_type, &f, &l) == FAILURE) {
+   return;
+   }
+
+The first thing we notice is that the incoming string specifier is 't',
+which means that we can accept all 3 string types. The 'str' variable is
+declared as void*, because it can point to either UChar* or char*.
+The actual type of the incoming string is stored in 'str_type' variable.
+
+   if (str_type == IS_UNICODE) {
+   cp_len = u_countChar32(str, str_len);
+   } else {
+   cp_len = str_len;
+   }
+
+If the string is a Unicode one, we cannot rely on the str_len value to tell
+us the number of characters in it. Instead, we call u_countChar32() to
+obtain it.
+
+The next several lines normalize start and length parameters to fit within the
+string. Nothing new here. Then we locate the appropriate segment.
+
+   if (str_type == IS_UNICODE) {
+   int32_t start = 0, end = 0;
+   U16_FWD_N((UChar*)str, end, str_len, f);
+   start = end;
+   U16_FWD_N((UChar*)str, end, str_len, l);
+   RETURN_UNICODEL((UChar*)str + start, end-start, 1);
+
+Since codepoint (character) #n is not necessarily at offset #n in Unicode
+strings, we start at the beginning and iterate forward until we have gone
+through the required number of codepoints to reach the start of the segment.
+Then we save the location in 'start' and continue iterating through the number
+of codepoints specified by the offset. Once that's done, we can return the
+segment as a Unicode string.
+
+   } else {
+   RETURN_STRINGL((char*)str + f, l, 1);
+   }
+
+For native and binary types, we can return the segment directly.
+
+
+
 References
 ==
 

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



Re: [PHP-CVS] cvs: php-src(PHP_5_1) /ext/sockets config.m4 sockets.c

2005-09-23 Thread Jani Taskinen
In-Reply-To: <[EMAIL PROTECTED]>
Message-ID: <[EMAIL PROTECTED]>
References: <[EMAIL PROTECTED]>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed


 This is now the 2nd commit by you today which was NOT put into HEAD!!!
 ALWAYS COMMIT TO HEAD FIRST!!!

 --Jani


On Fri, 23 Sep 2005, Anantha Kesari H Y wrote:

>
> hyanantha Fri Sep 23 05:54:34 2005 EDT
>
>  Modified files:  (Branch: PHP_5_1)
>/php-src/ext/sockets   config.m4 sockets.c
>  Log:
>  NetWare LibC don't have socketpair function. So enabling socket_create_pair 
> functionality only if socketpair is available in the host LibC.
>  --Kamesh
>
>
> http://cvs.php.net/diff.php/php-src/ext/sockets/config.m4?r1=1.15&r2=1.15.4.1&ty=u
> Index: php-src/ext/sockets/config.m4
> diff -u php-src/ext/sockets/config.m4:1.15 
> php-src/ext/sockets/config.m4:1.15.4.1
> --- php-src/ext/sockets/config.m4:1.15Mon Jul  7 23:38:00 2003
> +++ php-src/ext/sockets/config.m4 Fri Sep 23 05:54:31 2005
> @@ -1,5 +1,5 @@
> dnl
> -dnl $Id: config.m4,v 1.15 2003/07/08 03:38:00 pollita Exp $
> +dnl $Id: config.m4,v 1.15.4.1 2005/09/23 09:54:31 hyanantha Exp $
> dnl
>
> PHP_ARG_ENABLE(sockets, whether to enable sockets support,
> @@ -31,5 +31,6 @@
>   PHP_NEW_EXTENSION([sockets], [sockets.c], [$ext_shared])
> fi
>
> +PHP_CHECK_FUNC(socketpair)
> PHP_CHECK_FUNC(gethostbyname2)
>
> http://cvs.php.net/diff.php/php-src/ext/sockets/sockets.c?r1=1.171&r2=1.171.2.1&ty=u
> Index: php-src/ext/sockets/sockets.c
> diff -u php-src/ext/sockets/sockets.c:1.171 
> php-src/ext/sockets/sockets.c:1.171.2.1
> --- php-src/ext/sockets/sockets.c:1.171   Wed Aug  3 10:07:52 2005
> +++ php-src/ext/sockets/sockets.c Fri Sep 23 05:54:31 2005
> @@ -19,7 +19,7 @@
>+--+
>  */
>
> -/* $Id: sockets.c,v 1.171 2005/08/03 14:07:52 sniper Exp $ */
> +/* $Id: sockets.c,v 1.171.2.1 2005/09/23 09:54:31 hyanantha Exp $ */
>
> #ifdef HAVE_CONFIG_H
> #include "config.h"
> @@ -116,7 +116,9 @@
>   PHP_FE(socket_select,   
> first_through_third_args_force_ref)
>   PHP_FE(socket_create,   NULL)
>   PHP_FE(socket_create_listen,NULL)
> +#ifdef HAVE_SOCKETPAIR
>   PHP_FE(socket_create_pair,  fourth_arg_force_ref)
> +#endif
>   PHP_FE(socket_accept,   NULL)
>   PHP_FE(socket_set_nonblock, NULL)
>   PHP_FE(socket_set_block,NULL)
> @@ -1652,6 +1654,7 @@
> }
> /* }}} */
>
> +#ifdef HAVE_SOCKETPAIR
> /* {{{ proto bool socket_create_pair(int domain, int type, int protocol, 
> array &fd)
>Creates a pair of indistinguishable sockets and stores them in fds. */
> PHP_FUNCTION(socket_create_pair)
> @@ -1711,6 +1714,7 @@
>   RETURN_TRUE;
> }
> /* }}} */
> +#endif
>
> /* {{{ proto bool socket_shutdown(resource socket[, int how])
>Shuts down a socket for receiving, sending, or both. */
>
>

-- 
Donate @ 
Disclaimer: Donating money may make me happier and friendlier for a limited 
period!

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



[PHP-CVS] cvs: php-src(PHP_5_0) /ext/sockets config.m4 sockets.c

2005-09-23 Thread Anantha Kesari H Y
hyanantha   Fri Sep 23 06:01:07 2005 EDT

  Modified files:  (Branch: PHP_5_0)
/php-src/ext/socketssockets.c config.m4 
  Log:
  NetWare LibC don't have socketpair function. So enabling socket_create_pair 
functionality only if socketpair is available in the host LibC.
  --Kamesh
  
  
  
http://cvs.php.net/diff.php/php-src/ext/sockets/sockets.c?r1=1.165.2.4&r2=1.165.2.5&ty=u
Index: php-src/ext/sockets/sockets.c
diff -u php-src/ext/sockets/sockets.c:1.165.2.4 
php-src/ext/sockets/sockets.c:1.165.2.5
--- php-src/ext/sockets/sockets.c:1.165.2.4 Thu May 12 12:27:05 2005
+++ php-src/ext/sockets/sockets.c   Fri Sep 23 06:01:06 2005
@@ -19,7 +19,7 @@
+--+
  */
 
-/* $Id: sockets.c,v 1.165.2.4 2005/05/12 16:27:05 tony2001 Exp $ */
+/* $Id: sockets.c,v 1.165.2.5 2005/09/23 10:01:06 hyanantha Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -116,7 +116,9 @@
PHP_FE(socket_select,   
first_through_third_args_force_ref)
PHP_FE(socket_create,   NULL)
PHP_FE(socket_create_listen,NULL)
+#ifdef HAVE_SOCKETPAIR
PHP_FE(socket_create_pair,  fourth_arg_force_ref)
+#endif
PHP_FE(socket_accept,   NULL)
PHP_FE(socket_set_nonblock, NULL)
PHP_FE(socket_set_block,NULL)
@@ -1652,6 +1654,7 @@
 }
 /* }}} */
 
+#ifdef HAVE_SOCKETPAIR
 /* {{{ proto bool socket_create_pair(int domain, int type, int protocol, array 
&fd)
Creates a pair of indistinguishable sockets and stores them in fds. */
 PHP_FUNCTION(socket_create_pair)
@@ -1711,6 +1714,7 @@
RETURN_TRUE;
 }
 /* }}} */
+#endif
 
 /* {{{ proto bool socket_shutdown(resource socket[, int how])
Shuts down a socket for receiving, sending, or both. */
http://cvs.php.net/diff.php/php-src/ext/sockets/config.m4?r1=1.15&r2=1.15.2.1&ty=u
Index: php-src/ext/sockets/config.m4
diff -u php-src/ext/sockets/config.m4:1.15 
php-src/ext/sockets/config.m4:1.15.2.1
--- php-src/ext/sockets/config.m4:1.15  Mon Jul  7 23:38:00 2003
+++ php-src/ext/sockets/config.m4   Fri Sep 23 06:01:06 2005
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: config.m4,v 1.15 2003/07/08 03:38:00 pollita Exp $
+dnl $Id: config.m4,v 1.15.2.1 2005/09/23 10:01:06 hyanantha Exp $
 dnl
 
 PHP_ARG_ENABLE(sockets, whether to enable sockets support,
@@ -31,5 +31,6 @@
   PHP_NEW_EXTENSION([sockets], [sockets.c], [$ext_shared])
 fi
 
+PHP_CHECK_FUNC(socketpair)
 PHP_CHECK_FUNC(gethostbyname2)
 

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



[PHP-CVS] cvs: php-src(PHP_5_1) /ext/sockets config.m4 sockets.c

2005-09-23 Thread Anantha Kesari H Y
hyanantha   Fri Sep 23 05:54:34 2005 EDT

  Modified files:  (Branch: PHP_5_1)
/php-src/ext/socketsconfig.m4 sockets.c 
  Log:
  NetWare LibC don't have socketpair function. So enabling socket_create_pair 
functionality only if socketpair is available in the host LibC.
  --Kamesh
  
  
http://cvs.php.net/diff.php/php-src/ext/sockets/config.m4?r1=1.15&r2=1.15.4.1&ty=u
Index: php-src/ext/sockets/config.m4
diff -u php-src/ext/sockets/config.m4:1.15 
php-src/ext/sockets/config.m4:1.15.4.1
--- php-src/ext/sockets/config.m4:1.15  Mon Jul  7 23:38:00 2003
+++ php-src/ext/sockets/config.m4   Fri Sep 23 05:54:31 2005
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: config.m4,v 1.15 2003/07/08 03:38:00 pollita Exp $
+dnl $Id: config.m4,v 1.15.4.1 2005/09/23 09:54:31 hyanantha Exp $
 dnl
 
 PHP_ARG_ENABLE(sockets, whether to enable sockets support,
@@ -31,5 +31,6 @@
   PHP_NEW_EXTENSION([sockets], [sockets.c], [$ext_shared])
 fi
 
+PHP_CHECK_FUNC(socketpair)
 PHP_CHECK_FUNC(gethostbyname2)
 
http://cvs.php.net/diff.php/php-src/ext/sockets/sockets.c?r1=1.171&r2=1.171.2.1&ty=u
Index: php-src/ext/sockets/sockets.c
diff -u php-src/ext/sockets/sockets.c:1.171 
php-src/ext/sockets/sockets.c:1.171.2.1
--- php-src/ext/sockets/sockets.c:1.171 Wed Aug  3 10:07:52 2005
+++ php-src/ext/sockets/sockets.c   Fri Sep 23 05:54:31 2005
@@ -19,7 +19,7 @@
+--+
  */
 
-/* $Id: sockets.c,v 1.171 2005/08/03 14:07:52 sniper Exp $ */
+/* $Id: sockets.c,v 1.171.2.1 2005/09/23 09:54:31 hyanantha Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -116,7 +116,9 @@
PHP_FE(socket_select,   
first_through_third_args_force_ref)
PHP_FE(socket_create,   NULL)
PHP_FE(socket_create_listen,NULL)
+#ifdef HAVE_SOCKETPAIR
PHP_FE(socket_create_pair,  fourth_arg_force_ref)
+#endif
PHP_FE(socket_accept,   NULL)
PHP_FE(socket_set_nonblock, NULL)
PHP_FE(socket_set_block,NULL)
@@ -1652,6 +1654,7 @@
 }
 /* }}} */
 
+#ifdef HAVE_SOCKETPAIR
 /* {{{ proto bool socket_create_pair(int domain, int type, int protocol, array 
&fd)
Creates a pair of indistinguishable sockets and stores them in fds. */
 PHP_FUNCTION(socket_create_pair)
@@ -1711,6 +1714,7 @@
RETURN_TRUE;
 }
 /* }}} */
+#endif
 
 /* {{{ proto bool socket_shutdown(resource socket[, int how])
Shuts down a socket for receiving, sending, or both. */

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



[PHP-CVS] cvs: php-src(PHP_5_1) / acinclude.m4

2005-09-23 Thread Jani Taskinen
sniper  Fri Sep 23 05:40:24 2005 EDT

  Modified files:  (Branch: PHP_5_1)
/php-srcacinclude.m4 
  Log:
  ws fix
  
http://cvs.php.net/diff.php/php-src/acinclude.m4?r1=1.332.2.4&r2=1.332.2.5&ty=u
Index: php-src/acinclude.m4
diff -u php-src/acinclude.m4:1.332.2.4 php-src/acinclude.m4:1.332.2.5
--- php-src/acinclude.m4:1.332.2.4  Fri Sep 23 05:25:18 2005
+++ php-src/acinclude.m4Fri Sep 23 05:40:24 2005
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: acinclude.m4,v 1.332.2.4 2005/09/23 09:25:18 hyanantha Exp $
+dnl $Id: acinclude.m4,v 1.332.2.5 2005/09/23 09:40:24 sniper Exp $
 dnl
 dnl This file contains local autoconf functions.
 dnl
@@ -255,14 +255,14 @@
 
 dnl choose the right compiler/flags/etc. for the source-file
   case $ac_src in
- *.c[)] ac_comp="$b_c_pre $3 $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o 
$ac_bdir$ac_obj.$b_lo $6$b_c_post" ;;
- *.s[)] ac_comp="$b_c_pre $3 $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o 
$ac_bdir$ac_obj.$b_lo $6$b_c_post" ;;
- *.S[)] ac_comp="$b_c_pre $3 $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o 
$ac_bdir$ac_obj.$b_lo $6$b_c_post" ;;
- *.cpp|*.cc|*.cxx[)] ac_comp="$b_cxx_pre $3 $ac_inc $b_cxx_meta -c 
$ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $6$b_cxx_post" ;;
+*.c[)] ac_comp="$b_c_pre $3 $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o 
$ac_bdir$ac_obj.$b_lo $6$b_c_post" ;;
+*.s[)] ac_comp="$b_c_pre $3 $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o 
$ac_bdir$ac_obj.$b_lo $6$b_c_post" ;;
+*.S[)] ac_comp="$b_c_pre $3 $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o 
$ac_bdir$ac_obj.$b_lo $6$b_c_post" ;;
+*.cpp|*.cc|*.cxx[)] ac_comp="$b_cxx_pre $3 $ac_inc $b_cxx_meta -c 
$ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $6$b_cxx_post" ;;
   esac
 
 dnl create a rule for the object/source combo
- cat >>Makefile.objects<>Makefile.objects/dev/null`
   case $os in
 SunOS*[)]
- AC_DEFINE(HAVE_BROKEN_GETCWD,1, [Define if system has broken getcwd])
- AC_MSG_RESULT([yes]);;
-   *[)]
- AC_MSG_RESULT([no]);;
+  AC_DEFINE(HAVE_BROKEN_GETCWD,1, [Define if system has broken getcwd])
+  AC_MSG_RESULT([yes]);;
+*[)]
+  AC_MSG_RESULT([no]);;
   esac
 ])
 
@@ -1583,8 +1585,8 @@
   
   fp = fopen(filename, "w");
   if (fp == NULL) {
- perror("fopen");
- exit(2);
+perror("fopen");
+exit(2);
   }
   fputs("foobar", fp);
   fclose(fp);
@@ -1594,7 +1596,7 @@
   fclose(fp);
   unlink(filename);
   if (position == 0)
-   return 1;
+  return 1;
   return 0;
 }
 ],
@@ -1612,10 +1614,10 @@
 )])
 
   if test "$have_broken_glibc_fopen_append" = "yes"; then
-   AC_MSG_RESULT(yes)
-   AC_DEFINE(HAVE_BROKEN_GLIBC_FOPEN_APPEND,1, [Define if your glibc borks 
on fopen with mode a+])
+AC_MSG_RESULT(yes)
+AC_DEFINE(HAVE_BROKEN_GLIBC_FOPEN_APPEND,1, [Define if your glibc borks on 
fopen with mode a+])
   else
-   AC_MSG_RESULT(no)
+AC_MSG_RESULT(no)
   fi
 ])
 
@@ -1644,7 +1646,7 @@
 #include 
 
 struct cookiedata {
-   __off64_t pos;
+  __off64_t pos;
 };
 
 __ssize_t reader(void *cookie, char *buffer, size_t size)
@@ -1663,7 +1665,7 @@
   FILE *fp = fopencookie(&g, "r", funcs);
 
   if (fp && fseek(fp, 8192, SEEK_SET) == 0 && g.pos == 8192)
- exit(0);
+exit(0);
   exit(1);
 }
 
@@ -1897,14 +1899,14 @@
   [
 int main(void)
 {
-   short one = 1;
-   char *cp = (char *)&one;
+  short one = 1;
+  char *cp = (char *)&one;
 
-   if (*cp == 0) {
-   return(0);
-   } else {
-   return(1);
-   }
+  if (*cp == 0) {
+return(0);
+  } else {
+return(1);
+  }
 }
   ], [ac_cv_c_bigendian_php=yes], [ac_cv_c_bigendian_php=no], 
[ac_cv_c_bigendian_php=unknown])
  ])

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



[PHP-CVS] cvs: php-src(PHP_5_1) / acinclude.m4

2005-09-23 Thread Anantha Kesari H Y
hyanantha   Fri Sep 23 05:25:19 2005 EDT

  Modified files:  (Branch: PHP_5_1)
/php-srcacinclude.m4 
  Log:
  In NetWare two binaries with the same name can not be loaded in kernel 
address space(This is the default behaviour for NetWare apache webserver and 
hence PHP extensions also get loaded in kernel address space) simultaneoulsy. 
As the current autoconf built mysql extension is built as mysql.nlm this 
forbids the loading of mysql client binary. To work around this NetWare 
idiosyncrasy prefixing all the extensions with "php" except php5lib(phpts.dll 
eqivalent of Windows). I could have named this extensions prefixed with "php_" 
but "_" is eaten from the exported symbol prefix by the GCC cross compiler for 
NetWare so sticking to "php".
  This fixes the issue of not needing "PHP_SUBST(EXTENSIONNAME_SHARED_LIBADD)" 
in all the extensions especially when they need to be built shared.
  
  --Kamesh 
  
  
http://cvs.php.net/diff.php/php-src/acinclude.m4?r1=1.332.2.3&r2=1.332.2.4&ty=u
Index: php-src/acinclude.m4
diff -u php-src/acinclude.m4:1.332.2.3 php-src/acinclude.m4:1.332.2.4
--- php-src/acinclude.m4:1.332.2.3  Thu Sep  1 04:25:52 2005
+++ php-src/acinclude.m4Fri Sep 23 05:25:18 2005
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: acinclude.m4,v 1.332.2.3 2005/09/01 08:25:52 sniper Exp $
+dnl $Id: acinclude.m4,v 1.332.2.4 2005/09/23 09:25:18 hyanantha Exp $
 dnl
 dnl This file contains local autoconf functions.
 dnl
@@ -856,7 +856,7 @@
   ;;
 *netware*[)]
   suffix=nlm
-  link_cmd='$(LIBTOOL) --mode=link ifelse($4,,[$(CC)],[$(CXX)]) 
$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o [$]@ -shared 
-export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) 
$(EXTRA_LDFLAGS) $($2) $(translit($1,a-z_-,A-Z__)_SHARED_LIBADD)'
+  link_cmd='$(LIBTOOL) --mode=link ifelse($4,,[$(CC)],[$(CXX)]) 
$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o [$]@ -shared 
-export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) 
$(EXTRA_LDFLAGS) $($2) ifelse($1, php5lib, , -L$(top_builddir)/netware 
-lphp5lib) $(translit(ifelse($1, php5lib, $1, m4_substr($1, 
3)),a-z_-,A-Z__)_SHARED_LIBADD)'
   ;;
 *[)]
   suffix=la
@@ -952,10 +952,12 @@
   PHP_ADD_SOURCES_X(PHP_EXT_DIR($1),$2,$ac_extra,shared_objects_$1,yes)
   case $host_alias in
   *netware*)
-PHP_ADD_LIBRARY_WITH_PATH(php5lib, netware, 
translit($1,a-z_-,A-Z__)_SHARED_LIBADD)
+   PHP_SHARED_MODULE(php$1,shared_objects_$1, $ext_builddir, $6)
+   ;;
+  *)
+   PHP_SHARED_MODULE($1,shared_objects_$1, $ext_builddir, $6)
   ;;
   esac
-  PHP_SHARED_MODULE($1,shared_objects_$1, $ext_builddir, $6)
   AC_DEFINE_UNQUOTED([COMPILE_DL_]translit($1,a-z_-,A-Z__), 1, Whether to 
build $1 as dynamic module)
 fi
   fi

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



[PHP-CVS] cvs: php-src(PHP_4_4) / acinclude.m4

2005-09-23 Thread Anantha Kesari H Y
hyanantha   Fri Sep 23 05:20:25 2005 EDT

  Modified files:  (Branch: PHP_4_4)
/php-srcacinclude.m4 
  Log:
  In NetWare two binaries with the same name can not be loaded in kernel 
address space(This is the default behaviour for NetWare apache webserver and 
hence PHP extensions also get loaded in kernel address space) simultaneoulsy. 
As the current autoconf built mysql extension is built as mysql.nlm this 
forbids the loading of mysql client binary. To work around this NetWare 
idiosyncrasy prefixing all the extensions with "php" except php5lib(phpts.dll 
eqivalent of Windows). I could have named this extensions prefixed with "php_" 
but "_" is eaten from the exported symbol prefix by the GCC cross compiler for 
NetWare so sticking to "php".
  This fixes the issue of not needing "PHP_SUBST(EXTENSIONNAME_SHARED_LIBADD)" 
in all the extensions especially when they need to be built shared.
  
  --Kamesh 
  
  
http://cvs.php.net/diff.php/php-src/acinclude.m4?r1=1.218.2.50.2.4&r2=1.218.2.50.2.5&ty=u
Index: php-src/acinclude.m4
diff -u php-src/acinclude.m4:1.218.2.50.2.4 php-src/acinclude.m4:1.218.2.50.2.5
--- php-src/acinclude.m4:1.218.2.50.2.4 Wed Jul 27 07:58:28 2005
+++ php-src/acinclude.m4Fri Sep 23 05:20:22 2005
@@ -1,4 +1,4 @@
-dnl $Id: acinclude.m4,v 1.218.2.50.2.4 2005/07/27 11:58:28 hyanantha Exp $ -*- 
autoconf -*-
+dnl $Id: acinclude.m4,v 1.218.2.50.2.5 2005/09/23 09:20:22 hyanantha Exp $ -*- 
autoconf -*-
 dnl
 dnl This file contains local autoconf functions.
 
@@ -1197,7 +1197,7 @@
   ;;
 *netware*[)]
   suffix=nlm
-  link_cmd='$(LIBTOOL) --mode=link ifelse($4,,[$(CC)],[$(CXX)]) 
$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o [$]@ -shared 
-export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) 
$(EXTRA_LDFLAGS) $($2) $(translit($1,a-z_-,A-Z__)_SHARED_LIBADD)'
+  link_cmd='$(LIBTOOL) --mode=link ifelse($4,,[$(CC)],[$(CXX)]) 
$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o [$]@ -shared 
-export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) 
$(EXTRA_LDFLAGS) $($2) ifelse($1, php4lib, , -L$(top_builddir)/netware 
-lphp4lib) $(translit(ifelse($1, php4lib, $1, m4_substr($1, 
3)),a-z_-,A-Z__)_SHARED_LIBADD)'
   ;;
 *[)]
   suffix=la
@@ -1289,10 +1289,12 @@
   PHP_ADD_SOURCES_X(PHP_EXT_DIR($1),$2,$ac_extra,shared_objects_$1,yes)
   case $host_alias in
   *netware*)
-PHP_ADD_LIBRARY_WITH_PATH(php4lib, netware, 
translit($1,a-z_-,A-Z__)_SHARED_LIBADD)
+   PHP_SHARED_MODULE(php$1,shared_objects_$1, $ext_builddir, $6)
+   ;;
+  *)
+   PHP_SHARED_MODULE($1,shared_objects_$1, $ext_builddir, $6)
   ;;
   esac
-  PHP_SHARED_MODULE($1,shared_objects_$1, $ext_builddir, $6)
   AC_DEFINE_UNQUOTED([COMPILE_DL_]translit($1,a-z_-,A-Z__), 1, Whether to 
build $1 as dynamic module)
 fi
   fi

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



Re: [PHP-CVS] cvs: php-src(PHP_5_0) / acinclude.m4

2005-09-23 Thread Jani Taskinen


Why are you committing only to PHP_5_0 branch and not in
HEAD and PHP_5_1??

--Jani


On Fri, 23 Sep 2005, Anantha Kesari H Y wrote:



hyanantha   Fri Sep 23 04:27:54 2005 EDT

 Modified files:  (Branch: PHP_5_0)
   /php-src acinclude.m4
 Log:
 In NetWare two binaries with the same name can not be loaded in kernel address space(This is the default behaviour for 
NetWare apache webserver and hence PHP extensions also get loaded in kernel address space) simultaneoulsy. As the 
current autoconf built mysql extension is built as mysql.nlm this forbids the loading of mysql client binary. To work 
around this NetWare idiosyncrasy prefixing all the extensions with "php" except php5lib(phpts.dll eqivalent 
of Windows). I could have named this extensions prefixed with "php_" but "_" is eaten by the 
exported symbol prefix by the GCC cross compiler for NetWare so sticking to "php".
 This fixes the issue of not needing "PHP_SUBST(EXTENSIONNAME_SHARED_LIBADD)" 
in all the extensions especially when they need to be built shared.

 --Kamesh



http://cvs.php.net/diff.php/php-src/acinclude.m4?r1=1.271.2.22&r2=1.271.2.23&ty=u
Index: php-src/acinclude.m4
diff -u php-src/acinclude.m4:1.271.2.22 php-src/acinclude.m4:1.271.2.23
--- php-src/acinclude.m4:1.271.2.22 Mon Jul 25 18:31:07 2005
+++ php-src/acinclude.m4Fri Sep 23 04:27:52 2005
@@ -1,4 +1,4 @@
-dnl $Id: acinclude.m4,v 1.271.2.22 2005/07/25 22:31:07 helly Exp $ -*- 
autoconf -*-
+dnl $Id: acinclude.m4,v 1.271.2.23 2005/09/23 08:27:52 hyanantha Exp $ -*- 
autoconf -*-
dnl
dnl This file contains local autoconf functions.

@@ -1197,7 +1197,7 @@
  ;;
*netware*[)]
  suffix=nlm
-  link_cmd='$(LIBTOOL) --mode=link ifelse($4,,[$(CC)],[$(CXX)]) 
$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o [$]@ -shared 
-export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) 
$(EXTRA_LDFLAGS) $($2) $(translit($1,a-z_-,A-Z__)_SHARED_LIBADD)'
+  link_cmd='$(LIBTOOL) --mode=link ifelse($4,,[$(CC)],[$(CXX)]) 
$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o [$]@ -shared 
-export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) 
$(EXTRA_LDFLAGS) $($2) ifelse($1, php5lib, , -L$(top_builddir)/netware 
-lphp5lib) $(translit(ifelse($1, php5lib, $1, m4_substr($1, 
3)),a-z_-,A-Z__)_SHARED_LIBADD)'
  ;;
*[)]
  suffix=la
@@ -1289,10 +1289,12 @@
  PHP_ADD_SOURCES_X(PHP_EXT_DIR($1),$2,$ac_extra,shared_objects_$1,yes)
  case $host_alias in
  *netware*)
-PHP_ADD_LIBRARY_WITH_PATH(php5lib, netware, 
translit($1,a-z_-,A-Z__)_SHARED_LIBADD)
+   PHP_SHARED_MODULE(php$1,shared_objects_$1, $ext_builddir, $6)
+   ;;
+  *)
+   PHP_SHARED_MODULE($1,shared_objects_$1, $ext_builddir, $6)
  ;;
  esac
-  PHP_SHARED_MODULE($1,shared_objects_$1, $ext_builddir, $6)
  AC_DEFINE_UNQUOTED([COMPILE_DL_]translit($1,a-z_-,A-Z__), 1, Whether to 
build $1 as dynamic module)
fi
  fi




--
Donate @ 
Disclaimer: Donating money may make me happier and friendlier for a limited 
period!

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



[PHP-CVS] cvs: php-src(PHP_5_0) / acinclude.m4

2005-09-23 Thread Anantha Kesari H Y
hyanantha   Fri Sep 23 04:27:54 2005 EDT

  Modified files:  (Branch: PHP_5_0)
/php-srcacinclude.m4 
  Log:
  In NetWare two binaries with the same name can not be loaded in kernel 
address space(This is the default behaviour for NetWare apache webserver and 
hence PHP extensions also get loaded in kernel address space) simultaneoulsy. 
As the current autoconf built mysql extension is built as mysql.nlm this 
forbids the loading of mysql client binary. To work around this NetWare 
idiosyncrasy prefixing all the extensions with "php" except php5lib(phpts.dll 
eqivalent of Windows). I could have named this extensions prefixed with "php_" 
but "_" is eaten by the exported symbol prefix by the GCC cross compiler for 
NetWare so sticking to "php".
  This fixes the issue of not needing "PHP_SUBST(EXTENSIONNAME_SHARED_LIBADD)" 
in all the extensions especially when they need to be built shared.
  
  --Kamesh
  
  
  
http://cvs.php.net/diff.php/php-src/acinclude.m4?r1=1.271.2.22&r2=1.271.2.23&ty=u
Index: php-src/acinclude.m4
diff -u php-src/acinclude.m4:1.271.2.22 php-src/acinclude.m4:1.271.2.23
--- php-src/acinclude.m4:1.271.2.22 Mon Jul 25 18:31:07 2005
+++ php-src/acinclude.m4Fri Sep 23 04:27:52 2005
@@ -1,4 +1,4 @@
-dnl $Id: acinclude.m4,v 1.271.2.22 2005/07/25 22:31:07 helly Exp $ -*- 
autoconf -*-
+dnl $Id: acinclude.m4,v 1.271.2.23 2005/09/23 08:27:52 hyanantha Exp $ -*- 
autoconf -*-
 dnl
 dnl This file contains local autoconf functions.
 
@@ -1197,7 +1197,7 @@
   ;;
 *netware*[)]
   suffix=nlm
-  link_cmd='$(LIBTOOL) --mode=link ifelse($4,,[$(CC)],[$(CXX)]) 
$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o [$]@ -shared 
-export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) 
$(EXTRA_LDFLAGS) $($2) $(translit($1,a-z_-,A-Z__)_SHARED_LIBADD)'
+  link_cmd='$(LIBTOOL) --mode=link ifelse($4,,[$(CC)],[$(CXX)]) 
$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o [$]@ -shared 
-export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) 
$(EXTRA_LDFLAGS) $($2) ifelse($1, php5lib, , -L$(top_builddir)/netware 
-lphp5lib) $(translit(ifelse($1, php5lib, $1, m4_substr($1, 
3)),a-z_-,A-Z__)_SHARED_LIBADD)'
   ;;
 *[)]
   suffix=la
@@ -1289,10 +1289,12 @@
   PHP_ADD_SOURCES_X(PHP_EXT_DIR($1),$2,$ac_extra,shared_objects_$1,yes)
   case $host_alias in
   *netware*)
-PHP_ADD_LIBRARY_WITH_PATH(php5lib, netware, 
translit($1,a-z_-,A-Z__)_SHARED_LIBADD)
+   PHP_SHARED_MODULE(php$1,shared_objects_$1, $ext_builddir, $6)
+   ;;
+  *)
+   PHP_SHARED_MODULE($1,shared_objects_$1, $ext_builddir, $6)
   ;;
   esac
-  PHP_SHARED_MODULE($1,shared_objects_$1, $ext_builddir, $6)
   AC_DEFINE_UNQUOTED([COMPILE_DL_]translit($1,a-z_-,A-Z__), 1, Whether to 
build $1 as dynamic module)
 fi
   fi

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



[PHP-CVS] cvs: php-src(PHP_4_4) /ext/session session.c

2005-09-23 Thread Jani Taskinen
sniper  Fri Sep 23 04:16:02 2005 EDT

  Modified files:  (Branch: PHP_4_4)
/php-src/ext/sessionsession.c 
  Log:
  MFH: Improved the fix for #21306 a bit
  
http://cvs.php.net/diff.php/php-src/ext/session/session.c?r1=1.336.2.53.2.2&r2=1.336.2.53.2.3&ty=u
Index: php-src/ext/session/session.c
diff -u php-src/ext/session/session.c:1.336.2.53.2.2 
php-src/ext/session/session.c:1.336.2.53.2.3
--- php-src/ext/session/session.c:1.336.2.53.2.2Tue Sep 20 16:59:25 2005
+++ php-src/ext/session/session.c   Fri Sep 23 04:16:01 2005
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: session.c,v 1.336.2.53.2.2 2005/09/20 20:59:25 sniper Exp $ */
+/* $Id: session.c,v 1.336.2.53.2.3 2005/09/23 08:16:01 sniper Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -1628,7 +1628,9 @@
 static void php_rshutdown_session_globals(TSRMLS_D)
 {
if (PS(mod_data)) {
-   PS(mod)->s_close(&PS(mod_data) TSRMLS_CC);
+   zend_try {
+   PS(mod)->s_close(&PS(mod_data) TSRMLS_CC);
+   } zend_end_try();
}
if (PS(id)) {
efree(PS(id));
@@ -1665,10 +1667,12 @@
 
 static void php_session_flush(TSRMLS_D)
 {
-   if(PS(session_status)==php_session_active) {
-   php_session_save_current_state(TSRMLS_C);
+   if (PS(session_status) == php_session_active) {
+   PS(session_status) = php_session_none;
+   zend_try {
+   php_session_save_current_state(TSRMLS_C);
+   } zend_end_try();
}
-   PS(session_status)=php_session_none;
 }
 
 /* {{{ proto void session_write_close(void)
@@ -1680,10 +1684,8 @@
 
 PHP_RSHUTDOWN_FUNCTION(session)
 {
-   zend_try {
-   php_session_flush(TSRMLS_C);
-   php_rshutdown_session_globals(TSRMLS_C);
-   } zend_end_try();
+   php_session_flush(TSRMLS_C);
+   php_rshutdown_session_globals(TSRMLS_C);
 
return SUCCESS;
 }

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



[PHP-CVS] cvs: php-src(PHP_5_1) /ext/session session.c

2005-09-23 Thread Jani Taskinen
sniper  Fri Sep 23 04:14:14 2005 EDT

  Modified files:  (Branch: PHP_5_1)
/php-src/ext/sessionsession.c 
  Log:
  MFH: Improved the fix for #21306 a bit
  
http://cvs.php.net/diff.php/php-src/ext/session/session.c?r1=1.417.2.2&r2=1.417.2.3&ty=u
Index: php-src/ext/session/session.c
diff -u php-src/ext/session/session.c:1.417.2.2 
php-src/ext/session/session.c:1.417.2.3
--- php-src/ext/session/session.c:1.417.2.2 Tue Sep 20 16:56:54 2005
+++ php-src/ext/session/session.c   Fri Sep 23 04:14:13 2005
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: session.c,v 1.417.2.2 2005/09/20 20:56:54 sniper Exp $ */
+/* $Id: session.c,v 1.417.2.3 2005/09/23 08:14:13 sniper Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -1756,7 +1756,9 @@
 static void php_rshutdown_session_globals(TSRMLS_D)
 {
if (PS(mod_data)) {
-   PS(mod)->s_close(&PS(mod_data) TSRMLS_CC);
+   zend_try {
+   PS(mod)->s_close(&PS(mod_data) TSRMLS_CC);
+   } zend_end_try();
}
if (PS(id)) {
efree(PS(id));
@@ -1792,9 +1794,11 @@
 
 static void php_session_flush(TSRMLS_D)
 {
-   if(PS(session_status)==php_session_active) {
-   php_session_save_current_state(TSRMLS_C);
-   PS(session_status)=php_session_none;
+   if (PS(session_status) == php_session_active) {
+   PS(session_status) = php_session_none;
+   zend_try {
+   php_session_save_current_state(TSRMLS_C);
+   } zend_end_try();
}
 }
 
@@ -1807,10 +1811,8 @@
 
 PHP_RSHUTDOWN_FUNCTION(session)
 {
-   zend_try {
-   php_session_flush(TSRMLS_C);
-   php_rshutdown_session_globals(TSRMLS_C);
-   } zend_end_try();
+   php_session_flush(TSRMLS_C);
+   php_rshutdown_session_globals(TSRMLS_C);
 
return SUCCESS;
 }

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



[PHP-CVS] cvs: php-src /ext/session session.c

2005-09-23 Thread Jani Taskinen
sniper  Fri Sep 23 04:13:57 2005 EDT

  Modified files:  
/php-src/ext/sessionsession.c 
  Log:
  - Improved the fix for #21306 a bit
  
http://cvs.php.net/diff.php/php-src/ext/session/session.c?r1=1.421&r2=1.422&ty=u
Index: php-src/ext/session/session.c
diff -u php-src/ext/session/session.c:1.421 php-src/ext/session/session.c:1.422
--- php-src/ext/session/session.c:1.421 Tue Sep 20 16:56:21 2005
+++ php-src/ext/session/session.c   Fri Sep 23 04:13:57 2005
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: session.c,v 1.421 2005/09/20 20:56:21 sniper Exp $ */
+/* $Id: session.c,v 1.422 2005/09/23 08:13:57 sniper Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -1758,7 +1758,9 @@
 static void php_rshutdown_session_globals(TSRMLS_D)
 {
if (PS(mod_data)) {
-   PS(mod)->s_close(&PS(mod_data) TSRMLS_CC);
+   zend_try {
+   PS(mod)->s_close(&PS(mod_data) TSRMLS_CC);
+   } zend_end_try();
}
if (PS(id)) {
efree(PS(id));
@@ -1794,9 +1796,11 @@
 
 static void php_session_flush(TSRMLS_D)
 {
-   if(PS(session_status)==php_session_active) {
-   php_session_save_current_state(TSRMLS_C);
-   PS(session_status)=php_session_none;
+   if (PS(session_status) == php_session_active) {
+   PS(session_status) = php_session_none;
+   zend_try {
+   php_session_save_current_state(TSRMLS_C);
+   } zend_end_try();
}
 }
 
@@ -1809,10 +1813,8 @@
 
 PHP_RSHUTDOWN_FUNCTION(session)
 {
-   zend_try {
-   php_session_flush(TSRMLS_C);
-   php_rshutdown_session_globals(TSRMLS_C);
-   } zend_end_try();
+   php_session_flush(TSRMLS_C);
+   php_rshutdown_session_globals(TSRMLS_C);
 
return SUCCESS;
 }

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