diff options
author | Wez Furlong <wez@php.net> | 2003-03-18 23:37:54 +0000 |
---|---|---|
committer | Wez Furlong <wez@php.net> | 2003-03-18 23:37:54 +0000 |
commit | 86fb577d591b1b3f6fb5d752ba3912bcb6f6a704 (patch) | |
tree | b54835962c33111ab65bd4634ecde9d6e685fdbd /main/php_streams.h | |
parent | 6a8765100606837933bf09ec7bde70e01b36cca9 (diff) | |
download | php-git-86fb577d591b1b3f6fb5d752ba3912bcb6f6a704.tar.gz |
Implement persistent plain file streams.
Usage:
php_stream *stream = php_stream_fopen("/path/to/file", "r+b", NULL,
STREAM_OPEN_PERSISTENT | ENFORCE_SAFE_MODE | REPORT_ERRORS);
the filename and mode are combined to form the hash key for the persistent
list; they must be identical for this same stream to be returned again in the
next request.
Calling php_stream_close() on a persistent stream *will* close it, as is
usual with all persistent resources in PHP/ZE.
This is deliberately *not* exposed to user-space PHP at this time.
Diffstat (limited to 'main/php_streams.h')
-rwxr-xr-x | main/php_streams.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/main/php_streams.h b/main/php_streams.h index e449dc38d8..21d53976a8 100755 --- a/main/php_streams.h +++ b/main/php_streams.h @@ -64,7 +64,7 @@ PHPAPI int php_file_le_pstream(void); #define php_stream_fopen_with_path_rel(filename, mode, path, opened, options) _php_stream_fopen_with_path((filename), (mode), (path), (opened), (options) STREAMS_REL_CC TSRMLS_CC) -#define php_stream_fopen_from_fd_rel(fd, mode) _php_stream_fopen_from_fd((fd), (mode) STREAMS_REL_CC TSRMLS_CC) +#define php_stream_fopen_from_fd_rel(fd, mode, persistent_id) _php_stream_fopen_from_fd((fd), (mode), (persistent_id) STREAMS_REL_CC TSRMLS_CC) #define php_stream_fopen_from_file_rel(file, mode) _php_stream_fopen_from_file((file), (mode) STREAMS_REL_CC TSRMLS_CC) #define php_stream_fopen_from_pipe_rel(file, mode) _php_stream_fopen_from_pipe((file), (mode) STREAMS_REL_CC TSRMLS_CC) @@ -437,6 +437,9 @@ PHPAPI int _php_stream_cast(php_stream *stream, int castas, void **ret, int show /* don't apply open_basedir checks */ #define STREAM_DISABLE_OPEN_BASEDIR 1024 +/* get (or create) a persistent version of the stream */ +#define STREAM_OPEN_PERSISTENT 2048 + /* Antique - no longer has meaning */ #define IGNORE_URL_WIN 0 |