cvs: php4 / NEWS /ext/bz2 bz2.c /ext/standard fsock.c /ext/zlib zlib.c zlib_fopen_wrapper.c /main network.c streams.c
| From: | Wez Furlong | Date: | Fri, 19 Apr 2002 10:06:42 +0000 |
| Subject: | cvs: php4 / NEWS /ext/bz2 bz2.c /ext/standard fsock.c /ext/zlib zlib.c zlib_fopen_wrapper.c /main network.c streams.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-11229@lists.php.net to get a copy of this message | ||
wez Fri Apr 19 06:06:42 2002 EDT
Modified files:
/php4 NEWS
/php4/ext/bz2 bz2.c
/php4/ext/standard fsock.c
/php4/ext/zlib zlib.c zlib_fopen_wrapper.c
/php4/main network.c streams.c
Log:
Make scheme part decoding rfc2396 compliant.
Change zlib:// and bzip2:// to compress.zlib:// and compress.bzip2://
Tidy up old socket/network code/comments.
Index: php4/NEWS
diff -u php4/NEWS:1.942 php4/NEWS:1.943
--- php4/NEWS:1.942 Sun Apr 14 08:58:28 2002
+++ php4/NEWS Fri Apr 19 06:06:40 2002
@@ -33,9 +33,8 @@
- Added mysql_list_processes() and mysql_stat() functions. (Georg)
- Added file_get_contents($filename), which returns the contents of a file
as a string. It also supports URL wrappers. (Wez)
-- Changed fopen wrappers ('php://', 'bz2://' and 'zlib://') to
require the
- '://' separator (instead of simply 'php:', 'bz2:' and
'zlib:') to avoid
- ambiguities when filenames have ':' characters. (Wez)
+- Changed 'zlib:' fopen wrapper to 'compress.zlib://' to avoid ambiguities
+ when filenames have ':' characters. (Wez)
- Added URL-wrapper support to exif. (Marcus)
- PHP now has a new stream system that allows it to do some clever stuff with
fopen() and fsockopen(). As a result:
@@ -43,7 +42,7 @@
. fsockopen() adds support for ssl:// and tls:// connections via TCP/IP
. copy($srcfilename, $destfilename) can now be used with URL wrappers
. zlib wrappers/streams can be used even on systems without fopencookie()
- . Added BZip2 stream support.
+ . Added 'compress.bzip2://' stream and wrapper support.
. Added user-space streams - it is now possible to define a class in PHP
code and register it as a URL wrapper.
. Most extensions now support streams when passing files, which means
Index: php4/ext/bz2/bz2.c
diff -u php4/ext/bz2/bz2.c:1.48 php4/ext/bz2/bz2.c:1.49
--- php4/ext/bz2/bz2.c:1.48 Tue Apr 16 18:14:19 2002
+++ php4/ext/bz2/bz2.c Fri Apr 19 06:06:41 2002
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: bz2.c,v 1.48 2002/04/16 22:14:19 wez Exp $ */
+/* $Id: bz2.c,v 1.49 2002/04/19 10:06:41 wez Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -164,8 +164,8 @@
char *path_copy = NULL;
BZFILE *bz_file = NULL;
- if (strncasecmp("bzip2://", path, 8) == 0)
- path += 8;
+ if (strncasecmp("compress.bzip2://", path, 17) == 0)
+ path += 17;
#ifdef VIRTUAL_DIR
virtual_filepath(path, &path_copy TSRMLS_CC);
@@ -227,14 +227,14 @@
PHP_MINIT_FUNCTION(bz2)
{
- php_register_url_stream_wrapper("bzip2", &php_stream_bzip2_wrapper TSRMLS_CC);
+ php_register_url_stream_wrapper("compress.bzip2", &php_stream_bzip2_wrapper
TSRMLS_CC);
return SUCCESS;
}
PHP_MSHUTDOWN_FUNCTION(bz2)
{
- php_unregister_url_stream_wrapper("bzip2" TSRMLS_CC);
+ php_unregister_url_stream_wrapper("compress.bzip2" TSRMLS_CC);
return SUCCESS;
}
Index: php4/ext/standard/fsock.c
diff -u php4/ext/standard/fsock.c:1.94 php4/ext/standard/fsock.c:1.95
--- php4/ext/standard/fsock.c:1.94 Wed Mar 20 09:21:28 2002
+++ php4/ext/standard/fsock.c Fri Apr 19 06:06:41 2002
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: fsock.c,v 1.94 2002/03/20 14:21:28 wez Exp $ */
+/* $Id: fsock.c,v 1.95 2002/04/19 10:06:41 wez Exp $ */
/* converted to PHP Streams and moved much code to main/network.c [wez] */
@@ -84,8 +84,6 @@
#ifdef ZTS
static int fsock_globals_id;
-#else
-extern int le_fp;
#endif
#ifdef PHP_WIN32
Index: php4/ext/zlib/zlib.c
diff -u php4/ext/zlib/zlib.c:1.128 php4/ext/zlib/zlib.c:1.129
--- php4/ext/zlib/zlib.c:1.128 Tue Apr 16 18:14:24 2002
+++ php4/ext/zlib/zlib.c Fri Apr 19 06:06:41 2002
@@ -18,7 +18,7 @@
| Jade Nicoletti <nicoletti@nns.ch> |
+----------------------------------------------------------------------+
*/
-/* $Id: zlib.c,v 1.128 2002/04/16 22:14:24 wez Exp $ */
+/* $Id: zlib.c,v 1.129 2002/04/19 10:06:41 wez Exp $ */
#define IS_EXT_MODULE
#ifdef HAVE_CONFIG_H
@@ -181,7 +181,7 @@
#ifdef ZTS
ts_allocate_id(&zlib_globals_id, sizeof(zend_zlib_globals), (ts_allocate_ctor)
php_zlib_init_globals, NULL);
#endif
- php_register_url_stream_wrapper("zlib", &php_stream_gzip_wrapper TSRMLS_CC);
+ php_register_url_stream_wrapper("compress.zlib", &php_stream_gzip_wrapper
TSRMLS_CC);
REGISTER_LONG_CONSTANT("FORCE_GZIP", CODING_GZIP, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("FORCE_DEFLATE", CODING_DEFLATE, CONST_CS | CONST_PERSISTENT);
Index: php4/ext/zlib/zlib_fopen_wrapper.c
diff -u php4/ext/zlib/zlib_fopen_wrapper.c:1.25 php4/ext/zlib/zlib_fopen_wrapper.c:1.26
--- php4/ext/zlib/zlib_fopen_wrapper.c:1.25 Tue Apr 16 18:14:25 2002
+++ php4/ext/zlib/zlib_fopen_wrapper.c Fri Apr 19 06:06:41 2002
@@ -16,7 +16,7 @@
| Hartmut Holzgraefe <hartmut@six.de> |
+----------------------------------------------------------------------+
*/
-/* $Id: zlib_fopen_wrapper.c,v 1.25 2002/04/16 22:14:25 wez Exp $ */
+/* $Id: zlib_fopen_wrapper.c,v 1.26 2002/04/19 10:06:41 wez Exp $ */
#define IS_EXT_MODULE
#define _GNU_SOURCE
@@ -101,8 +101,8 @@
self = emalloc(sizeof(*self));
- if (strncasecmp("zlib://", path, 7) == 0)
- path += 7;
+ if (strncasecmp("compress.zlib://", path, 16) == 0)
+ path += 16;
else if (strncasecmp("zlib:", path, 5) == 0)
path += 5;
Index: php4/main/network.c
diff -u php4/main/network.c:1.47 php4/main/network.c:1.48
--- php4/main/network.c:1.47 Mon Apr 15 16:12:29 2002
+++ php4/main/network.c Fri Apr 19 06:06:41 2002
@@ -15,7 +15,7 @@
| Author: Stig Venaas <venaas@uninett.no> |
+----------------------------------------------------------------------+
*/
-/* $Id: network.c,v 1.47 2002/04/15 20:12:29 wez Exp $ */
+/* $Id: network.c,v 1.48 2002/04/19 10:06:41 wez Exp $ */
#define MAX_CHUNKS_PER_READ 10
@@ -465,7 +465,7 @@
memset(&unix_addr, 0, sizeof(unix_addr));
unix_addr.sun_family = AF_UNIX;
- /* we need to be binary safe for the on systems that support an abstract
+ /* we need to be binary safe on systems that support an abstract
* namespace */
if (pathlen >= sizeof(unix_addr.sun_path)) {
/* On linux, when the path begins with a NUL byte we are
Index: php4/main/streams.c
diff -u php4/main/streams.c:1.49 php4/main/streams.c:1.50
--- php4/main/streams.c:1.49 Tue Apr 16 18:14:27 2002
+++ php4/main/streams.c Fri Apr 19 06:06:41 2002
@@ -1180,7 +1180,7 @@
if (options & IGNORE_URL)
return &php_plain_files_wrapper;
- for (p = path; isalnum((int)*p); p++) {
+ for (p = path; isalnum((int)*p) || *p == '+' || *p == '-' || *p ==
'.'; p++) {
n++;
}
@@ -1188,9 +1188,9 @@
protocol = path;
} else if (strncasecmp(path, "zlib:", 5) == 0) {
/* BC with older php scripts and zlib wrapper */
- protocol = path;
- n = 4;
- zend_error(E_WARNING, "Use of \"zlib:\" wrapper is deprecated; please use
\"zlib://\" instead.");
+ protocol = "compress.zlib";
+ n = 13;
+ zend_error(E_WARNING, "Use of \"zlib:\" wrapper is deprecated; please use
\"compress.zlib://\" instead.");
}
if (protocol) {