40static int le_stream_filter =
FAILURE;
54 return le_stream_filter;
59 return (
FG(stream_wrappers) ?
FG(stream_wrappers) : &url_stream_wrappers_hash);
64 return &url_stream_wrappers_hash;
67static int forget_persistent_resource_id_numbers(
zval *el)
72 if (rsrc->
type != le_pstream) {
79fprintf(stderr,
"forget_persistent: %s:%p\n", stream->
ops->
label, stream);
97 forget_persistent_resource_id_numbers(el);
115 if ((le = zend_hash_str_find_ptr(&
EG(persistent_list), persistent_id,
strlen(persistent_id))) !=
NULL) {
116 if (le->
type == le_pstream) {
125 if (regentry->
ptr == le->
ptr) {
127 (*stream)->res = regentry;
145 if (!
FG(wrapper_errors)) {
148 return (
zend_llist*) zend_hash_str_find_ptr(
FG(wrapper_errors), (
const char*)&wrapper,
sizeof(wrapper));
153static void php_stream_display_wrapper_errors(
php_stream_wrapper *wrapper,
const char *path,
const char *caption)
166 zend_llist *err_list = php_get_wrapper_errors_list(wrapper);
173 const char **err_buf_p;
176 if (
PG(html_errors)) {
208 msg =
"operation failed";
212 msg =
"no suitable wrapper could be found";
225 if (wrapper &&
FG(wrapper_errors)) {
230static void wrapper_error_dtor(
void *
error)
235static void wrapper_list_dtor(
zval *item) {
255 if (!
FG(wrapper_errors)) {
259 list = zend_hash_str_find_ptr(
FG(wrapper_errors), (
const char*)&wrapper,
sizeof(wrapper));
265 list = zend_hash_str_update_mem(
FG(wrapper_errors), (
const char*)&wrapper,
266 sizeof(wrapper), &new_list,
sizeof(new_list));
286 ret->readfilters.stream =
ret;
287 ret->writefilters.stream =
ret;
290fprintf(stderr,
"stream_alloc: %s:%p persistent=%s\n",
ops->label,
ret, persistent_id);
294 ret->abstract = abstract;
295 ret->is_persistent = persistent_id ? 1 : 0;
296 ret->chunk_size =
FG(def_chunk_size);
303 if (
FG(auto_detect_line_endings)) {
338static const char *_php_stream_pretty_free_options(
int close_options,
char *
out)
358static int _php_stream_free_persistent(
zval *
zv,
void *pStream)
361 return le->
ptr == pStream;
369 int release_cast = 1;
394 fprintf(stderr,
"stream_free: %s:%p[%s] in_free=%d opts=%s\n",
430 if (preserve_handle) {
444fprintf(stderr,
"stream_free: %s:%p[%s] preserve_handle=%d release_cast=%d remove_rsrc=%d\n",
478 ret = stream->
ops->
close(stream, preserve_handle ? 0 : 1);
546 bool old_eof = stream->
eof;
558 ssize_t justread = 0;
566 if (justread < 0 && stream->writepos == stream->
readpos) {
570 }
else if (justread > 0) {
592 brig_swap = brig_inp;
593 brig_inp = brig_outp;
594 brig_outp = brig_swap;
595 memset(brig_outp, 0,
sizeof(*brig_outp));
603 while (brig_inp->
head) {
604 bucket = brig_inp->
head;
640 while ((bucket = brig_inp->
head)) {
645 while ((bucket = brig_outp->head)) {
665 ssize_t justread = 0;
699 if (old_eof != stream->
eof) {
708 ssize_t toread = 0, didread = 0;
755 if ((
size_t) toread >
size) {
797 zend_string_efree(str);
804 if ((
size_t) read <
len / 2) {
805 return zend_string_truncate(str, read, 0);
829 unsigned char buf = c;
850 char newline[2] =
"\n";
861 memset(ssb, 0,
sizeof(*ssb));
876 return (stream->
ops->
stat)(stream, ssb);
882 const char *cr, *lf, *eol =
NULL;
895 cr = memchr(readptr,
'\r', avail);
896 lf = memchr(readptr,
'\n', avail);
898 if (cr && lf != cr + 1 && !(lf && lf < cr)) {
903 }
else if ((cr && lf && cr == lf - 1) || (lf)) {
909 eol = memchr(readptr,
'\r', avail);
912 eol = memchr(readptr,
'\n', avail);
922 size_t *returned_len)
925 size_t current_buf_size = 0;
926 size_t total_copied = 0;
928 char *bufstart =
buf;
962 cpysz = eol - readptr + 1;
976 bufstart =
erealloc(bufstart, current_buf_size + cpysz + 1);
977 current_buf_size += cpysz + 1;
978 buf = bufstart + total_copied;
980 if (cpysz >=
maxlen - 1) {
992 total_copied += cpysz;
997 }
else if (stream->
eof) {
1020 if (total_copied == 0) {
1029 *returned_len = total_copied;
1035#define STREAM_BUFFERED_AMOUNT(stream) \
1036 ((size_t)(((stream)->writepos) - (stream)->readpos))
1038static const char *_php_stream_search_delim(
php_stream *stream,
1048 if (seek_len <= skiplen) {
1052 if (delim_len == 1) {
1054 delim[0], seek_len - skiplen);
1065 const char *found_delim =
NULL;
1066 size_t buffered_len,
1068 bool has_delim = delim_len > 0;
1075 found_delim = _php_stream_search_delim(
1076 stream,
maxlen, 0, delim, delim_len);
1081 while (!found_delim && buffered_len <
maxlen) {
1092 if (just_read == 0) {
1104 found_delim = _php_stream_search_delim(
1106 buffered_len >= (delim_len - 1)
1107 ? buffered_len - (delim_len - 1)
1114 buffered_len += just_read;
1117 if (has_delim && found_delim) {
1118 tent_ret_len = found_delim - (
char*)&stream->
readbuf[stream->
readpos];
1137 ret_buf = zend_string_alloc(tent_ret_len, 0);
1151static ssize_t _php_stream_write_buffer(
php_stream *stream,
const char *
buf,
size_t count)
1153 ssize_t didwrite = 0;
1165 bool old_eof = stream->
eof;
1168 size_t chunk_size =
count;
1176 if (justwrote <= 0) {
1179 if (didwrite == 0) {
1189 didwrite += justwrote;
1196 if (old_eof != stream->
eof) {
1209 size_t consumed = 0;
1233 brig_swap = brig_inp;
1234 brig_inp = brig_outp;
1235 brig_outp = brig_swap;
1236 memset(brig_outp, 0,
sizeof(*brig_outp));
1243 while (brig_inp->
head) {
1244 bucket = brig_inp->
head;
1245 if (_php_stream_write_buffer(stream, bucket->
buf, bucket->
buflen) < 0) {
1246 consumed = (ssize_t) -1;
1265 return (ssize_t) -1;
1299 return (ssize_t) -1;
1305 bytes = _php_stream_write_buffer(stream,
buf,
count);
1499 }
while (b > 0 && mapped > bcount);
1512 if (b < 0 && bcount == 0) {
1524 size_t len = 0, buflen;
1559 zend_string_free(
result);
1586 if (
len + min_room >= buflen) {
1605 zend_string_free(
result);
1616 size_t haveread = 0;
1629#ifdef HAVE_COPY_FILE_RANGE
1635 int src_fd, dest_fd, dest_open_flags = 0;
1642 !(dest_open_flags & O_APPEND)) {
1645 const size_t cfr_max =
MIN(
maxlen, (
size_t)SSIZE_MAX);
1652 ssize_t
result = copy_file_range(src_fd,
NULL, dest_fd,
NULL, cfr_max, 0);
1654 size_t nbytes = (size_t)
result;
1667 }
else if (
result == 0) {
1713 size_t chunk_size, must_read, mapped;
1718 must_read =
maxlen - haveread;
1724 chunk_size = must_read;
1747 *
len = haveread += didwrite;
1752 if (mapped == 0 || mapped != didwrite) {
1755 if (mapped < chunk_size) {
1760 must_read -= mapped;
1761 if (must_read == 0) {
1770 size_t readchunk =
sizeof(
buf);
1775 readchunk =
maxlen - haveread;
1786 haveread += didread;
1790 if (didwrite <= 0) {
1791 *
len = haveread - (didread - towrite);
1795 towrite -= didwrite;
1796 writeptr += didwrite;
1825static void stream_resource_regular_dtor(
zend_resource *rsrc)
1832static void stream_resource_persistent_dtor(
zend_resource *rsrc)
1840 FG(user_stream_current_filename) =
NULL;
1841 if (
FG(stream_wrappers)) {
1844 FG(stream_wrappers) =
NULL;
1847 if (
FG(stream_filters)) {
1850 FG(stream_filters) =
NULL;
1853 if (
FG(wrapper_errors)) {
1856 FG(wrapper_errors) =
NULL;
1894static inline zend_result php_stream_wrapper_scheme_validate(
const char *protocol,
unsigned int protocol_len)
1898 for(i = 0; i < protocol_len; i++) {
1899 if (!isalnum((
int)protocol[i]) &&
1900 protocol[i] !=
'+' &&
1901 protocol[i] !=
'-' &&
1902 protocol[i] !=
'.') {
1913 size_t protocol_len =
strlen(protocol);
1917 if (php_stream_wrapper_scheme_validate(protocol, protocol_len) ==
FAILURE) {
1922 ret = zend_hash_add_ptr(&url_stream_wrappers_hash, str, (
void*)wrapper) ?
SUCCESS :
FAILURE;
1932static void clone_wrapper_hash(
void)
1946 if (!
FG(stream_wrappers)) {
1947 clone_wrapper_hash();
1950 return zend_hash_add_ptr(
FG(stream_wrappers), protocol, wrapper) ?
SUCCESS :
FAILURE;
1955 if (!
FG(stream_wrappers)) {
1956 clone_wrapper_hash();
1966 HashTable *wrapper_hash = (
FG(stream_wrappers) ?
FG(stream_wrappers) : &url_stream_wrappers_hash);
1968 const char *
p, *protocol =
NULL;
1971 if (path_for_open) {
1972 *path_for_open = (
char*)path;
1979 for (
p = path; isalnum((
int)*
p) || *
p ==
'+' || *
p ==
'-' || *
p ==
'.';
p++) {
1983 if ((*
p ==
':') && (
n > 1) && (!
strncmp(
"//",
p+1, 2) || (
n == 4 && !memcmp(
"data:", path, 5)))) {
1988 if (
NULL == (wrapper = zend_hash_str_find_ptr(wrapper_hash, protocol,
n))) {
1992 if (
NULL == (wrapper = zend_hash_str_find_ptr(wrapper_hash, tmp,
n))) {
1993 char wrapper_name[32];
1995 if (
n >=
sizeof(wrapper_name)) {
1996 n =
sizeof(wrapper_name) - 1;
1998 PHP_STRLCPY(wrapper_name, protocol,
sizeof(wrapper_name),
n);
2000 php_error_docref(
NULL,
E_WARNING,
"Unable to find the wrapper \"%s\" - did you forget to enable it when you configured PHP?", wrapper_name);
2016 if (!
strncasecmp(path,
"file://localhost/", 17)) {
2021 if (localhost == 0 && path[
n+3] !=
'\0' && path[
n+3] !=
'/' && path[
n+4] !=
':') {
2023 if (localhost == 0 && path[
n+3] !=
'\0' && path[
n+3] !=
'/') {
2031 if (path_for_open) {
2033 *path_for_open = (
char*)path +
n + 1;
2034 if (localhost == 1) {
2035 (*path_for_open) += 11;
2037 while (*(++*path_for_open)==
'/') {
2041 if (*(*path_for_open + 1) !=
':')
2051 if (
FG(stream_wrappers)) {
2060 if ((wrapper = zend_hash_find_ex_ptr(wrapper_hash,
ZSTR_KNOWN(ZEND_STR_FILE), 1)) !=
NULL) {
2070 return plain_files_wrapper;
2073 if (wrapper && wrapper->
is_url &&
2075 (!
PG(allow_url_fopen) ||
2077 PG(in_user_include)) && !
PG(allow_url_include)))) {
2080 if (!
PG(allow_url_fopen)) {
2125 const char *path_to_open = path;
2127 memset(ssb, 0,
sizeof(*ssb));
2143 const char *path_to_open;
2145 if (!path || !*path) {
2149 path_to_open = path;
2162 }
else if (wrapper) {
2166 php_stream_display_wrapper_errors(wrapper, path,
"Failed to open directory");
2168 php_stream_tidy_wrapper_error_log(wrapper);
2192 const char *path_to_open;
2196 char *copy_of_path =
NULL;
2200 path_str = *opened_path;
2202 *opened_path =
NULL;
2205 if (!path || !*path) {
2216 if (resolved_path) {
2223 if (resolved_path) {
2230 path_to_open = path;
2235 if (resolved_path) {
2244 "wrapper does not support stream open");
2255 "wrapper does not support persistent streams");
2266 if (opened_path && !*opened_path && resolved_path) {
2267 *opened_path = resolved_path;
2268 resolved_path =
NULL;
2288 if (resolved_path) {
2297 if (resolved_path) {
2326 php_stream_display_wrapper_errors(wrapper, path,
"Failed to open stream");
2327 if (opened_path && *opened_path) {
2329 *opened_path =
NULL;
2332 php_stream_tidy_wrapper_error_log(wrapper);
2334 if (stream ==
NULL && copy_of_path !=
NULL) {
2338 if (resolved_path) {
2364 char *xmsg,
int xcode,
size_t bytes_sofar,
size_t bytes_max,
void *
ptr)
2367 context->notifier->func(
context, notifycode, severity, xmsg, xcode, bytes_sofar, bytes_max,
ptr);
2401 if (notifier->
dtor) {
2402 notifier->
dtor(notifier);
2408 const char *wrappername,
const char *optionname)
2419 const char *wrappername,
const char *optionname,
zval *optionvalue)
2426 if (
NULL == wrapperhash) {
2458 unsigned int vector_size = 0;
2459 unsigned int nfiles = 0;
2471 if (nfiles == vector_size) {
2472 if (vector_size == 0) {
2475 if(vector_size*2 < vector_size) {
2485 if(vector_size < 10 || nfiles + 1 == 0) {
2494 if (nfiles > 0 && compare) {
2495 qsort(*namelist, nfiles,
sizeof(
zend_string *), (
int(*)(
const void *,
const void *))compare);
2501 for (
unsigned int i = 0; i < nfiles; i++) {
2502 zend_string_efree(vector[i]);
fprintf($stream, string $format, mixed ... $values)
strcoll(string $string1, string $string2)
dirname(string $path, int $levels=1)
count(Countable|array $value, int $mode=COUNT_NORMAL)
assert(mixed $assertion, Throwable|string|null $description=null)
strchr(string $haystack, string $needle, bool $before_needle=false)
memset(ptr, 0, type->size)
zend_ffi_ctype_name_buf buf
PHPAPI int php_le_stream_context(void)
const php_stream_filter_ops * ops
PHPAPI zend_string * php_resolve_path(const char *filename, size_t filename_length, const char *path)
PHPAPI char * php_strip_url_passwd(char *url)
PHPAPI php_stream_bucket * php_stream_bucket_new(php_stream *stream, char *buf, size_t buflen, uint8_t own_buf, uint8_t buf_persistent)
PHPAPI void php_stream_bucket_append(php_stream_bucket_brigade *brigade, php_stream_bucket *bucket)
PHPAPI void php_stream_bucket_delref(php_stream_bucket *bucket)
PHPAPI void php_stream_bucket_unlink(php_stream_bucket *bucket)
PHPAPI php_stream_filter * php_stream_filter_remove(php_stream_filter *filter, int call_dtor)
PHPAPI ZEND_COLD void php_error_docref(const char *docref, int type, const char *format,...)
PHPAPI ZEND_COLD void php_error_docref1(const char *docref, const char *param1, int type, const char *format,...)
#define __zend_orig_filename
#define __zend_orig_lineno
#define PHP_STRLCPY(dst, src, size, src_size)
#define PHP_RSHUTDOWN_FUNCTION
unsigned const char * pos
PHP_JSON_API size_t int options
PHPAPI const php_stream_ops php_stream_memory_ops
PHPAPI const php_stream_ops php_stream_temp_ops
#define PHPWRITE(str, str_len)
#define php_stream_notify_completed(context)
struct _php_stream_notifier php_stream_notifier
#define PSFS_FLAG_FLUSH_CLOSE
#define PSFS_FLAG_FLUSH_INC
php_stream_filter_status_t
struct _php_stream_bucket php_stream_bucket
struct _php_stream_bucket_brigade php_stream_bucket_brigade
#define php_stream_mmap_unmap(stream)
@ PHP_STREAM_MAP_MODE_SHARED_READONLY
#define php_stream_mmap_unmap_ex(stream, readden)
#define php_stream_mmap_possible(stream)
#define PHP_STREAM_MMAP_ALL
#define php_stream_mmap_range(stream, offset, length, mode, mapped_len)
#define PHP_STREAM_MMAP_MAX
PHPAPI php_stream_wrapper php_plain_files_wrapper
PHPAPI int php_stream_parse_fopen_modes(const char *mode, int *open_flags)
PHPAPI php_stream_transport_factory_func php_stream_generic_socket_factory
PHPAPI HashTable * php_stream_xport_get_hash(void)
PHPAPI int php_stream_xport_register(const char *protocol, php_stream_transport_factory factory)
#define PHP_STREAM_IS_USERSPACE
#define php_stream_cast(stream, as, ret, show_err)
#define PHP_STREAM_IS_STDIO
struct _php_stream php_stream
struct _php_stream_context php_stream_context
#define PHP_STREAM_FCLOSE_FDOPEN
#define PHP_STREAM_FCLOSE_FOPENCOOKIE
#define php_stream_read(stream, buf, count)
struct _php_stream_dirent php_stream_dirent
#define PHP_STREAM_UNCHANGED
#define PHP_STREAM_OPTION_SET_CHUNK_SIZE
#define PHP_STREAM_TRUNCATE_SET_SIZE
#define PHP_STREAM_NO_PREFERENCE
#define PHP_STREAM_FREE_PRESERVE_HANDLE
struct _php_stream_filter php_stream_filter
#define PHP_STREAM_FLAG_NO_BUFFER
#define PHP_STREAM_FLAG_NO_CLOSE
#define php_stream_readdir(dirstream, dirent)
#define PHP_STREAM_FREE_CALL_DTOR
#define php_stream_auto_cleanup(stream)
#define STREAM_OPEN_FOR_ZEND_STREAM
#define PHP_STREAM_COPY_ALL
#define PHP_STREAM_FLAG_NO_SEEK
#define STREAM_OPEN_FOR_INCLUDE
#define PHP_STREAM_BUFFER_NONE
#define php_stream_seek(stream, offset, whence)
#define php_stream_make_seekable_rel(origstream, newstream, flags)
#define PHP_STREAM_FREE_IGNORE_ENCLOSING
#define PHP_STREAM_FREE_PERSISTENT
#define PHP_STREAM_PERSISTENT_NOT_EXIST
#define php_stream_opendir(path, options, context)
#define php_stream_eof(stream)
#define php_stream_free(stream, close_options)
#define STREAM_ASSUME_REALPATH
#define php_stream_close(stream)
#define PHP_STREAM_OPTION_RETURN_NOTIMPL
#define PHP_STREAM_FLAG_IS_DIR
#define PHP_STREAM_CONTEXT(stream)
#define PHP_STREAM_FREE_CLOSE
#define PHP_STREAM_PERSISTENT_FAILURE
#define php_stream_is(stream, anops)
#define php_stream_tell(stream)
#define PHP_STREAM_FLAG_NO_RSCR_DTOR_CLOSE
#define PHP_STREAM_PREFER_STDIO
#define STREAM_OPEN_PERSISTENT
PHPAPI HashTable * php_get_stream_filters_hash_global(void)
struct _php_stream_ops php_stream_ops
#define php_stream_closedir(dirstream)
#define STREAM_DISABLE_URL_PROTECTION
#define PHP_STREAM_OPTION_READ_BUFFER
#define PHP_STREAM_PERSISTENT_SUCCESS
#define PHP_STREAM_FREE_KEEP_RSRC
#define PHP_STREAM_OPTION_SYNC_API
#define PHP_STREAM_OPTION_RETURN_ERR
#define PHP_STREAM_FLAG_WAS_WRITTEN
#define php_stream_stat(stream, ssb)
#define PHP_STREAM_SYNC_FSYNC
#define PHP_STREAM_FREE_RELEASE_STREAM
#define PHP_STREAM_OPTION_CHECK_LIVENESS
#define PHP_STREAM_OPTION_TRUNCATE_API
#define PHP_STREAM_FLAG_DETECT_EOL
struct _php_stream_wrapper php_stream_wrapper
#define PHP_STREAM_FREE_RSRC_DTOR
#define PHP_STREAM_FCLOSE_NONE
#define PHP_STREAM_SYNC_FDSYNC
#define PHP_STREAM_FLAG_EOL_MAC
#define STREAM_LOCATE_WRAPPERS_ONLY
#define php_stream_set_option(stream, option, value, ptrvalue)
#define PHP_STREAM_OPTION_RETURN_OK
#define php_stream_fill_read_buffer(stream, size)
struct _php_stream_statbuf php_stream_statbuf
#define php_stream_write(stream, buf, count)
#define PHP_STREAM_RELEASED
#define pemalloc_rel_orig(size, persistent)
PHPAPI zend_string * php_stream_get_record(php_stream *stream, size_t maxlen, const char *delim, size_t delim_len)
PHPAPI int _php_stream_free(php_stream *stream, int close_options)
PHPAPI int php_file_le_stream_filter(void)
#define STREAM_BUFFERED_AMOUNT(stream)
PHPAPI const char * php_stream_locate_eol(php_stream *stream, zend_string *buf)
PHPAPI void php_stream_notification_free(php_stream_notifier *notifier)
PHPAPI void php_stream_notification_notify(php_stream_context *context, int notifycode, int severity, char *xmsg, int xcode, size_t bytes_sofar, size_t bytes_max, void *ptr)
PHPAPI bool _php_stream_puts(php_stream *stream, const char *buf)
PHPAPI php_stream_context * php_stream_context_set(php_stream *stream, php_stream_context *context)
PHPAPI int php_stream_from_persistent_id(const char *persistent_id, php_stream **stream)
PHPAPI bool _php_stream_eof(php_stream *stream)
PHPAPI int _php_stream_stat_path(const char *path, int flags, php_stream_statbuf *ssb, php_stream_context *context)
PHPAPI ssize_t _php_stream_printf(php_stream *stream, const char *fmt,...)
PHPAPI zend_string * _php_stream_copy_to_mem(php_stream *src, size_t maxlen, int persistent STREAMS_DC)
PHPAPI int _php_stream_rmdir(const char *path, int options, php_stream_context *context)
PHPAPI int _php_stream_putc(php_stream *stream, int c)
PHPAPI int _php_stream_flush(php_stream *stream, int closing)
PHPAPI int _php_stream_getc(php_stream *stream)
PHPAPI zend_result _php_stream_copy_to_stream_ex(php_stream *src, php_stream *dest, size_t maxlen, size_t *len STREAMS_DC)
PHPAPI zend_string * php_stream_read_to_str(php_stream *stream, size_t len)
PHPAPI char * _php_stream_get_line(php_stream *stream, char *buf, size_t maxlen, size_t *returned_len)
PHPAPI php_stream_notifier * php_stream_notification_alloc(void)
PHPAPI int _php_stream_truncate_set_size(php_stream *stream, size_t newsize)
PHPAPI int php_stream_dirent_alphasort(const zend_string **a, const zend_string **b)
PHPAPI int _php_stream_mkdir(const char *path, int mode, int options, php_stream_context *context)
PHPAPI zend_off_t _php_stream_tell(php_stream *stream)
PHPAPI HashTable * php_stream_get_url_stream_wrappers_hash_global(void)
PHPAPI int _php_stream_free_enclosed(php_stream *stream_enclosed, int close_options)
PHPAPI int php_stream_dirent_alphasortr(const zend_string **a, const zend_string **b)
PHPAPI zend_result _php_stream_fill_read_buffer(php_stream *stream, size_t size)
PHPAPI int _php_stream_set_option(php_stream *stream, int option, int value, void *ptrparam)
PHPAPI HashTable * _php_stream_get_url_stream_wrappers_hash(void)
PHPAPI php_stream * php_stream_encloses(php_stream *enclosing, php_stream *enclosed)
PHPAPI zend_result php_register_url_stream_wrapper(const char *protocol, const php_stream_wrapper *wrapper)
PHPAPI void php_stream_context_free(php_stream_context *context)
void php_shutdown_stream_hashes(void)
PHPAPI zend_result php_unregister_url_stream_wrapper_volatile(zend_string *protocol)
int php_init_stream_wrappers(int module_number)
PHPAPI int _php_stream_scandir(const char *dirname, zend_string **namelist[], int flags, php_stream_context *context, int(*compare)(const zend_string **a, const zend_string **b))
PHPAPI php_stream * _php_stream_alloc(const php_stream_ops *ops, void *abstract, const char *persistent_id, const char *mode STREAMS_DC)
PHPAPI int php_file_le_pstream(void)
PHPAPI ssize_t _php_stream_write(php_stream *stream, const char *buf, size_t count)
PHPAPI void php_stream_wrapper_log_error(const php_stream_wrapper *wrapper, int options, const char *fmt,...)
PHPAPI zval * php_stream_context_get_option(php_stream_context *context, const char *wrappername, const char *optionname)
ZEND_ATTRIBUTE_DEPRECATED PHPAPI size_t _php_stream_copy_to_stream(php_stream *src, php_stream *dest, size_t maxlen STREAMS_DC)
PHPAPI php_stream_context * php_stream_context_alloc(void)
PHPAPI php_stream * _php_stream_open_wrapper_ex(const char *path, const char *mode, int options, zend_string **opened_path, php_stream_context *context STREAMS_DC)
PHPAPI php_stream * _php_stream_opendir(const char *path, int options, php_stream_context *context STREAMS_DC)
PHPAPI ssize_t _php_stream_read(php_stream *stream, char *buf, size_t size)
PHPAPI zend_result php_unregister_url_stream_wrapper(const char *protocol)
PHPAPI int _php_stream_seek(php_stream *stream, zend_off_t offset, int whence)
PHPAPI ssize_t _php_stream_passthru(php_stream *stream STREAMS_DC)
void php_shutdown_stream_wrappers(int module_number)
PHPAPI zend_result php_register_url_stream_wrapper_volatile(zend_string *protocol, php_stream_wrapper *wrapper)
PHPAPI php_stream_wrapper * php_stream_locate_url_wrapper(const char *path, const char **path_for_open, int options)
PHPAPI void php_stream_context_set_option(php_stream_context *context, const char *wrappername, const char *optionname, zval *optionvalue)
PHPAPI php_stream_dirent * _php_stream_readdir(php_stream *dirstream, php_stream_dirent *ent)
PHPAPI int _php_stream_sync(php_stream *stream, bool data_only)
PHPAPI int _php_stream_stat(php_stream *stream, php_stream_statbuf *ssb)
PHPAPI int php_file_le_stream(void)
php_stream_filter_status_t(* filter)(php_stream *stream, php_stream_filter *thisfilter, php_stream_bucket_brigade *buckets_in, php_stream_bucket_brigade *buckets_out, size_t *bytes_consumed, int flags)
const php_stream_filter_ops * fops
void(* dtor)(php_stream_notifier *notifier)
ssize_t(* read)(php_stream *stream, char *buf, size_t count)
int(* flush)(php_stream *stream)
ssize_t(* write)(php_stream *stream, const char *buf, size_t count)
int(* set_option)(php_stream *stream, int option, int value, void *ptrparam)
int(* seek)(php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffset)
int(* close)(php_stream *stream, int close_handle)
int(* stat)(php_stream *stream, php_stream_statbuf *ssb)
int(* stream_rmdir)(php_stream_wrapper *wrapper, const char *url, int options, php_stream_context *context)
int(* url_stat)(php_stream_wrapper *wrapper, const char *url, int flags, php_stream_statbuf *ssb, php_stream_context *context)
int(* stream_closer)(php_stream_wrapper *wrapper, php_stream *stream)
int(* stream_stat)(php_stream_wrapper *wrapper, php_stream *stream, php_stream_statbuf *ssb)
php_stream *(* stream_opener)(php_stream_wrapper *wrapper, const char *filename, const char *mode, int options, zend_string **opened_path, php_stream_context *context STREAMS_DC)
int(* stream_mkdir)(php_stream_wrapper *wrapper, const char *url, int mode, int options, php_stream_context *context)
php_stream *(* dir_opener)(php_stream_wrapper *wrapper, const char *filename, const char *mode, int options, zend_string **opened_path, php_stream_context *context STREAMS_DC)
const php_stream_wrapper_ops * wops
const php_stream_ops * ops
struct _php_stream * enclosing_stream
uint16_t fclose_stdiocast
php_stream_filter_chain writefilters
uint16_t has_buffered_data
uint16_t fclose_stdiocast_flush_in_progress
php_stream_filter_chain readfilters
php_stream_wrapper * wrapper
ZEND_API ZEND_COLD void zend_value_error(const char *format,...)
ZEND_API zend_string *(* zend_resolve_path)(zend_string *filename)
#define safe_erealloc(ptr, nmemb, size, offset)
#define estrndup(s, length)
#define pestrdup(s, persistent)
#define perealloc(ptr, size, persistent)
#define ecalloc(nmemb, size)
#define pefree(ptr, persistent)
#define erealloc(ptr, size)
#define ALLOC_HASHTABLE(ht)
strncmp(string $string1, string $string2, int $length)
defined(string $constant_name)
zend_string_release_ex(func->internal_function.function_name, 0)
#define strncasecmp(s1, s2, n)
#define EG_FLAGS_IN_RESOURCE_SHUTDOWN
ZEND_API void ZEND_FASTCALL zend_hash_destroy(HashTable *ht)
ZEND_API zval *ZEND_FASTCALL zend_hash_str_find(const HashTable *ht, const char *str, size_t len)
ZEND_API void ZEND_FASTCALL zend_hash_apply_with_argument(HashTable *ht, apply_func_arg_t apply_func, void *argument)
ZEND_API zval *ZEND_FASTCALL zend_hash_str_update(HashTable *ht, const char *str, size_t len, zval *pData)
ZEND_API void ZEND_FASTCALL zend_hash_copy(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor)
ZEND_API zend_result ZEND_FASTCALL zend_hash_del(HashTable *ht, zend_string *key)
ZEND_API zend_result ZEND_FASTCALL zend_hash_str_del(HashTable *ht, const char *str, size_t len)
#define zend_hash_init(ht, nSize, pHashFunction, pDestructor, persistent)
#define ZEND_HASH_FOREACH_PTR(ht, _ptr)
#define ZEND_HASH_FOREACH_END()
#define ZEND_HASH_FOREACH_VAL(ht, _val)
ZEND_API zend_resource * zend_register_resource(void *rsrc_pointer, int rsrc_type)
ZEND_API zend_result ZEND_FASTCALL zend_list_delete(zend_resource *res)
ZEND_API zend_resource * zend_register_persistent_resource(const char *key, size_t key_len, void *rsrc_pointer, int rsrc_type)
ZEND_API void ZEND_FASTCALL zend_list_close(zend_resource *res)
ZEND_API int zend_register_list_destructors_ex(rsrc_dtor_func_t ld, rsrc_dtor_func_t pld, const char *type_name, int module_number)
ZEND_API void zend_llist_destroy(zend_llist *l)
ZEND_API size_t zend_llist_count(zend_llist *l)
ZEND_API void zend_llist_add_element(zend_llist *l, const void *element)
ZEND_API void zend_llist_init(zend_llist *l, size_t size, llist_dtor_func_t dtor, unsigned char persistent)
ZEND_API void * zend_llist_get_next_ex(zend_llist *l, zend_llist_position *pos)
ZEND_API void * zend_llist_get_first_ex(zend_llist *l, zend_llist_position *pos)
zend_llist_element * zend_llist_position
struct _zend_llist zend_llist
struct _zend_string zend_string
ZEND_API void ZEND_FASTCALL zend_str_tolower(char *str, size_t length)
#define ZEND_ATTRIBUTE_DEPRECATED
#define UNEXPECTED(condition)
ZEND_API zend_string_init_interned_func_t zend_string_init_interned
#define ZSTR_EMPTY_ALLOC()
#define Z_TRY_ADDREF_P(pz)
#define Z_ARRVAL_P(zval_p)
struct _zend_resource zend_resource
struct _zend_array HashTable
ZEND_RESULT_CODE zend_result
#define SEPARATE_ARRAY(zv)
ZEND_API void zval_ptr_dtor(zval *zval_ptr)