[PHP-CVS] svn: /php/php-src/ branches/PHP_5_2/ext/standard/tests/strings/parse_str_basic4.phpt branches/PHP_5_3/ext/standard/tests/strings/parse_str_basic4.phpt trunk/ext/standard/tests/strings/parse_

2009-08-05 Thread andy wharmby
wharmby  Wed, 05 Aug 2009 08:54:27 +

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

Log:
Add new use-case to parse_str() test. Tested on Windows, Linux and Linux 64

Changed paths:
U   
php/php-src/branches/PHP_5_2/ext/standard/tests/strings/parse_str_basic4.phpt
U   
php/php-src/branches/PHP_5_3/ext/standard/tests/strings/parse_str_basic4.phpt
U   php/php-src/trunk/ext/standard/tests/strings/parse_str_basic4.phpt

Modified: 
php/php-src/branches/PHP_5_2/ext/standard/tests/strings/parse_str_basic4.phpt
===
--- 
php/php-src/branches/PHP_5_2/ext/standard/tests/strings/parse_str_basic4.phpt   
2009-08-05 07:03:38 UTC (rev 286827)
+++ 
php/php-src/branches/PHP_5_2/ext/standard/tests/strings/parse_str_basic4.phpt   
2009-08-05 08:54:27 UTC (rev 286828)
@@ -20,6 +20,11 @@
 var_dump(parse_str($str, $res));
 var_dump($res);

+echo \nTest string with badly formed % numbers\n;
+$str = first=%41second=%athird=%b;
+var_dump(parse_str($str));
+var_dump($first, $second, $third);
+
 echo \nTest string with non-binary safe name\n;
 $str = arr.test[1]=sidarr test[4][two]=fred;
 var_dump(parse_str($str, $res));
@@ -59,6 +64,12 @@
   }
 }

+Test string with badly formed % numbers
+NULL
+string(1) A
+string(2) %a
+string(2) %b
+
 Test string with non-binary safe name
 NULL
 array(1) {

Modified: 
php/php-src/branches/PHP_5_3/ext/standard/tests/strings/parse_str_basic4.phpt
===
--- 
php/php-src/branches/PHP_5_3/ext/standard/tests/strings/parse_str_basic4.phpt   
2009-08-05 07:03:38 UTC (rev 286827)
+++ 
php/php-src/branches/PHP_5_3/ext/standard/tests/strings/parse_str_basic4.phpt   
2009-08-05 08:54:27 UTC (rev 286828)
@@ -20,6 +20,11 @@
 var_dump(parse_str($str, $res));
 var_dump($res);

+echo \nTest string with badly formed % numbers\n;
+$str = first=%41second=%athird=%b;
+var_dump(parse_str($str));
+var_dump($first, $second, $third);
+
 echo \nTest string with non-binary safe name\n;
 $str = arr.test[1]=sidarr test[4][two]=fred;
 var_dump(parse_str($str, $res));
@@ -59,6 +64,12 @@
   }
 }

+Test string with badly formed % numbers
+NULL
+string(1) A
+string(2) %a
+string(2) %b
+
 Test string with non-binary safe name
 NULL
 array(1) {

Modified: php/php-src/trunk/ext/standard/tests/strings/parse_str_basic4.phpt
===
--- php/php-src/trunk/ext/standard/tests/strings/parse_str_basic4.phpt  
2009-08-05 07:03:38 UTC (rev 286827)
+++ php/php-src/trunk/ext/standard/tests/strings/parse_str_basic4.phpt  
2009-08-05 08:54:27 UTC (rev 286828)
@@ -20,6 +20,11 @@
 var_dump(parse_str($str, $res));
 var_dump($res);

+echo \nTest string with badly formed % numbers\n;
+$str = first=%41second=%athird=%b;
+var_dump(parse_str($str));
+var_dump($first, $second, $third);
+
 echo \nTest string with non-binary safe name\n;
 $str = arr.test[1]=sidarr test[4][two]=fred;
 var_dump(parse_str($str, $res));
@@ -59,6 +64,12 @@
   }
 }

+Test string with badly formed % numbers
+NULL
+unicode(1) A
+unicode(2) %a
+unicode(2) %b
+
 Test string with non-binary safe name
 NULL
 array(1) {

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

[PHP-CVS] svn: /php/php-src/trunk/ext/skeleton/ php_skeleton.h skeleton.c

2009-08-05 Thread Greg Beaver
cellog   Wed, 05 Aug 2009 15:58:50 +

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

Log:
use x.y.z version number, use a #define for version number

Changed paths:
U   php/php-src/trunk/ext/skeleton/php_skeleton.h
U   php/php-src/trunk/ext/skeleton/skeleton.c

Modified: php/php-src/trunk/ext/skeleton/php_skeleton.h
===
--- php/php-src/trunk/ext/skeleton/php_skeleton.h   2009-08-05 15:47:47 UTC 
(rev 286845)
+++ php/php-src/trunk/ext/skeleton/php_skeleton.h   2009-08-05 15:58:50 UTC 
(rev 286846)
@@ -3,6 +3,8 @@
 #ifndef PHP_EXTNAME_H
 #define PHP_EXTNAME_H

+#define PHP_EXTNAME_VERSION 0.1.0 /* Replace with version number for your 
extension */
+
 extern zend_module_entry extname_module_entry;
 #define phpext_extname_ptr extname_module_entry


Modified: php/php-src/trunk/ext/skeleton/skeleton.c
===
--- php/php-src/trunk/ext/skeleton/skeleton.c   2009-08-05 15:47:47 UTC (rev 
286845)
+++ php/php-src/trunk/ext/skeleton/skeleton.c   2009-08-05 15:58:50 UTC (rev 
286846)
@@ -41,7 +41,7 @@
PHP_RSHUTDOWN(extname), /* Replace with NULL if there's nothing to do 
at request end */
PHP_MINFO(extname),
 #if ZEND_MODULE_API_NO = 20010901
-   0.1, /* Replace with version number for your extension */
+   PHP_EXTNAME_VERSION,
 #endif
STANDARD_MODULE_PROPERTIES
 };

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

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_2/ext/standard/tests/general_functions/is_resource_basic.phpt branches/PHP_5_2/ext/standard/tests/general_functions/is_resource_error.phpt branches/PHP_5_2/

2009-08-05 Thread andy wharmby
wharmby  Wed, 05 Aug 2009 16:10:46 +

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

Log:
Basic test for is_resource() and isset() functions. tested on Windows, Linux 
and Linux 64

Changed paths:
A   
php/php-src/branches/PHP_5_2/ext/standard/tests/general_functions/is_resource_basic.phpt
A   
php/php-src/branches/PHP_5_2/ext/standard/tests/general_functions/is_resource_error.phpt
A   
php/php-src/branches/PHP_5_2/ext/standard/tests/general_functions/isset_basic1.phpt
A   
php/php-src/branches/PHP_5_2/ext/standard/tests/general_functions/isset_basic2.phpt
A   
php/php-src/branches/PHP_5_3/ext/standard/tests/general_functions/is_resource_basic.phpt
A   
php/php-src/branches/PHP_5_3/ext/standard/tests/general_functions/is_resource_error.phpt
A   
php/php-src/branches/PHP_5_3/ext/standard/tests/general_functions/isset_basic1.phpt
A   
php/php-src/branches/PHP_5_3/ext/standard/tests/general_functions/isset_basic2.phpt
A   
php/php-src/trunk/ext/standard/tests/general_functions/is_resource_basic.phpt
A   
php/php-src/trunk/ext/standard/tests/general_functions/is_resource_error.phpt
A   php/php-src/trunk/ext/standard/tests/general_functions/isset_basic1.phpt
A   php/php-src/trunk/ext/standard/tests/general_functions/isset_basic2.phpt

Added: php/php-src/branches/PHP_5_2/ext/standard/tests/general_functions/is_resource_basic.phpt
===
--- php/php-src/branches/PHP_5_2/ext/standard/tests/general_functions/is_resource_basic.phpt	(rev 0)
+++ php/php-src/branches/PHP_5_2/ext/standard/tests/general_functions/is_resource_basic.phpt	2009-08-05 16:10:46 UTC (rev 286847)
@@ -0,0 +1,92 @@
+--TEST--
+Test is_resource() function : basic functionality
+--FILE--
+?php
+/* Prototype  : bool is_resource  ( mixed $var  )
+ * Description:  Finds whether a variable is a resource
+ * Source code: ext/standard/type.c
+ */
+
+echo *** Testing is_resource() : basic functionality ***\n;
+
+class Hello {
+  public function SayHello($arg) {
+  	echo Hello\n;
+  }
+}
+
+
+$vars = array(
+	false,
+	true,
+	10,
+	10.5,
+	Helo World,
+	array(1,2,3,4,5),
+	NULL,
+	new Hello());
+
+$types = array(
+	bool=false,
+	bool=true,
+	integer,
+	double,
+	string,
+	array,
+	NULL,
+	object);
+
+echo \nNon-resource type cases\n;
+
+for ($i=0; $i  count($vars); $i++) {
+	if (is_resource($vars[$i])) {
+		echo $types[$i].  test returns TRUE\n;
+	} else {
+		echo $types[$i].  test returns FALSE\n;
+	}
+}
+
+$res = fopen(__FILE__, r);
+echo \nResource type..var_dump after file open returns\n;
+var_dump($res);
+echo Resource type..after file open  is_resource() returns;
+if (is_resource($res)) {
+	echo  TRUE\n;
+} else {
+	echo  FALSE\n;
+}
+
+fclose($res);
+echo \nResource type..var_dump after file close returns\n;
+var_dump($res);
+echo Resource type..after file close is_resource() returns;
+if (is_resource($res)) {
+	echo  TRUE\n;
+} else {
+	echo  FALSE\n;
+}
+
+
+?
+===DONE===
+--EXPECTF--
+*** Testing is_resource() : basic functionality ***
+
+Non-resource type cases
+bool=false test returns FALSE
+bool=true test returns FALSE
+integer test returns FALSE
+double test returns FALSE
+string test returns FALSE
+array test returns FALSE
+NULL test returns FALSE
+object test returns FALSE
+
+Resource type..var_dump after file open returns
+resource(%d) of type (%s)
+Resource type..after file open  is_resource() returns TRUE
+
+Resource type..var_dump after file close returns
+resource(%d) of type (Unknown)
+Resource type..after file close is_resource() returns FALSE
+===DONE===

Added: php/php-src/branches/PHP_5_2/ext/standard/tests/general_functions/is_resource_error.phpt
===
--- php/php-src/branches/PHP_5_2/ext/standard/tests/general_functions/is_resource_error.phpt	(rev 0)
+++ php/php-src/branches/PHP_5_2/ext/standard/tests/general_functions/is_resource_error.phpt	2009-08-05 16:10:46 UTC (rev 286847)
@@ -0,0 +1,34 @@
+--TEST--
+Test is_resource() function : error conditions
+--FILE--
+?php
+/* Prototype  : bool is_resource  ( mixed $var  )
+ * Description:  Finds whether a variable is a resource
+ * Source code: ext/standard/type.c
+ */
+
+echo *** Testing is_resource() : error conditions ***\n;
+
+echo \n-- Testing is_resource() function with Zero arguments --\n;
+var_dump( is_resource() );
+
+echo \n-- Testing is_resource() function with more than expected no. of arguments --\n;
+$res = fopen(__FILE__, r);
+$extra_arg = 10;
+var_dump( is_resource($res, $extra_arg) );
+
+?
+===DONE===
+--EXPECTF--
+*** Testing is_resource() : error conditions ***
+
+-- Testing is_resource() function with Zero arguments --
+
+Warning: is_resource(): Only one argument expected in %s on line %d
+bool(false)
+
+-- Testing is_resource() function with more than expected no. of arguments --
+
+Warning: 

[PHP-CVS] svn: /php/php-src/branches/PHP_5_3/ NEWS

2009-08-05 Thread Ilia Alshanetsky
iliaaWed, 05 Aug 2009 19:45:13 +

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

Log:
Minor tweak

Changed paths:
U   php/php-src/branches/PHP_5_3/NEWS

Modified: php/php-src/branches/PHP_5_3/NEWS
===
--- php/php-src/branches/PHP_5_3/NEWS   2009-08-05 16:37:46 UTC (rev 286850)
+++ php/php-src/branches/PHP_5_3/NEWS   2009-08-05 19:45:13 UTC (rev 286851)
@@ -18,7 +18,7 @@
   qualified namespaces). (Kalle, Jani)
 - Fixed bug #49074 (private class static fields can be modified by using
   reflection). (Jani)
-- Fixed bug #49108 (2nd scan_dir produces seg fault). (Felipe)
+- Fixed bug #49108 (2nd scan_dir produces segfault). (Felipe)
 - Fixed bug #49065 (disable_functions php.ini option does not work on
   Zend extensions). (Stas)
 - Fixed bug #49064 (--enable-session=shared does not work: undefined symbol:

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

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/configure.in trunk/configure.in

2009-08-05 Thread Scott MacVicar
scottmac Wed, 05 Aug 2009 20:01:33 +

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

Log:
res_search is already checked within ext/standard/config.m4
also check for arpa/nameser_compat.h, OSX puts some old defines in there (not 
used yet)

Changed paths:
U   php/php-src/branches/PHP_5_3/configure.in
U   php/php-src/trunk/configure.in

Modified: php/php-src/branches/PHP_5_3/configure.in
===
--- php/php-src/branches/PHP_5_3/configure.in   2009-08-05 19:45:13 UTC (rev 
286851)
+++ php/php-src/branches/PHP_5_3/configure.in   2009-08-05 20:01:33 UTC (rev 
286852)
@@ -424,6 +424,7 @@
 alloca.h \
 arpa/inet.h \
 arpa/nameser.h \
+arpa/nameser_compat.h \
 assert.h \
 crypt.h \
 fcntl.h \
@@ -599,7 +600,6 @@
 realpath \
 random \
 rand_r \
-res_search \
 scandir \
 setitimer \
 setlocale \

Modified: php/php-src/trunk/configure.in
===
--- php/php-src/trunk/configure.in  2009-08-05 19:45:13 UTC (rev 286851)
+++ php/php-src/trunk/configure.in  2009-08-05 20:01:33 UTC (rev 286852)
@@ -424,6 +424,7 @@
 alloca.h \
 arpa/inet.h \
 arpa/nameser.h \
+arpa/nameser_compat.h \
 assert.h \
 crypt.h \
 fcntl.h \
@@ -599,7 +600,6 @@
 realpath \
 random \
 rand_r \
-res_search \
 scandir \
 setitimer \
 setlocale \

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

[PHP-CVS] svn: /php/phpruntests/trunk/src/testcase/sections/ rtExecutableSection.php

2009-08-05 Thread Zoe Slattery
zoe  Wed, 05 Aug 2009 21:04:55 +

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

Log:
fixing phar/tests/005.phpt on windows

Changed paths:
U   php/phpruntests/trunk/src/testcase/sections/rtExecutableSection.php

Modified: php/phpruntests/trunk/src/testcase/sections/rtExecutableSection.php
===
--- php/phpruntests/trunk/src/testcase/sections/rtExecutableSection.php 
2009-08-05 20:30:21 UTC (rev 286853)
+++ php/phpruntests/trunk/src/testcase/sections/rtExecutableSection.php 
2009-08-05 21:04:55 UTC (rev 286854)
@@ -25,8 +25,9 @@

 protected function writeExecutableFile()
 {
-// @todo I think \n could be replaced with PHP_EOL here - need to 
check on Windows.
-$contentsAsString = implode(\n, $this-sectionContents) . PHP_EOL;
+// Don't even think anout replacing the \n with PHP_EOL
+// It causes stuff (ext/phar/tests/005.phpt) on windows.
+$contentsAsString = implode(\n, $this-sectionContents) . \n;
 file_put_contents($this-fileName,  (binary) $contentsAsString);
 }


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

[PHP-CVS] svn: /php/php-src/branches/ PHP_5_2/ext/date/php_date.c PHP_5_3/ext/date/php_date.c

2009-08-05 Thread Kalle Sommer Nielsen
kalleWed, 05 Aug 2009 21:25:39 +

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

Log:
MFH: Fixed compiler warnings in ext/date

Changed paths:
U   php/php-src/branches/PHP_5_2/ext/date/php_date.c
U   php/php-src/branches/PHP_5_3/ext/date/php_date.c

Modified: php/php-src/branches/PHP_5_2/ext/date/php_date.c
===
--- php/php-src/branches/PHP_5_2/ext/date/php_date.c2009-08-05 21:04:55 UTC 
(rev 286854)
+++ php/php-src/branches/PHP_5_2/ext/date/php_date.c2009-08-05 21:25:39 UTC 
(rev 286855)
@@ -2280,7 +2280,7 @@
 {
zval*object, *element;
php_timezone_obj*tzobj;
-   int  i;
+   unsigned int i;

if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), 
O, object, date_ce_timezone) == FAILURE) {
RETURN_FALSE;

Modified: php/php-src/branches/PHP_5_3/ext/date/php_date.c
===
--- php/php-src/branches/PHP_5_3/ext/date/php_date.c2009-08-05 21:04:55 UTC 
(rev 286854)
+++ php/php-src/branches/PHP_5_3/ext/date/php_date.c2009-08-05 21:25:39 UTC 
(rev 286855)
@@ -3270,7 +3270,7 @@
 {
zval*object, *element;
php_timezone_obj*tzobj;
-   int  i, begin = 0, found;
+   unsigned int i, begin = 0, found;
long timestamp_begin = LONG_MIN, timestamp_end = 
LONG_MAX;

if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), 
O|ll, object, date_ce_timezone, timestamp_begin, timestamp_end) == 
FAILURE) {

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

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/configure.in branches/PHP_5_3/ext/standard/basic_functions.c branches/PHP_5_3/ext/standard/config.m4 branches/PHP_5_3/ext/standard/dns.c branches/PHP_5_3/

2009-08-05 Thread Scott MacVicar
scottmac Wed, 05 Aug 2009 23:20:17 +

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

Log:
Change dns.h to php_dns.h, part of my dns cleanup

Changed paths:
U   php/php-src/branches/PHP_5_3/configure.in
U   php/php-src/branches/PHP_5_3/ext/standard/basic_functions.c
U   php/php-src/branches/PHP_5_3/ext/standard/config.m4
U   php/php-src/branches/PHP_5_3/ext/standard/dns.c
D   php/php-src/branches/PHP_5_3/ext/standard/dns.h
U   php/php-src/branches/PHP_5_3/ext/standard/dns_win32.c
A + php/php-src/branches/PHP_5_3/ext/standard/php_dns.h
(from php/php-src/branches/PHP_5_3/ext/standard/dns.h:r286856)
U   php/php-src/branches/PHP_5_3/ext/standard/php_standard.h
U   php/php-src/trunk/configure.in
U   php/php-src/trunk/ext/standard/basic_functions.c
U   php/php-src/trunk/ext/standard/config.m4
U   php/php-src/trunk/ext/standard/dns.c
D   php/php-src/trunk/ext/standard/dns.h
U   php/php-src/trunk/ext/standard/dns_win32.c
A + php/php-src/trunk/ext/standard/php_dns.h
(from php/php-src/trunk/ext/standard/dns.h:r286850)
U   php/php-src/trunk/ext/standard/php_standard.h
U   php/php-src/trunk/ext/standard/url_scanner_ex.c

Modified: php/php-src/branches/PHP_5_3/configure.in
===
--- php/php-src/branches/PHP_5_3/configure.in	2009-08-05 21:46:09 UTC (rev 286856)
+++ php/php-src/branches/PHP_5_3/configure.in	2009-08-05 23:20:17 UTC (rev 286857)
@@ -423,10 +423,11 @@
 netinet/in.h \
 alloca.h \
 arpa/inet.h \
+arpa/nameser_compat.h \
 arpa/nameser.h \
-arpa/nameser_compat.h \
 assert.h \
 crypt.h \
+dns.h \
 fcntl.h \
 grp.h \
 ieeefp.h \

Modified: php/php-src/branches/PHP_5_3/ext/standard/basic_functions.c
===
--- php/php-src/branches/PHP_5_3/ext/standard/basic_functions.c	2009-08-05 21:46:09 UTC (rev 286856)
+++ php/php-src/branches/PHP_5_3/ext/standard/basic_functions.c	2009-08-05 23:20:17 UTC (rev 286857)
@@ -32,7 +32,7 @@
 #include ext/standard/info.h
 #include ext/session/php_session.h
 #include zend_operators.h
-#include ext/standard/dns.h
+#include ext/standard/php_dns.h
 #include ext/standard/php_uuencode.h
 #include safe_mode.h


Modified: php/php-src/branches/PHP_5_3/ext/standard/config.m4
===
--- php/php-src/branches/PHP_5_3/ext/standard/config.m4	2009-08-05 21:46:09 UTC (rev 286856)
+++ php/php-src/branches/PHP_5_3/ext/standard/config.m4	2009-08-05 23:20:17 UTC (rev 286857)
@@ -247,7 +247,7 @@

 dnl
 dnl Detect library functions needed by php dns_xxx functions
-dnl ext/standard/dns.h will collect these in a single define: HAVE_DNS_FUNCS
+dnl ext/standard/php_dns.h will collect these in a single define: HAVE_DNS_FUNCS
 dnl
 PHP_CHECK_FUNC(res_nmkquery, resolv, bind, socket)
 PHP_CHECK_FUNC(res_nsend, resolv, bind, socket)
@@ -257,7 +257,7 @@

 dnl
 dnl These are old deprecated functions, a single define of HAVE_DEPRECATED_DNS_FUNCS
-dnl will be set in ext/standard/dns.h
+dnl will be set in ext/standard/php_dns.h
 dnl

 PHP_CHECK_FUNC(res_mkquery, resolv, bind, socket)

Modified: php/php-src/branches/PHP_5_3/ext/standard/dns.c
===
--- php/php-src/branches/PHP_5_3/ext/standard/dns.c	2009-08-05 21:46:09 UTC (rev 286856)
+++ php/php-src/branches/PHP_5_3/ext/standard/dns.c	2009-08-05 23:20:17 UTC (rev 286857)
@@ -56,7 +56,7 @@
 #define AF_INET 2   /* internetwork: UDP, TCP, etc. */
 #endif

-#include dns.h
+#include php_dns.h

 /* type compat */
 #ifndef DNS_T_A

Deleted: php/php-src/branches/PHP_5_3/ext/standard/dns.h
===
--- php/php-src/branches/PHP_5_3/ext/standard/dns.h	2009-08-05 21:46:09 UTC (rev 286856)
+++ php/php-src/branches/PHP_5_3/ext/standard/dns.h	2009-08-05 23:20:17 UTC (rev 286857)
@@ -1,71 +0,0 @@
-/*
-   +--+
-   | PHP Version 5|
-   +--+
-   | Copyright (c) 1997-2008 The PHP Group|
-   +--+
-   | This source file is subject to version 3.01 of the PHP license,  |
-   | that is bundled with this package in the file LICENSE, and is|
-   | available through the world-wide-web at the following url:   |
-   | http://www.php.net/license/3_01.txt  |
-   | If you did not receive a copy of the PHP license and are unable to   |
-   | obtain it through the world-wide-web, please send a note to  |
-   | lice...@php.net so we can mail you a copy immediately.   |
-   

[PHP-CVS] svn: /php/php-src/trunk/ configure.in ext/standard/basic_functions.c ext/standard/config.m4 ext/standard/dns.c ext/standard/php_dns.h

2009-08-05 Thread Scott MacVicar
scottmac Thu, 06 Aug 2009 00:10:46 +

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

Log:
Remove usage of res_nmkquery and res_nsend. We essentially were just doing a  
res_search() anyway, though now we use res_nsearch() with our own state.

This also adds support for using the high level dns.h API on OSX which in 
turns allows use of bind9 (finally).

Changed paths:
U   php/php-src/trunk/configure.in
U   php/php-src/trunk/ext/standard/basic_functions.c
U   php/php-src/trunk/ext/standard/config.m4
U   php/php-src/trunk/ext/standard/dns.c
U   php/php-src/trunk/ext/standard/php_dns.h

Modified: php/php-src/trunk/configure.in
===
--- php/php-src/trunk/configure.in	2009-08-05 23:20:17 UTC (rev 286857)
+++ php/php-src/trunk/configure.in	2009-08-06 00:10:46 UTC (rev 286858)
@@ -254,7 +254,6 @@
 CPPFLAGS=$CPPFLAGS -no-cpp-precomp
   fi
 fi
-AC_DEFINE(BIND_8_COMPAT, 1, [Enabling BIND8 compatibility for Panther])
 php_multiple_shlib_versions_ok=yes
 ;;
   *beos*)

Modified: php/php-src/trunk/ext/standard/basic_functions.c
===
--- php/php-src/trunk/ext/standard/basic_functions.c	2009-08-05 23:20:17 UTC (rev 286857)
+++ php/php-src/trunk/ext/standard/basic_functions.c	2009-08-06 00:10:46 UTC (rev 286858)
@@ -992,22 +992,20 @@
 ZEND_END_ARG_INFO()
 #endif

-#if defined(PHP_WIN32) || (HAVE_RES_SEARCH  !(defined(__BEOS__) || defined(NETWARE)))
+#if defined(PHP_WIN32) || (HAVE_DNS_SEARCH_FUNC  !(defined(__BEOS__) || defined(NETWARE)))
 ZEND_BEGIN_ARG_INFO_EX(arginfo_dns_check_record, 0, 0, 1)
 	ZEND_ARG_INFO(0, host)
 	ZEND_ARG_INFO(0, type)
 ZEND_END_ARG_INFO()

-# if defined(PHP_WIN32) || HAVE_DNS_FUNCS
+# if defined(PHP_WIN32) || HAVE_FULL_DNS_FUNCS
 ZEND_BEGIN_ARG_INFO_EX(arginfo_dns_get_record, 1, 0, 1)
 	ZEND_ARG_INFO(0, hostname)
 	ZEND_ARG_INFO(0, type)
 	ZEND_ARG_INFO(1, authns) /* ARRAY_INFO(1, authns, 1) */
 	ZEND_ARG_INFO(1, addtl)  /* ARRAY_INFO(1, addtl, 1) */
 ZEND_END_ARG_INFO()
-# endif

-# if defined(PHP_WIN32) || (HAVE_DN_SKIPNAME  HAVE_DN_EXPAND)
 ZEND_BEGIN_ARG_INFO_EX(arginfo_dns_get_mx, 0, 0, 2)
 	ZEND_ARG_INFO(0, hostname)
 	ZEND_ARG_INFO(1, mxhosts) /* ARRAY_INFO(1, mxhosts, 1) */
@@ -1015,7 +1013,7 @@
 ZEND_END_ARG_INFO()
 # endif

-#endif /* defined(PHP_WIN32) || (HAVE_RES_SEARCH  !(defined(__BEOS__) || defined(NETWARE))) */
+#endif /* defined(PHP_WIN32) || (HAVE_DNS_SEARCH_FUNC  !(defined(__BEOS__) || defined(NETWARE))) */
 /* }}} */
 /* {{{ exec.c */
 ZEND_BEGIN_ARG_INFO_EX(arginfo_exec, 0, 0, 1)
@@ -3023,17 +3021,14 @@
 	PHP_FE(gethostname,	arginfo_gethostname)
 #endif

-#if defined(PHP_WIN32) || (HAVE_RES_SEARCH  !(defined(__BEOS__) || defined(NETWARE)))
+#if defined(PHP_WIN32) || (HAVE_DNS_SEARCH_FUNC  !(defined(__BEOS__) || defined(NETWARE)))

 	PHP_FE(dns_check_record,arginfo_dns_check_record)
 	PHP_FALIAS(checkdnsrr,			dns_check_record,		arginfo_dns_check_record)

-# if defined(PHP_WIN32) || (HAVE_DN_SKIPNAME  HAVE_DN_EXPAND)
+# if defined(PHP_WIN32) || HAVE_FULL_DNS_FUNCS
 	PHP_FE(dns_get_mx,		arginfo_dns_get_mx)
 	PHP_FALIAS(getmxrr,dns_get_mx,	arginfo_dns_get_mx)
-# endif
-
-# if defined(PHP_WIN32) || HAVE_DNS_FUNCS
 	PHP_FE(dns_get_record,	arginfo_dns_get_record)
 # endif
 #endif
@@ -3632,8 +3627,8 @@
 	php_register_url_stream_wrapper(ftp, php_stream_ftp_wrapper TSRMLS_CC);
 #endif

-#if defined(PHP_WIN32) || (HAVE_RES_SEARCH  !(defined(__BEOS__) || defined(NETWARE)))
-# if defined(PHP_WIN32) || HAVE_DNS_FUNCS
+#if defined(PHP_WIN32) || (HAVE_DNS_SEARCH_FUNC  !(defined(__BEOS__) || defined(NETWARE)))
+# if defined(PHP_WIN32) || HAVE_FULL_DNS_FUNCS
 	PHP_MINIT(dns)(INIT_FUNC_ARGS_PASSTHRU);
 # endif
 #endif

Modified: php/php-src/trunk/ext/standard/config.m4
===
--- php/php-src/trunk/ext/standard/config.m4	2009-08-05 23:20:17 UTC (rev 286857)
+++ php/php-src/trunk/ext/standard/config.m4	2009-08-06 00:10:46 UTC (rev 286858)
@@ -247,21 +247,18 @@

 dnl
 dnl Detect library functions needed by php dns_xxx functions
-dnl ext/standard/php_dns.h will collect these in a single define: HAVE_DNS_FUNCS
+dnl ext/standard/php_dns.h will collect these in a single define: HAVE_FULL_DNS_FUNCS
 dnl
-PHP_CHECK_FUNC(res_nmkquery, resolv, bind, socket)
-PHP_CHECK_FUNC(res_nsend, resolv, bind, socket)
-PHP_CHECK_FUNC(res_search, resolv, bind, socket)
+PHP_CHECK_FUNC(res_nsearch, resolv, bind, socket)
+PHP_CHECK_FUNC(dns_search, resolv, bind, socket)
 PHP_CHECK_FUNC(dn_expand, resolv, bind, socket)
 PHP_CHECK_FUNC(dn_skipname, resolv, bind, socket)

 dnl
-dnl These are old deprecated functions, a single define of HAVE_DEPRECATED_DNS_FUNCS
-dnl will be set in ext/standard/php_dns.h
+dnl These are old deprecated functions
 dnl

-PHP_CHECK_FUNC(res_mkquery, 

RE: [PHP-CVS] svn: /php/php-src/trunk/sapi/nsapi/ nsapi.c

2009-08-05 Thread Johannes Schlüter
Hi,

On Mon, 2009-08-03 at 13:18 +0200, Uwe Schindler wrote:
 I got it, it works with TortoiseSVN, too. You can specify in the GUI to
 checkout only the immediates and so on. When you want to checkout one branch

Can you add the relevant information to the wiki so others can find it?
Do we meanwhile hae a phpweb site for svn - maybe suh things should be
mentioned there so they are available at a proper location for newomers
in future.

Maybe somebody could also update README.SVN-RULES to mention
sparse-checkouts and the single-commit-to-all-banches thing.

Thanks,
johannes



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



[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/Zend/Zend.m4 branches/PHP_5_3/Zend/zend.h branches/PHP_5_3/Zend/zend_API.c branches/PHP_5_3/Zend/zend_extensions.c branches/PHP_5_3/configure.in branches/

2009-08-05 Thread Scott MacVicar
scottmac Thu, 06 Aug 2009 01:33:54 +

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

Log:
Fix bug #48575 - Use dlopen() just like all the other *nixes instead of OSX 
specific code.

Bug: http://bugs.php.net/48575 (Assigned) Darwin / OS X should use dlopen() et 
al
  
Changed paths:
U   php/php-src/branches/PHP_5_3/Zend/Zend.m4
U   php/php-src/branches/PHP_5_3/Zend/zend.h
U   php/php-src/branches/PHP_5_3/Zend/zend_API.c
U   php/php-src/branches/PHP_5_3/Zend/zend_extensions.c
U   php/php-src/branches/PHP_5_3/configure.in
U   php/php-src/branches/PHP_5_3/ext/standard/dl.c
U   php/php-src/trunk/Zend/Zend.m4
U   php/php-src/trunk/Zend/zend.h
U   php/php-src/trunk/Zend/zend_API.c
U   php/php-src/trunk/Zend/zend_extensions.c
U   php/php-src/trunk/configure.in
U   php/php-src/trunk/ext/standard/dl.c

Modified: php/php-src/branches/PHP_5_3/Zend/Zend.m4
===
--- php/php-src/branches/PHP_5_3/Zend/Zend.m4	2009-08-06 00:10:46 UTC (rev 286858)
+++ php/php-src/branches/PHP_5_3/Zend/Zend.m4	2009-08-06 01:33:54 UTC (rev 286859)
@@ -62,18 +62,6 @@
 stdlib.h \
 dlfcn.h)

-dnl Don't use mach-o/dyld.h on Darwin 8+, dl* is recommended by Apple from there on
-dnl See http://developer.apple.com/documentation/DeveloperTools/Conceptual/MachOTopics/Articles/loading_code.html
-case $host_alias in
-*darwin[[89]]*)
-;;
-*)
-AC_CHECK_HEADERS([  \
-mach-o/dyld.h
-],[],[][])
-;;
-esac
-
 AC_TYPE_SIZE_T
 AC_TYPE_SIGNAL


Modified: php/php-src/branches/PHP_5_3/Zend/zend.h
===
--- php/php-src/branches/PHP_5_3/Zend/zend.h	2009-08-06 00:10:46 UTC (rev 286858)
+++ php/php-src/branches/PHP_5_3/Zend/zend.h	2009-08-06 01:33:54 UTC (rev 286859)
@@ -79,19 +79,8 @@
 # include dlfcn.h
 #endif

-#if HAVE_MACH_O_DYLD_H
-#include mach-o/dyld.h
+#if defined(HAVE_LIBDL)  !defined(ZEND_WIN32)

-/* MH_BUNDLE loading functions for Mac OS X / Darwin */
-void *zend_mh_bundle_load (char* bundle_path);
-int zend_mh_bundle_unload (void *bundle_handle);
-void *zend_mh_bundle_symbol(void *bundle_handle, const char *symbol_name);
-const char *zend_mh_bundle_error(void);
-
-#endif /* HAVE_MACH_O_DYLD_H */
-
-#if defined(HAVE_LIBDL)  !defined(HAVE_MACH_O_DYLD_H)  !defined(ZEND_WIN32)
-
 # ifndef RTLD_LAZY
 #  define RTLD_LAZY 1/* Solaris 1, FreeBSD's (2.1.7.1 and older) */
 # endif
@@ -116,13 +105,6 @@
 # define DL_ERROR	dlerror
 # define DL_HANDLE	void *
 # define ZEND_EXTENSIONS_SUPPORT	1
-#elif defined(HAVE_MACH_O_DYLD_H)
-# define DL_LOAD(libname)			zend_mh_bundle_load(libname)
-# define DL_UNLOAD			zend_mh_bundle_unload
-# define DL_FETCH_SYMBOL(h,s)		zend_mh_bundle_symbol(h,s)
-# define DL_ERROR	zend_mh_bundle_error
-# define DL_HANDLE	void *
-# define ZEND_EXTENSIONS_SUPPORT	1
 #elif defined(ZEND_WIN32)
 # define DL_LOAD(libname)			LoadLibrary(libname)
 # define DL_FETCH_SYMBOL			GetProcAddress

Modified: php/php-src/branches/PHP_5_3/Zend/zend_API.c
===
--- php/php-src/branches/PHP_5_3/Zend/zend_API.c	2009-08-06 00:10:46 UTC (rev 286858)
+++ php/php-src/branches/PHP_5_3/Zend/zend_API.c	2009-08-06 01:33:54 UTC (rev 286859)
@@ -2114,7 +2114,7 @@
 		zend_unregister_functions(module-functions, -1, NULL TSRMLS_CC);
 	}

-#if HAVE_LIBDL || defined(HAVE_MACH_O_DYLD_H)
+#if HAVE_LIBDL
 #if !(defined(NETWARE)  defined(APACHE_1_BUILD))
 	if (module-handle) {
 		DL_UNLOAD(module-handle);

Modified: php/php-src/branches/PHP_5_3/Zend/zend_extensions.c
===
--- php/php-src/branches/PHP_5_3/Zend/zend_extensions.c	2009-08-06 00:10:46 UTC (rev 286858)
+++ php/php-src/branches/PHP_5_3/Zend/zend_extensions.c	2009-08-06 01:33:54 UTC (rev 286859)
@@ -218,67 +218,6 @@
 }

 /*
- * Support for dynamic loading of MH_BUNDLEs on Darwin / Mac OS X
- *
- */
-
-#if HAVE_MACH_O_DYLD_H
-
-void *zend_mh_bundle_load(char* bundle_path)
-{
-	NSObjectFileImage bundle_image;
-	NSModule bundle_handle;
-	NSSymbol bundle_init_nssymbol;
-	void (*bundle_init)(void);
-
-	if (NSCreateObjectFileImageFromFile(bundle_path, bundle_image) != NSObjectFileImageSuccess) {
-		return NULL;
-	}
-
-	bundle_handle = NSLinkModule(bundle_image, bundle_path, NSLINKMODULE_OPTION_NONE);
-	NSDestroyObjectFileImage(bundle_image);
-
-	/* call the init function of the bundle */
-	bundle_init_nssymbol = NSLookupSymbolInModule(bundle_handle, __init);
-	if (bundle_init_nssymbol != NULL) {
-		bundle_init = NSAddressOfSymbol(bundle_init_nssymbol);
-		bundle_init();
-	}
-
-	return bundle_handle;
-}
-
-int zend_mh_bundle_unload(void *bundle_handle)
-{
-	NSSymbol bundle_fini_nssymbol;
-	void (*bundle_fini)(void);
-
-	/* call the fini function of the bundle */
-	bundle_fini_nssymbol = NSLookupSymbolInModule(bundle_handle, __fini);
-	if 

[PHP-CVS] svn: /php/php-src/trunk/ext/standard/ dns.c php_dns.h

2009-08-05 Thread Scott MacVicar
scottmac Thu, 06 Aug 2009 04:37:07 +

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

Log:
Deal with moving to res_nsearch(). dns_search() on OSX lacks an error handler, 
might revert to using straight bind9.

Changed paths:
U   php/php-src/trunk/ext/standard/dns.c
U   php/php-src/trunk/ext/standard/php_dns.h

Modified: php/php-src/trunk/ext/standard/dns.c
===
--- php/php-src/trunk/ext/standard/dns.c2009-08-06 04:33:18 UTC (rev 
286864)
+++ php/php-src/trunk/ext/standard/dns.c2009-08-06 04:37:07 UTC (rev 
286865)
@@ -809,10 +809,14 @@

n = php_dns_search(handle, hostname, C_IN, 
type_to_fetch, answer.qb2, sizeof answer);

-   if (n  0 ) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, 
res_nsearch() failed);
+   if (n  0) {
+   if (php_dns_errno(handle) == NO_DATA) {
+   php_dns_free_handle(handle);
+   continue;
+   }
+
+   php_dns_free_handle(handle);
zval_dtor(return_value);
-   php_dns_free_handle(handle);
RETURN_FALSE;
}

@@ -845,33 +849,33 @@
add_next_index_zval(return_value, 
retval);
}
}
-   php_dns_free_handle(handle);
-   }
-   }

-   if (authns || addtl) {
-   /* List of Authoritative Name Servers
-* Process when only requesting addtl so that we can skip 
through the section
-*/
-   while (ns--  0  cp  cp  end) {
-   zval *retval = NULL;
+   if (authns || addtl) {
+   /* List of Authoritative Name Servers
+* Process when only requesting addtl so that 
we can skip through the section
+*/
+   while (ns--  0  cp  cp  end) {
+   zval *retval = NULL;

-   cp = php_parserr(cp, answer, DNS_T_ANY, authns != 
NULL, retval TSRMLS_CC);
-   if (retval != NULL) {
-   add_next_index_zval(authns, retval);
+   cp = php_parserr(cp, answer, 
DNS_T_ANY, authns != NULL, retval TSRMLS_CC);
+   if (retval != NULL) {
+   add_next_index_zval(authns, 
retval);
+   }
+   }
}
-   }
-   }

-   if (addtl) {
-   /* Additional records associated with authoritative name 
servers */
-   while (ar--  0  cp  cp  end) {
-   zval *retval = NULL;
+   if (addtl) {
+   /* Additional records associated with 
authoritative name servers */
+   while (ar--  0  cp  cp  end) {
+   zval *retval = NULL;

-   cp = php_parserr(cp, answer, DNS_T_ANY, 1, retval 
TSRMLS_CC);
-   if (retval != NULL) {
-   add_next_index_zval(addtl, retval);
+   cp = php_parserr(cp, answer, 
DNS_T_ANY, 1, retval TSRMLS_CC);
+   if (retval != NULL) {
+   add_next_index_zval(addtl, 
retval);
+   }
+   }
}
+   php_dns_free_handle(handle);
}
}
 }

Modified: php/php-src/trunk/ext/standard/php_dns.h
===
--- php/php-src/trunk/ext/standard/php_dns.h2009-08-06 04:33:18 UTC (rev 
286864)
+++ php/php-src/trunk/ext/standard/php_dns.h2009-08-06 04:37:07 UTC (rev 
286865)
@@ -28,17 +28,25 @@
((int)dns_search(res, dname, class, type, answer, anslen, 
(struct sockaddr *)from, fromsize))
 #define php_dns_free_handle(res) \
dns_free(res)
+#define php_dns_errno(_res) \
+   (NO_DATA)

 #elif defined(HAVE_RES_NSEARCH)
 #define php_dns_search(res, dname, class, type, answer, anslen) \
res_nsearch(res, dname, class, type, answer, anslen)
-#define php_dns_free_handle(res) \
-   res_nclose(res)
+#define php_dns_free_handle(res) \
+   res_nclose(res); \
+