Commit Graph

92 Commits

Author SHA1 Message Date
Marcus Boerger
32e478b9fc - Add fputcsv() (David Sklar) 2004-09-26 21:55:22 +00:00
Frank M. Kromann
62cd02c5a7 Adding missing PHPAPI for non ZTS builds 2004-07-30 22:49:02 +00:00
Sara Golemon
a2c24ae90e BugFix#28868 (Part Two): This fixes thread unsafety in the userspace
filters which relates to the fix just applied for userspace wrappers.
2004-06-21 21:08:05 +00:00
Sara Golemon
7fcfa8865e BugFix#28868: Wrapper hash not thread-safe.
Userdefined wrappers were being registered into a global wrapper hash
which can cross threads.  Termination of once instance then has the
potential to leave an active stream in another instance with no wrapper
leading to segfault.
2004-06-21 18:58:55 +00:00
foobar
ccfc46b0aa - Happy new year and PHP 5 for rest of the files too..
# Should the LICENSE and Zend/LICENSE dates be updated too?
2004-01-08 17:33:29 +00:00
Ilia Alshanetsky
1128955aa4 Fixed compiler warnings. 2003-12-14 18:23:15 +00:00
Stanislav Malyshev
e21669502b MF4: allow realpath() for win32 non-ZTS 2003-09-30 09:52:11 +00:00
Edin Kadribasic
6bcf810687 This needs to be exported for dynamic extensions 2003-06-15 23:27:05 +00:00
James Cox
f68c7ff249 updating license information in the headers. 2003-06-10 20:04:29 +00:00
Sara Golemon
83b7b75c3c Implement default contexts. For the moment this is useless
but it will be used soon for connection pooling.
2003-05-21 04:04:50 +00:00
Sara Golemon
87c5019dd2 Switch file_put_contents 'bool use_include_path' to 'int flags' to allow other options such as appending 2003-04-08 23:24:53 +00:00
foobar
a45b4258f0 file_set_contents -> file_put_contents 2003-04-08 14:12:52 +00:00
Sterling Hughes
39b8f06f9b @ Add the file_set_contents() function, as a complement to the file_get_contents()
@ function. (Sterling)
2003-03-12 06:47:34 +00:00
Wez Furlong
1b53a2d12e New user-space functions:
. stream_socket_client() - similar to fsockopen(), but more powerful.
  . stream_socket_server() - Creates a server socket.
  . stream_socket_accept() - Accept a client connection.
  . stream_socket_get_name() - Get local or remote name of socket.

Tidy up some leaks and debug printfs.
Move more streams functions into streamsfuncs.c and streamsfuncs.h.
2003-02-28 19:53:21 +00:00
Wez Furlong
5def83df0b Move streams specific stuff from ext/standard/file.c -> ext/standard/streams.c
Move win32 select implementation into win32/.
Will update win32 build in a moment.
2003-02-27 22:23:39 +00:00
Ilia Alshanetsky
8908faa47f Revent previous patch, adding of file_write_content() was premature. 2003-02-22 20:35:22 +00:00
Ilia Alshanetsky
d2e2fbcc5b int/long change. 2003-02-22 20:33:11 +00:00
Ilia Alshanetsky
53b7b0eb8c Merged the flags for the file() function into a single flag. 2003-02-10 22:26:53 +00:00
Ilia Alshanetsky
f98ea4c46d Added feature request #9173 (added stream_get_line(), this function will
read either the specified number of bytes or until the ending string is
found).
2003-02-09 20:43:05 +00:00
Sara Golemon
7b37272381 Added stream_get_wrappers() 2003-01-03 08:02:36 +00:00
Sebastian Bergmann
b506f5c8f8 Bump year. 2002-12-31 16:08:15 +00:00
Marcus Boerger
0d7957bc15 Bug #20433 2002-11-30 18:36:17 +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
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
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
d14a7e0c19 WS 2002-09-23 18:13:31 +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
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
Andi Gutmans
c28df01280 - Add TSRMLS_DC to prototype. 2002-07-08 18:44:05 +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
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
3dbde95896 Make state parameter of php_strip_tags passed by reference.
Move state tracking to stream structure.
2002-03-20 14:38:13 +00:00
Wez Furlong
14a3911866 fix for bug #16168 2002-03-19 17:49:02 +00:00
Wez Furlong
32a4f35580 register some constants for user streams 2002-03-19 14:35:55 +00:00
Wez Furlong
6abe71bebc s/fgetwrapperdata/file_get_wrapper_data/ 2002-03-19 13:33:07 +00:00
Wez Furlong
06712a508a Implement user-space streams.
There's probably room for improvement,
docs will following some time this week.
2002-03-19 03:51:01 +00:00
Wez Furlong
c9d5e13738 TSRMLS related work on streams, as discussed with Zeev.
# Should be the last "broad" commit for a while
# Don't forget to make clean ; make
2002-03-18 18:54:32 +00:00
Wez Furlong
0895998bef s/get_file_contents/file_get_contents/ 2002-03-16 16:52:24 +00:00
Wez Furlong
201446c2b5 Ooops. 2002-03-16 16:14:56 +00:00
Wez Furlong
a184f5d1d3 * formatting, plus remove some old fopen wrappers 2002-03-16 01:34:52 +00:00
Wez Furlong
0f65280cb5 New PHP streams... 2002-03-15 21:03:08 +00:00
Sebastian Bergmann
90613d2282 Maintain headers. 2002-02-28 08:29:35 +00:00
Sebastian Bergmann
38933514e1 Update headers. 2001-12-11 15:32:16 +00:00
Derick Rethans
88c6758d4e - Fixing this bad idea 2001-11-10 18:06:28 +00:00
James Moore
4f78737000 Fix apache win32 dso build.
(This is untested on linux but shouldnt break anything)
2001-11-10 17:24:02 +00:00