]> granicus.if.org Git - php/commitdiff
Remove php_stream_open_wrapper_as_file_handle, it was fd-patch specific
authorZeev Suraski <zeev@php.net>
Wed, 21 May 2003 10:19:03 +0000 (10:19 +0000)
committerZeev Suraski <zeev@php.net>
Wed, 21 May 2003 10:19:03 +0000 (10:19 +0000)
main/php_streams.h
main/streams.c

index 83e8c8b71c03a6d11e4fdea1fd16915be48e78fc..9af2679cf238a404ba360cb89817b662f9175e66 100755 (executable)
@@ -554,9 +554,6 @@ PHPAPI FILE * _php_stream_open_wrapper_as_file(char * path, char * mode, int opt
 #define php_stream_open_wrapper_as_file(path, mode, options, opened_path) _php_stream_open_wrapper_as_file((path), (mode), (options), (opened_path) STREAMS_CC TSRMLS_CC)
 
 
-PHPAPI zend_bool _php_stream_open_wrapper_as_file_handle(char * path, char * mode, int options, zend_file_handle * STREAMS_DC TSRMLS_DC);
-#define php_stream_open_wrapper_as_file_handle(path, mode, options, fh) _php_stream_open_wrapper_as_file_handle((path), (mode), (options), (fh) STREAMS_CC TSRMLS_CC)
-
 /* for user-space streams */
 PHPAPI extern php_stream_ops php_stream_userspace_ops;
 PHPAPI extern php_stream_ops php_stream_userspace_dir_ops;
index 1401e88aedba1c86389a984f0d20355b25b0b2b2..357894ef699f47867958c077d81511a046116496 100755 (executable)
@@ -2725,45 +2725,6 @@ PHPAPI FILE * _php_stream_open_wrapper_as_file(char *path, char *mode, int optio
 
 
 
-/* {{{ php_stream_open_wrapper_as_file_handle */
-PHPAPI zend_bool _php_stream_open_wrapper_as_file_handle(char *path, char *mode, int options, zend_file_handle *fh STREAMS_DC TSRMLS_DC)
-{
-       php_stream *stream = NULL;
-       int is_sock = 0;
-
-       stream = php_stream_open_wrapper_rel(path, mode, options|STREAM_WILL_CAST, &fh->opened_path);
-
-       if (stream == NULL)
-               return FAILURE;
-
-       if ((options & STREAM_OPEN_FOR_INCLUDE) 
-                       && php_stream_is(stream, PHP_STREAM_IS_SOCKET)) {
-               is_sock = 1;
-       }
-
-       if (php_stream_can_cast(stream, PHP_STREAM_AS_FD) == SUCCESS &&
-                       php_stream_cast(stream, PHP_STREAM_AS_FD | PHP_STREAM_CAST_TRY_HARD 
-                               | PHP_STREAM_CAST_RELEASE, (void **) &fh->handle.fd, 
-                               REPORT_ERRORS) == SUCCESS) {
-               if (is_sock) {
-                       fh->type = ZEND_HANDLE_SOCKET_FD;
-               } else {
-                       fh->type = ZEND_HANDLE_FD;
-               }
-       } else if (php_stream_cast(stream, PHP_STREAM_AS_STDIO
-                               |PHP_STREAM_CAST_TRY_HARD | PHP_STREAM_CAST_RELEASE,
-                               (void**) &fh->handle.fp, REPORT_ERRORS) == SUCCESS) {
-               fh->type = ZEND_HANDLE_FP;
-       } else {
-               php_stream_close(stream);
-               if (fh->opened_path)
-                       efree(fh->opened_path);
-               fh->opened_path = NULL;
-               return FAILURE;
-       }
-       return SUCCESS;
-}
-/* }}} */
 
 /* {{{ php_stream_make_seekable */
 PHPAPI int _php_stream_make_seekable(php_stream *origstream, php_stream **newstream, int flags STREAMS_DC TSRMLS_DC)