Commit Graph

268 Commits

Author SHA1 Message Date
Wez Furlong
9d5bab5a0d EOF related fixes. 2002-10-05 10:59:35 +00:00
David Reid
9b10843481 Add more BeOS support... 2002-10-02 23:52:08 +00:00
Wez Furlong
7694770304 Rename streams functions to fit with naming conventions, adding aliases
for old functions where required.
Make use of recent changes to chunk size and timeout setting code.
2002-09-28 22:14:21 +00:00
Wez Furlong
8aae36aecb Add missing folding marker. 2002-09-28 13:04:47 +00:00
Wez Furlong
315e0a599b Implement stream_select() which works just like socket_select, but only on
streams.
@ - Added stream_select() which works like socket_select but only works on
@   streams returned by fopen(), fsockopen() and pfsockopen(). (Wez)
2002-09-27 23:42:38 +00:00
Wez Furlong
c484eb8c97 Fix segfault in wrapper error log mechanism when errors are logged on
second and subsequent events.
Implement very simple recursion protection for user streams written
like this:
class urlEncodeStream {
    var $fp = NULL;

    function stream_open($path, $mode, $options, &$opened_path)
    {
        $this->fp = fopen($path, $mode); // <-- this recurses infinitely
        return is_resource($this->fp);
    }
}

file_register_wrapper('urlencode', 'urlEncodeStream');
$fp = fopen('urlencode:///tmp/outputfile.txt', 'w');

Noticed by: Yasuo.
2002-09-26 12:12:27 +00:00
Wez Furlong
4c2a9c091b Remove an unused variable and a now-unused function. 2002-09-26 10:17:41 +00:00
Wez Furlong
3a67c67737 Rename file_get_wrapper_data -> file_get_meta_data.
It now always returns useful information for all streams.
Unified that data with socket_get_status and made socket_get_status
an alias for file_get_meta_data.

Fix Location header following which was broken in this commit:
http://cvs.php.net/diff.php/php4/ext/standard/http_fopen_wrapper.c?r1=1.41&r2=1.42&ty=h
2002-09-26 10:14:41 +00:00
Hartmut Holzgraefe
419efa6eeb symbolic constants for fnmatch flags added 2002-09-26 00:27:13 +00:00
Wez Furlong
0141e97052 Make these all work with persistent streams too. 2002-09-25 15:46:47 +00:00
Wez Furlong
696e0a2301 Implement persistent streams. (for pfsockopen).
Juggle some includes/definitions.
Tidy up streams use in ext/standard/file.c
2002-09-25 15:25:12 +00:00
Wez Furlong
4cdf8c7c36 Fix EOL markers for file() so that Mac EOL work correctly. 2002-09-24 02:46:38 +00:00
Wez Furlong
c74b9faca5 Implement a default_socket_timeout and auto_detect_line_endings ini options.
Also move user_agent from BG to FG.
2002-09-23 18:12:39 +00:00
Wez Furlong
4d8a07d529 Implement read buffering in streams.
Eliminate similar code from network.c.
Implement fgets equivalent at the streams level, which can detect
the mac, dos and unix line endings and handle them appropriately.
The default behaviour is unix (and dos) line endings.
An ini option to control this behaviour will follow.
# Don't forget to make clean!
# I've done some testing but would appreciate feedback from
# people with scripts/extensions that seek around a lot.
2002-09-23 01:47:04 +00:00
Ilia Alshanetsky
687312be41 Do not create the destination file, if opening of the source file failed
during copy().
2002-09-13 13:34:06 +00:00
Wez Furlong
3df412cf9b Fix a couple of bad pointer indirections (oops).
Lets stick to a single category of "http" for the "user_agent"
context override.
2002-09-07 20:58:30 +00:00
Sterling Hughes
91df221ab7 @ Made the User-Agent that php's fopen wrappers send, configurable via
@ php.ini or via a stream context. (Sterling)

The stream context is untested, but it should/could work :)  Either way it
doesn't make the rest of the code bad. Wez -- please take a looksie for me
:)
2002-09-07 15:45:29 +00:00
Anantha Kesari H Y
8b8f1e0590 NetWare related additions/modifications 2002-09-05 14:25:07 +00:00
Marcus Boerger
6063c8c478 fix fwrite to no longer apply stripslashes on input string when
magic_quotes_runtime is set On.
2002-08-26 23:18:59 +00:00
Marcus Boerger
ba40963985 improoved error messages 2002-08-25 18:21:40 +00:00
Wez Furlong
5c6ad38c31 Prevent possible problems with include_path. 2002-08-25 12:09:57 +00:00
Marcus Boerger
149ad05b4f php_error_docref
#New conversion available at: http://docref.txt.marcus-boerger.de
2002-08-24 01:19:28 +00:00
Wez Furlong
9d348ea800 Implement filter API for streams.
Filters can be stacked onto a stream; more details will follow in docs and
on php-dev.

Implement "string.rot13" filter

Allows the following script:

$fp = fopen("file.txt", "r");
stream_filter_prepend($fp, "string.rot13");

// File contents will be subject to a rot13 transformation before
// being output.
fpassthru($fp);
fclose($fp);
2002-08-20 20:47:47 +00:00
Wez Furlong
5f9a5a7c8e Remove php_stream_sock_set_blocking and replace with
php_stream_set_option which can be used in a similar way as ioctl()
to set options for streams.

Current options include buffering and blocking support.

o Buffer control is support for stdio based streams.
o Blocking/non-blocking is supported for stdio and socket based streams.
2002-08-19 22:59:10 +00:00
Ilia Alshanetsky
1aea030cf2 Corrected if() syntax in previous patch. 2002-08-18 07:54:33 +00:00
Ilia Alshanetsky
d42dbfce8e Fixed a segmentation fault that would occur if an entry contained a
non-terminated enclosure. Bug #12556
2002-08-18 06:55:32 +00:00
Rasmus Lerdorf
b025bb1023 Missing proto 2002-08-13 05:08:47 +00:00
Wez Furlong
ccb5c84b6c Centralize some blocking socket related code.
# It's been a while since I wrote this!
2002-08-09 21:02:36 +00:00
Yasuo Ohgaki
c528157123 Remove duplicated checks. 2002-08-08 22:59:41 +00:00
foobar
e3797ab76a Fixed bug: #16638. 2002-07-13 04:45:21 +00:00
Jason Greene
d907b2d525 @Fixed socket_set_timeout on win32 (Jason, Edin, Jani) 2002-07-10 15:23:47 +00:00
Andi Gutmans
b4146638f0 - Fix TSRMLS_* stuff 2002-07-08 18:29:54 +00:00
Derick Rethans
728f2de442 Unify error messages 2002-07-08 12:52:22 +00:00
Derick Rethans
7b7608d630 - Fix for bug #15547 (Patch by Justin Garrett <usjgarrett@byu.edu>) 2002-07-02 06:16:35 +00:00
Hartmut Holzgraefe
303852b42e - fixed bug in enclosure handling (was still hardcoded to '"' in one place)
- added possibility to pass empty enclosure if you really don't want one
2002-06-18 12:16:27 +00:00
Markus Fischer
f9936a8459 - Fix proto. 2002-06-10 10:28:33 +00:00
Andi Gutmans
fc059f5e40 - Fix typo 2002-05-23 14:28:14 +00:00
Derick Rethans
c37d2a97ac - Fix errormessage and whitespace 2002-05-23 07:08:25 +00:00
Yasuo Ohgaki
b768cf0322 Added 4th parameter to specify enclosure character. Patch by Dean Richard Benson <dean@vipersoft.co.uk>
Spit more meaningful error messages when delim and/or enclosure char is null.
2002-05-23 07:03:43 +00:00
Rasmus Lerdorf
93af4bdfb7 Change safe-mode rule for rmdir() to match unlink() - allow is target
is opened by caller or in a directory owned by caller
@ Minor fix to rmdir() under safe-mode (Rasmus)
2002-05-12 15:59:42 +00:00
jim winstead
51e2ea5ed2 fix problem with mkdir() on freebsd 2002-05-06 17:31:22 +00:00
Sascha Schumann
4378214b80 Make this code work on compilers which don't consider the address
of a variable on the stack available at compile time.
2002-05-04 17:12:26 +00:00
Sebastian Bergmann
eacad68c68 Fix ZTS build. 2002-04-30 04:27:52 +00:00
Wez Furlong
760573695c Implement user-space funtions to operate on stream contexts. 2002-04-30 00:28:24 +00:00
Wez Furlong
e1d0a14790 Implement stream context and status notification system.
Bump the BC for zlib notice to a warning
# See my RFC to php-dev a few days ago
2002-04-10 22:42:32 +00:00
Zeev Suraski
385b233040 Fix gzip/bz2 builds for Windows 2002-04-05 11:51:43 +00:00
Wez Furlong
2539cbc74c Phase 3 of OO wrapper cleanup
# What was phase 2?
2002-03-28 00:49:00 +00:00
Markus Fischer
341af63328 - Use proper macros for php_stream_cast() return values (fixes #16211). 2002-03-21 22:05:40 +00:00
Hartmut Holzgraefe
b00d9a5b2c added fnmatch() and glob() functions
could someone please check if i got the virtual dir stuff right?
2002-03-21 19:18:13 +00:00
Wez Furlong
a662f012bb Convert the gzfile related functions into aliases for their equivalents
in ext/standard/file.c, so a gzopen()ed file pointer can be used in
fread, fseek etc.
Improved behaviour of zlib stream.
Moved passthru code into streams.c
# I'm not happy about BG(mmap_file)
Nuked gzgetss_state as no longer needed.
2002-03-21 01:11:52 +00:00