Commit Graph

117 Commits

Author SHA1 Message Date
Antony Dovgal
3519ed9e31 manage references of stream context properly 2008-07-11 10:24:29 +00:00
Felipe Pena
e4fc964ab3 - Added check for encoding optional parameter (avoiding the segfault in filter.c: strlen(encoding))
If the parameter is not suplied, it will try to use the UG(stream_enconding)
2008-05-28 18:02:52 +00:00
Etienne Kneuss
5f4e5fa60a Fix protos 2008-05-04 21:16:22 +00:00
Hannes Magnusson
1972f83385 MFB5.3: Fixed bug#44712 (stream_context_set_params segfaults on invalid arguments) 2008-04-13 22:40:35 +00:00
Felipe Pena
a1e8d340c3 New macro for check void parameters 2008-02-28 14:16:25 +00:00
Ilia Alshanetsky
fb738d95bf MFB: Fixed bug #44028 (crash inside stream_socket_enable_crypto() when
enabling encryption without crypto type)
2008-02-03 16:14:44 +00:00
Sebastian Bergmann
9b620d50b4 Bump copyright year, 2 of 2. 2007-12-31 07:12:20 +00:00
Johannes Schlüter
6e7ba5ba5f Add stream_supports_lock() function (Benjamin Schulz) 2007-11-20 22:16:20 +00:00
Dmitry Stogov
c49b08fe9a Fixed bug #43216 (stream_is_local() returns false on "file://") 2007-11-08 13:29:38 +00:00
Jani Taskinen
040cb2ca5d ret is still int 2007-10-10 12:51:06 +00:00
Jani Taskinen
b3c3c8a90f - Use correct definition 2007-10-10 12:44:29 +00:00
Yiduo (David) Wang
95da0dc570 Added macros for managing zval refcounts and is_ref statuses 2007-10-07 05:15:07 +00:00
Antony Dovgal
b608bd654d fix ws, cs & folding 2007-07-14 08:38:20 +00:00
Dmitry Stogov
f766275b7a Added ability to create local or remote (URL) user streams
Local user streams must not be able to open(), URLs if allow_url_include is off
Implemented new function stream_is_local()
[
- stream_wrapper_register() extended with additional optional argument "flags"
  of type long. This time only one flag is implemented - STREAM_IS_URL, that
  means that userstream wrapper is remote (URL). By default stream is local.
- stream_is_local() is a new function that accepts stream and tell if this
  stream is local or remote (URL)
]
2007-07-03 10:22:55 +00:00
Antony Dovgal
63d2c1f093 return success only if succeeded casting at least one stream to fd 2007-04-12 13:15:17 +00:00
Dmitry Stogov
8610b4f6cf Fixed 64-bit support 2007-04-09 15:39:16 +00:00
Antony Dovgal
c6054b64b0 fix #40168 2007-01-19 14:49:52 +00:00
Sebastian Bergmann
3717df72ae Bump year. 2007-01-01 09:29:37 +00:00
Antony Dovgal
df52817f48 use safe_emalloc() 2006-12-25 22:12:36 +00:00
Antony Dovgal
824323149f stream_socket_shutdown() is Unicode safe by definition 2006-12-25 19:19:08 +00:00
Dmitry Stogov
938f3d6efa Added function stream_socket_shutdown(). It is a wraper for system shutdown() function, that shut downs part of a full-duplex connection 2006-12-19 08:59:26 +00:00
Sara Golemon
cc51b47859 Bugfix#38649 Optional param not initialized 2006-10-11 23:20:54 +00:00
Sara Golemon
1caed2fa18 Add stream_resolve_include_path() 2006-10-09 02:48:06 +00:00
Hannes Magnusson
176b72284c Error message clean up
(patch by Matt W (php_lists -AT- realpain.com))
2006-10-08 13:34:24 +00:00
Sara Golemon
17cdda770d Forgot to mark these u-safe 2006-10-06 17:41:30 +00:00
Antony Dovgal
a99e3ec1b3 remove TSRMLS_CC, php_stream_path_decode() is a macro 2006-10-03 23:26:14 +00:00
Ilia Alshanetsky
25ac82bbb6 MFB: optimize zend_hash_init() with known hash table sizes. 2006-10-03 17:45:16 +00:00
Hannes Magnusson
2288a69be1 fix proto 2006-09-29 13:22:43 +00:00
Sara Golemon
3191ed0e85 Update stream_copy_to_stream() for PHP6 2006-09-22 19:54:30 +00:00
Sara Golemon
96f9c9c59c Update stream_get_contents() for PHP6 2006-09-22 18:42:33 +00:00
Sara Golemon
1aa537ebd4 Update (most of) the functions in streamsfuncs.c
This commit also includes a change to tests/file/stream_rfc2397_002.phpt
which doesn't entirely pass in unicode mode yet, however that's a unicode
issue in the data:// wrapper that needs fixing, not a problem with the
streams layer itself.
2006-09-21 19:53:10 +00:00
Sara Golemon
3f56da6eba Add INI controlled default stream encoding (unicode.stream_encoding).
Add convenience function stream_defualt_encoding() for setting it.
2006-09-19 20:36:48 +00:00
Dmitry Stogov
128548a5c0 Disabled autoconversion of hash keys (from string to unicode) for PHP arrays 2006-09-19 10:38:31 +00:00
Ilia Alshanetsky
675bda66b6 MFB: Fixed bug #38096 (large timeout values ignored on 32bit machines in
stream_socket_accept() and stream_socket_client()).
2006-09-11 14:53:33 +00:00
Antony Dovgal
d08f2e8897 more z/Z fixes 2006-08-31 14:41:15 +00:00
Antony Dovgal
dbe2092313 implement zend_unicode_to_string() and zend_string_to_unicode()
part #2 (of 2)
2006-08-08 16:59:11 +00:00
Antony Dovgal
44ad98405f MFB: rephrase the error message (fixes #38106) 2006-07-14 20:45:37 +00:00
Hannes Magnusson
731c3e4db0 Removed custom deprecate error messages
Use the fancy ZEND_ACC_DEPRECATED flag.
2006-06-26 11:31:19 +00:00
Hannes Magnusson
bf0a79d381 Updated protos
Fixed vim folding
2006-06-25 19:19:31 +00:00
Hannes Magnusson
53d262c04d Nuke unused var 2006-06-11 20:33:29 +00:00
Antony Dovgal
acf25d1aac fix typo (see #35900) 2006-04-19 08:43:05 +00:00
Antony Dovgal
becb273c16 MF51: fix #37077 (stream_socket_server() leaks when the port is not allowed) 2006-04-14 10:01:34 +00:00
Sara Golemon
d05836890b Preserve full name of filter for use in stream_get_meta_data() 2006-04-13 04:41:08 +00:00
Antony Dovgal
0b0fff07b2 fix spelling in error messages:
greater/less thEn -> greater/less thAn
2006-04-03 09:14:50 +00:00
Sara Golemon
30a2bd1d11 Another (and hopefully last) major streams commit.
This moves unicode conversion to the filter layer
(rather than at the lower streams layer)
unicode_filter.c has been moved from ext/unicode to main/streams
as it's an integral part of the streams unicode conversion process.

There are now three ways to set encoding on a stream:

(1) By context
$ctx = stream_context_create(NULL,array('encoding'=>'latin1'));
$fp = fopen('somefile', 'r+t', false, $ctx);

(2) By stream_encoding()
$fp = fopen('somefile', 'r+');
stream_encoding($fp, 'latin1');

(3) By filter
$fp = fopen('somefile', 'r+');
stream_filter_append($fp, 'unicode.from.latin1', STREAM_FILTER_READ);
stream_filter_append($fp, 'unicode.to.latin1', STREAM_FILTER_WRITE);

Note: Methods 1 and 2 are convenience wrappers around method 3.
2006-03-29 01:20:43 +00:00
Sara Golemon
a64789a452 Expand stream_context_create() to allow specifying params
as well as options.  Ignore the internal name change of the first arg.
The first arg is still for options, the second arg is for actual params.
2006-03-26 04:40:11 +00:00
Sara Golemon
f67ed7f3d4 Allow bidirectional encoding option via single context param 2006-03-24 22:27:13 +00:00
Sara Golemon
dfc827d108 Fix stream_get_line():
Checking type isn't nearly as important as checking nullness...
2006-03-24 21:37:42 +00:00
Sara Golemon
880dd406f2 Add php_stream_get_record_unicde() API call.
Update stream_get_line() userspace function to handle unicode streams.
2006-03-24 19:22:24 +00:00
Sara Golemon
48798021b5 Refactor streams layer for PHP6.
Don't be frightened by the size of this commit.
A significant portion of it is restoring the read buffer semantics back
to what PHP4/5 use.  (Or a close aproximation thereof).

See main/streams/streams.c and ext/standard/file.c for a set of
UTODO comments covering work yet to be done.
2006-03-13 04:40:11 +00:00