mirror of
https://github.com/php/php-src.git
synced 2024-11-23 01:44:06 +08:00
[skip ci] Fix various typos and grammar issues (#11143)
This commit is contained in:
parent
294d3e9eb5
commit
732d92c0e5
@ -354,7 +354,7 @@ PHP_FUNCTION(juliantojd)
|
||||
|
||||
/* {{{ heb_number_to_chars*/
|
||||
/*
|
||||
caution: the Hebrew format produces non unique result.
|
||||
caution: the Hebrew format produces non-unique result.
|
||||
for example both: year '5' and year '5000' produce 'ה'.
|
||||
use the numeric one for calculations.
|
||||
*/
|
||||
|
@ -152,7 +152,7 @@ void gdImageBmpCtx(gdImagePtr im, gdIOCtxPtr out, int compression)
|
||||
gdBMPPutInt(out, im->colorsTotal); /* colours used */
|
||||
gdBMPPutInt(out, 0); /* important colours */
|
||||
|
||||
/* The line must be divisible by 4, else its padded with NULLs */
|
||||
/* The line must be divisible by 4, else it's padded with NULLs */
|
||||
padding = ((int)(im->trueColor ? 3 : 1) * im->sx) % 4;
|
||||
if (padding) {
|
||||
padding = 4 - padding;
|
||||
@ -646,7 +646,7 @@ static int bmp_read_os2_v2_info(gdIOCtxPtr infile, bmp_info_t *info)
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Lets seek the next 24 pointless bytes, we don't care too much about it */
|
||||
/* Let's seek the next 24 pointless bytes, we don't care too much about it */
|
||||
if (!gdGetBuf(useless_bytes, 24, infile)) {
|
||||
return 1;
|
||||
}
|
||||
@ -716,7 +716,7 @@ static int bmp_read_direct(gdImagePtr im, gdIOCtxPtr infile, bmp_info_t *info, b
|
||||
}
|
||||
}
|
||||
|
||||
/* The line must be divisible by 4, else its padded with NULLs */
|
||||
/* The line must be divisible by 4, else it's padded with NULLs */
|
||||
padding = ((int)(info->depth / 8) * info->width) % 4;
|
||||
if (padding) {
|
||||
padding = 4 - padding;
|
||||
@ -883,7 +883,7 @@ static int bmp_read_4bit(gdImagePtr im, gdIOCtxPtr infile, bmp_info_t *info, bmp
|
||||
}
|
||||
}
|
||||
|
||||
/* The line must be divisible by 4, else its padded with NULLs */
|
||||
/* The line must be divisible by 4, else it's padded with NULLs */
|
||||
padding = ((int)ceil(0.5 * info->width)) % 4;
|
||||
if (padding) {
|
||||
padding = 4 - padding;
|
||||
@ -970,7 +970,7 @@ static int bmp_read_8bit(gdImagePtr im, gdIOCtxPtr infile, bmp_info_t *info, bmp
|
||||
}
|
||||
}
|
||||
|
||||
/* The line must be divisible by 4, else its padded with NULLs */
|
||||
/* The line must be divisible by 4, else it's padded with NULLs */
|
||||
padding = (1 * info->width) % 4;
|
||||
if (padding) {
|
||||
padding = 4 - padding;
|
||||
|
@ -161,7 +161,7 @@ PHP_HASH_API void PHP_FNV164Final(unsigned char digest[8], PHP_FNV164_CTX * cont
|
||||
* alternate - if > 0 use the alternate version
|
||||
*
|
||||
* returns:
|
||||
* 32 bit hash as a static hash type
|
||||
* 32-bit hash as a static hash type
|
||||
*/
|
||||
static uint32_t
|
||||
fnv_32_buf(void *buf, size_t len, uint32_t hval, int alternate)
|
||||
@ -204,7 +204,7 @@ fnv_32_buf(void *buf, size_t len, uint32_t hval, int alternate)
|
||||
* alternate - if > 0 use the alternate version
|
||||
*
|
||||
* returns:
|
||||
* 64 bit hash as a static hash type
|
||||
* 64-bit hash as a static hash type
|
||||
*/
|
||||
static uint64_t
|
||||
fnv_64_buf(void *buf, size_t len, uint64_t hval, int alternate)
|
||||
|
@ -238,7 +238,7 @@ PHP_HASH_API void PHP_MD4Update(PHP_MD4_CTX * context, const unsigned char *inpu
|
||||
/* }}} */
|
||||
|
||||
/* {{{ PHP_MD4Final
|
||||
MD4 finalization. Ends an MD4 message-digest operation, writing the
|
||||
MD4 finalization. Ends an MD4 message-digest operation, writing
|
||||
the message digest and zeroizing the context.
|
||||
*/
|
||||
PHP_HASH_API void PHP_MD4Final(unsigned char digest[16], PHP_MD4_CTX * context)
|
||||
|
@ -370,7 +370,7 @@ zval* collator_normalize_sort_argument( zval* arg, zval *rv )
|
||||
|
||||
if( Z_TYPE_P( arg ) != IS_STRING )
|
||||
{
|
||||
/* If its not a string then nothing to do.
|
||||
/* If it's not a string then nothing to do.
|
||||
* Return original arg.
|
||||
*/
|
||||
COLLATOR_CONVERT_RETURN_FAILED( arg );
|
||||
|
@ -22,7 +22,7 @@
|
||||
*
|
||||
*/
|
||||
/*
|
||||
* The source code included in this files was separated from mbfilter.c
|
||||
* The source code included in this file was separated from mbfilter.c
|
||||
* by Moriyoshi Koizumi <moriyoshi@php.net> on 4 Dec 2002. The file
|
||||
* mbfilter.c is included in this package .
|
||||
*
|
||||
|
@ -22,7 +22,7 @@
|
||||
*
|
||||
*/
|
||||
/*
|
||||
* The source code included in this files was separated from mbfilter_tw.c
|
||||
* The source code included in this file was separated from mbfilter_tw.c
|
||||
* by moriyoshi koizumi <moriyoshi@php.net> on 4 dec 2002.
|
||||
*
|
||||
*/
|
||||
|
@ -22,7 +22,7 @@
|
||||
*
|
||||
*/
|
||||
/*
|
||||
* the source code included in this files was separated from mbfilter_cn.c
|
||||
* the source code included in this file was separated from mbfilter_cn.c
|
||||
* by moriyoshi koizumi <moriyoshi@php.net> on 4 dec 2002.
|
||||
*
|
||||
*/
|
||||
|
@ -22,7 +22,7 @@
|
||||
*
|
||||
*/
|
||||
/*
|
||||
* The source code included in this files was separated from mbfilter_cn.c
|
||||
* The source code included in this file was separated from mbfilter_cn.c
|
||||
* by Moriyoshi Koizumi <moriyoshi@php.net> on 4 Dec 2002.
|
||||
*
|
||||
*/
|
||||
|
@ -22,7 +22,7 @@
|
||||
*
|
||||
*/
|
||||
/*
|
||||
* The source code included in this files was separated from mbfilter_ja.c
|
||||
* The source code included in this file was separated from mbfilter_ja.c
|
||||
* by moriyoshi koizumi <moriyoshi@php.net> on 4 dec 2002.
|
||||
*
|
||||
*/
|
||||
|
@ -22,7 +22,7 @@
|
||||
*
|
||||
*/
|
||||
/*
|
||||
* The source code included in this files was separated from mbfilter_ja.c
|
||||
* The source code included in this file was separated from mbfilter_ja.c
|
||||
* by moriyoshi koizumi <moriyoshi@php.net> on 4 dec 2002.
|
||||
*
|
||||
*/
|
||||
|
@ -22,7 +22,7 @@
|
||||
*
|
||||
*/
|
||||
/*
|
||||
* the source code included in this files was separated from mbfilter_cp936.c
|
||||
* the source code included in this file was separated from mbfilter_cp936.c
|
||||
* by rui hirokawa <hirokawa@php.net> on 11 Aug 2011.
|
||||
*
|
||||
*/
|
||||
|
@ -22,7 +22,7 @@
|
||||
*
|
||||
*/
|
||||
/*
|
||||
* The source code included in this files was separated from mbfilter_iso2022_jp_ms.c
|
||||
* The source code included in this file was separated from mbfilter_iso2022_jp_ms.c
|
||||
* by Rui Hirokawa <hirokawa@php.net> on 25 July 2011.
|
||||
*
|
||||
*/
|
||||
|
@ -22,7 +22,7 @@
|
||||
*
|
||||
*/
|
||||
/*
|
||||
* The source code included in this files was separated from mbfilter.c
|
||||
* The source code included in this file was separated from mbfilter.c
|
||||
* by moriyoshi koizumi <moriyoshi@php.net> on 4 dec 2002.
|
||||
*
|
||||
*/
|
||||
|
@ -22,7 +22,7 @@
|
||||
*
|
||||
*/
|
||||
/*
|
||||
* The source code included in this files was separated from mbfilter_ja.c
|
||||
* The source code included in this file was separated from mbfilter_ja.c
|
||||
* by moriyoshi koizumi <moriyoshi@php.net> on 4 dec 2002.
|
||||
*
|
||||
*/
|
||||
|
@ -22,7 +22,7 @@
|
||||
*
|
||||
*/
|
||||
/*
|
||||
* The source code included in this files was separated from mbfilter.c
|
||||
* The source code included in this file was separated from mbfilter.c
|
||||
* by moriyoshi koizumi <moriyoshi@php.net> on 4 dec 2002.
|
||||
*
|
||||
*/
|
||||
|
@ -22,7 +22,7 @@
|
||||
*
|
||||
*/
|
||||
/*
|
||||
* The source code included in this files was separated from mbfilter.c
|
||||
* The source code included in this file was separated from mbfilter.c
|
||||
* by moriyoshi koizumi <moriyoshi@php.net> on 4 dec 2002.
|
||||
*
|
||||
*/
|
||||
|
@ -22,7 +22,7 @@
|
||||
*
|
||||
*/
|
||||
/*
|
||||
* The source code included in this files was separated from mbfilter.c
|
||||
* The source code included in this file was separated from mbfilter.c
|
||||
* by moriyoshi koizumi <moriyoshi@php.net> on 20 dec 2002.
|
||||
*
|
||||
*/
|
||||
|
@ -22,7 +22,7 @@
|
||||
*
|
||||
*/
|
||||
/*
|
||||
* The source code included in this files was separated from mbfilter.c
|
||||
* The source code included in this file was separated from mbfilter.c
|
||||
* by moriyoshi koizumi <moriyoshi@php.net> on 4 dec 2002.
|
||||
*
|
||||
*/
|
||||
|
@ -22,7 +22,7 @@
|
||||
*
|
||||
*/
|
||||
/*
|
||||
* The source code included in this files was separated from mbfilter.c
|
||||
* The source code included in this file was separated from mbfilter.c
|
||||
* by moriyoshi koizumi <moriyoshi@php.net> on 4 dec 2002.
|
||||
*
|
||||
*/
|
||||
|
@ -22,7 +22,7 @@
|
||||
*
|
||||
*/
|
||||
/*
|
||||
* The source code included in this files was separated from mbfilter.c
|
||||
* The source code included in this file was separated from mbfilter.c
|
||||
* by rui hrokawa <hirokawa@php.net> on 8 aug 2011.
|
||||
*
|
||||
*/
|
||||
|
@ -22,7 +22,7 @@
|
||||
*
|
||||
*/
|
||||
/*
|
||||
* The source code included in this files was separated from mbfilter.c
|
||||
* The source code included in this file was separated from mbfilter.c
|
||||
* by Moriyoshi Koizumi <moriyoshi@php.net> on 20 Dec 2002. The file
|
||||
* mbfilter.c is included in this package .
|
||||
*
|
||||
|
@ -22,7 +22,7 @@
|
||||
*
|
||||
*/
|
||||
/*
|
||||
* The source code included in this files was separated from mbfilter.c
|
||||
* The source code included in this file was separated from mbfilter.c
|
||||
* by Moriyoshi Koizumi <moriyoshi@php.net> on 20 Dec 2002. The file
|
||||
* mbfilter.c is included in this package .
|
||||
*
|
||||
|
@ -22,7 +22,7 @@
|
||||
*
|
||||
*/
|
||||
/*
|
||||
* The source code included in this files was separated from mbfilter.c
|
||||
* The source code included in this file was separated from mbfilter.c
|
||||
* by Moriyoshi Koizumi <moriyoshi@php.net> on 20 Dec 2002. The file
|
||||
* mbfilter.c is included in this package .
|
||||
*
|
||||
|
@ -22,7 +22,7 @@
|
||||
*
|
||||
*/
|
||||
/*
|
||||
* The source code included in this files was separated from mbfilter.c
|
||||
* The source code included in this file was separated from mbfilter.c
|
||||
* by Moriyoshi Koizumi <moriyoshi@php.net> on 20 Dec 2002. The file
|
||||
* mbfilter.c is included in this package .
|
||||
*
|
||||
|
@ -1348,7 +1348,7 @@ PHP_FUNCTION(mb_http_output)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ Sets the current detect_order or Return the current detect_order as a array */
|
||||
/* {{{ Sets the current detect_order or Return the current detect_order as an array */
|
||||
PHP_FUNCTION(mb_detect_order)
|
||||
{
|
||||
zend_string *order_str = NULL;
|
||||
@ -4828,7 +4828,7 @@ finish_up_remaining_bytes:
|
||||
switch (ab) {
|
||||
case 1:
|
||||
/* 2-byte character. No further bytes to check for 0x80. Check first byte
|
||||
* for for xx00 000x (overlong sequence). */
|
||||
* for xx00 000x (overlong sequence). */
|
||||
if ((c & 0x3e) == 0) {
|
||||
return false;
|
||||
}
|
||||
@ -4844,7 +4844,7 @@ finish_up_remaining_bytes:
|
||||
|
||||
case 3:
|
||||
/* 4-byte character. Check 3rd and 4th bytes for 0x80. Then check first 2
|
||||
* bytes for for 1111 0000, xx00 xxxx (overlong sequence), then check for a
|
||||
* bytes for 1111 0000, xx00 xxxx (overlong sequence), then check for a
|
||||
* character greater than 0x0010ffff (f4 8f bf bf) */
|
||||
if ((*(++p) & 0xc0) != 0x80 || (*(++p) & 0xc0) != 0x80 || (c == 0xf0 && (d & 0x30) == 0) || (c > 0xf4 || (c == 0xf4 && d > 0x8f))) {
|
||||
return false;
|
||||
|
@ -691,7 +691,7 @@ mysqlnd_stmt_execute_calculate_param_values_size(MYSQLND_STMT_DATA * stmt, zval
|
||||
/*
|
||||
User hasn't sent anything, we will send empty string.
|
||||
Empty string has length of 0, encoded in 1 byte. No real
|
||||
data will follows after it.
|
||||
data will follow after it.
|
||||
*/
|
||||
(*data_size)++;
|
||||
}
|
||||
|
@ -328,7 +328,7 @@ mysqlnd_query_read_result_set_header(MYSQLND_CONN_DATA * conn, MYSQLND_STMT * s)
|
||||
/*
|
||||
If SERVER_MORE_RESULTS_EXISTS is set then this is either MULTI_QUERY or a CALL()
|
||||
The first packet after sending the query/com_execute has the bit set only
|
||||
in this cases. Not sure why it's a needed but it marks that the whole stream
|
||||
in these cases. Not sure why it's a needed but it marks that the whole stream
|
||||
will include many result sets. What actually matters are the bits set at the end
|
||||
of every result set (the EOF packet).
|
||||
*/
|
||||
|
@ -1636,7 +1636,7 @@ zend_result php_openssl_setup_crypto(php_stream *stream,
|
||||
ERR_clear_error();
|
||||
|
||||
/* We need to do slightly different things based on client/server method
|
||||
* so lets remember which method was selected */
|
||||
* so let's remember which method was selected */
|
||||
sslsock->is_client = cparam->inputs.method & STREAM_CRYPTO_IS_CLIENT;
|
||||
method_flags = cparam->inputs.method & ~STREAM_CRYPTO_IS_CLIENT;
|
||||
|
||||
|
@ -41,7 +41,7 @@ static char *pdo_dblib_get_field_name(int type)
|
||||
* (example: varchar is reported as char by dbprtype)
|
||||
*
|
||||
* FIX ME: Cache datatypes from server systypes table in pdo_dblib_handle_factory()
|
||||
* to make this future proof.
|
||||
* to make this future-proof.
|
||||
*/
|
||||
|
||||
switch (type) {
|
||||
|
@ -2297,7 +2297,7 @@ PHP_FUNCTION(socket_export_stream)
|
||||
getsockopt(socket->bsd_socket, SOL_SOCKET, SO_TYPE, (char *) &protoid, &protoidlen);
|
||||
|
||||
if (protoid == SOCK_STREAM) {
|
||||
/* SO_PROTOCOL is not (yet?) supported on OS X, so lets assume it's TCP there */
|
||||
/* SO_PROTOCOL is not (yet?) supported on OS X, so let's assume it's TCP there */
|
||||
#ifdef SO_PROTOCOL
|
||||
protoidlen = sizeof(protoid);
|
||||
getsockopt(socket->bsd_socket, SOL_SOCKET, SO_PROTOCOL, (char *) &protoid, &protoidlen);
|
||||
|
@ -675,7 +675,7 @@ parse_eol:
|
||||
} while ((p = memchr(p, eol_marker, (e-p))));
|
||||
}
|
||||
|
||||
/* handle any left overs of files without new lines */
|
||||
/* handle any leftovers of files without new lines */
|
||||
if (s != e) {
|
||||
p = e;
|
||||
goto parse_eol;
|
||||
|
@ -939,7 +939,7 @@ static php_conv_err_t php_conv_qprint_decode_convert(php_conv_qprint_decode *ins
|
||||
ps++, icnt--;
|
||||
break;
|
||||
} else if (!inst->lbchars && lb_cnt == 0 && *ps == '\n') {
|
||||
/* auto-detect line endings, looks like unix-lineendings, not to spec, but it is seem in the wild, a lot */
|
||||
/* auto-detect line endings, looks like unix-lineendings, not to spec, but it is seen in the wild, a lot */
|
||||
lb_cnt = lb_ptr = 0;
|
||||
scan_stat = 0;
|
||||
ps++, icnt--;
|
||||
|
@ -712,9 +712,9 @@ static inline int process_named_entity_html(const char **buf, const char **start
|
||||
*start = *buf;
|
||||
|
||||
/* "&" is represented by a 0x26 in all supported encodings. That means
|
||||
* the byte after represents a character or is the leading byte of an
|
||||
* the byte after represents a character or is the leading byte of a
|
||||
* sequence of 8-bit code units. If in the ranges below, it represents
|
||||
* necessarily a alpha character because none of the supported encodings
|
||||
* necessarily an alpha character because none of the supported encodings
|
||||
* has an overlap with ASCII in the leading byte (only on the second one) */
|
||||
while ((**buf >= 'a' && **buf <= 'z') ||
|
||||
(**buf >= 'A' && **buf <= 'Z') ||
|
||||
|
@ -567,7 +567,7 @@ finish:
|
||||
* interprets the RFC literally and establishes a keep-alive connection,
|
||||
* unless the user specifically requests something else by specifying a
|
||||
* Connection header in the context options. Send that header even for
|
||||
* HTTP/1.0 to avoid issues when the server respond with a HTTP/1.1
|
||||
* HTTP/1.0 to avoid issues when the server respond with an HTTP/1.1
|
||||
* keep-alive response, which is the preferred response type. */
|
||||
if ((have_header & HTTP_HEADER_CONNECTION) == 0) {
|
||||
smart_str_appends(&req_buf, "Connection: close\r\n");
|
||||
|
@ -590,7 +590,7 @@ PHPAPI zend_string *php_resolve_path(const char *filename, size_t filename_lengt
|
||||
}
|
||||
} /* end provided path */
|
||||
|
||||
/* check in calling scripts' current working directory as a fall back case
|
||||
/* check in calling scripts' current working directory as a fallback case
|
||||
*/
|
||||
if (zend_is_executing() &&
|
||||
(exec_filename = zend_get_executed_filename_ex()) != NULL) {
|
||||
@ -670,7 +670,7 @@ PHPAPI FILE *php_fopen_with_path(const char *filename, const char *mode, const c
|
||||
|
||||
/* check in provided path */
|
||||
/* append the calling scripts' current working directory
|
||||
* as a fall back case
|
||||
* as a fallback case
|
||||
*/
|
||||
if (zend_is_executing() &&
|
||||
(exec_filename = zend_get_executed_filename_ex()) != NULL) {
|
||||
@ -806,7 +806,7 @@ PHPAPI char *expand_filepath_with_mode(const char *filepath, char *real_path, co
|
||||
fdtest = VCWD_OPEN(filepath, O_RDONLY);
|
||||
if (fdtest != -1) {
|
||||
/* return a relative file path if for any reason
|
||||
* we cannot cannot getcwd() and the requested,
|
||||
* we cannot getcwd() and the requested,
|
||||
* relatively referenced file is accessible */
|
||||
copy_len = path_len > MAXPATHLEN - 1 ? MAXPATHLEN - 1 : path_len;
|
||||
if (real_path) {
|
||||
|
@ -407,7 +407,7 @@ static PHP_INI_MH(OnUpdateTimeout)
|
||||
/*
|
||||
* If we're restoring INI values, we shouldn't reset the timer.
|
||||
* Otherwise, the timer is active when PHP is idle, such as the
|
||||
* the CLI web server or CGI. Running a script will re-activate
|
||||
* CLI web server or CGI. Running a script will re-activate
|
||||
* the timeout, so it's not needed to do so at script end.
|
||||
*/
|
||||
zend_set_timeout(EG(timeout_seconds), 0);
|
||||
@ -1022,7 +1022,7 @@ PHPAPI ZEND_COLD void php_verror(const char *docref, const char *params, int typ
|
||||
origin = ZSTR_VAL(replace_origin);
|
||||
}
|
||||
|
||||
/* origin and buffer available, so lets come up with the error message */
|
||||
/* origin and buffer available, so let's come up with the error message */
|
||||
if (docref && docref[0] == '#') {
|
||||
docref_target = strchr(docref, '#');
|
||||
docref = NULL;
|
||||
|
@ -969,7 +969,7 @@ connected:
|
||||
/* }}} */
|
||||
|
||||
/* {{{ php_any_addr
|
||||
* Fills the any (wildcard) address into php_sockaddr_storage
|
||||
* Fills any (wildcard) address into php_sockaddr_storage
|
||||
*/
|
||||
PHPAPI void php_any_addr(int family, php_sockaddr_storage *addr, unsigned short port)
|
||||
{
|
||||
|
@ -156,7 +156,7 @@ PHPAPI void php_output_shutdown(void)
|
||||
/* }}} */
|
||||
|
||||
/* {{{ SUCCESS|FAILURE php_output_activate(void)
|
||||
* Reset output globals and setup the output handler stack */
|
||||
* Reset output globals and set up the output handler stack */
|
||||
PHPAPI int php_output_activate(void)
|
||||
{
|
||||
#ifdef ZTS
|
||||
@ -348,7 +348,7 @@ PHPAPI void php_output_discard_all(void)
|
||||
/* }}} */
|
||||
|
||||
/* {{{ int php_output_get_level(void)
|
||||
* Get output buffering level, ie. how many output handlers the stack contains */
|
||||
* Get output buffering level, i.e. how many output handlers the stack contains */
|
||||
PHPAPI int php_output_get_level(void)
|
||||
{
|
||||
return OG(active) ? zend_stack_count(&OG(handlers)) : 0;
|
||||
|
@ -49,7 +49,7 @@
|
||||
# define EWOULDBLOCK EAGAIN
|
||||
#endif
|
||||
|
||||
/* This is a work around for GCC bug 69602: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69602 */
|
||||
/* This is a workaround for GCC bug 69602: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69602 */
|
||||
#if EAGAIN != EWOULDBLOCK
|
||||
# define PHP_IS_TRANSIENT_ERROR(err) (err == EAGAIN || err == EWOULDBLOCK)
|
||||
#else
|
||||
|
@ -90,7 +90,7 @@ END_EXTERN_C()
|
||||
* The only exceptions to this rule are that stream implementations can use
|
||||
* the php_stream->abstract pointer to hold their context, and streams
|
||||
* opened via stream_open_wrappers can use the zval ptr in
|
||||
* php_stream->wrapperdata to hold meta data for php scripts to
|
||||
* php_stream->wrapperdata to hold metadata for php scripts to
|
||||
* retrieve using file_get_wrapper_data(). */
|
||||
|
||||
typedef struct _php_stream php_stream;
|
||||
@ -199,7 +199,7 @@ struct _php_stream {
|
||||
php_stream_filter_chain readfilters, writefilters;
|
||||
|
||||
php_stream_wrapper *wrapper; /* which wrapper was used to open the stream */
|
||||
void *wrapperthis; /* convenience pointer for a instance of a wrapper */
|
||||
void *wrapperthis; /* convenience pointer for an instance of a wrapper */
|
||||
zval wrapperdata; /* fgetwrapperdata retrieves this */
|
||||
|
||||
uint8_t is_persistent:1;
|
||||
@ -290,7 +290,7 @@ PHPAPI int php_stream_from_persistent_id(const char *persistent_id, php_stream *
|
||||
|
||||
#define PHP_STREAM_FREE_CALL_DTOR 1 /* call ops->close */
|
||||
#define PHP_STREAM_FREE_RELEASE_STREAM 2 /* pefree(stream) */
|
||||
#define PHP_STREAM_FREE_PRESERVE_HANDLE 4 /* tell ops->close to not close it's underlying handle */
|
||||
#define PHP_STREAM_FREE_PRESERVE_HANDLE 4 /* tell ops->close to not close its underlying handle */
|
||||
#define PHP_STREAM_FREE_RSRC_DTOR 8 /* called from the resource list dtor */
|
||||
#define PHP_STREAM_FREE_PERSISTENT 16 /* manually freeing a persistent connection */
|
||||
#define PHP_STREAM_FREE_IGNORE_ENCLOSING 32 /* don't close the enclosing stream instead */
|
||||
@ -441,7 +441,7 @@ PHPAPI int _php_stream_truncate_set_size(php_stream *stream, size_t newsize);
|
||||
#define php_stream_truncate_set_size(stream, size) _php_stream_truncate_set_size((stream), (size))
|
||||
END_EXTERN_C()
|
||||
|
||||
#define PHP_STREAM_OPTION_META_DATA_API 11 /* ptrparam is a zval* to which to add meta data information */
|
||||
#define PHP_STREAM_OPTION_META_DATA_API 11 /* ptrparam is a zval* to which to add metadata information */
|
||||
#define php_stream_populate_meta_data(stream, zv) (_php_stream_set_option((stream), PHP_STREAM_OPTION_META_DATA_API, 0, zv) == PHP_STREAM_OPTION_RETURN_OK ? 1 : 0)
|
||||
|
||||
/* Check if the stream is still "live"; for sockets/pipes this means the socket
|
||||
|
@ -207,7 +207,7 @@ PHPAPI void php_register_variable_ex(const char *var_name, zval *val, zval *trac
|
||||
zval_ptr_dtor_nogc(val);
|
||||
|
||||
/* do not output the error message to the screen,
|
||||
this helps us to to avoid "information disclosure" */
|
||||
this helps us to avoid "information disclosure" */
|
||||
if (!PG(display_errors)) {
|
||||
php_error_docref(NULL, E_WARNING, "Input variable nesting level exceeded " ZEND_LONG_FMT ". To increase the limit change max_input_nesting_level in php.ini.", PG(max_input_nesting_level));
|
||||
}
|
||||
|
@ -421,7 +421,7 @@ typedef struct buf_area buffy;
|
||||
* bep points to the end-of-buffer+1
|
||||
* While using this macro, note that the nextb pointer is NOT updated.
|
||||
*
|
||||
* NOTE: Evaluation of the c argument should not have any side-effects
|
||||
* NOTE: Evaluation of the c argument should not have any side effects
|
||||
*/
|
||||
#define INS_CHAR(c, sp, bep, cc) \
|
||||
{ \
|
||||
|
@ -539,7 +539,7 @@ static int php_stdiop_flush(php_stream *stream)
|
||||
|
||||
/*
|
||||
* stdio buffers data in user land. By calling fflush(3), this
|
||||
* data is send to the kernel using write(2). fsync'ing is
|
||||
* data is sent to the kernel using write(2). fsync'ing is
|
||||
* something completely different.
|
||||
*/
|
||||
if (data->file) {
|
||||
@ -1671,7 +1671,7 @@ not_relative_path:
|
||||
|
||||
/* check in provided path */
|
||||
/* append the calling scripts' current working directory
|
||||
* as a fall back case
|
||||
* as a fallback case
|
||||
*/
|
||||
if (zend_is_executing() &&
|
||||
(exec_filename = zend_get_executed_filename_ex()) != NULL) {
|
||||
|
@ -469,7 +469,7 @@ fprintf(stderr, "stream_free: %s:%p[%s] preserve_handle=%d release_cast=%d remov
|
||||
the cookie_closer unsets the fclose_stdiocast flags, so
|
||||
we can be sure that we only reach here when PHP code calls
|
||||
php_stream_free.
|
||||
Lets let the cookie code clean it all up.
|
||||
Let's let the cookie code clean it all up.
|
||||
*/
|
||||
stream->in_free = 0;
|
||||
return fclose(stream->stdiocast);
|
||||
@ -839,7 +839,7 @@ PHPAPI int _php_stream_stat(php_stream *stream, php_stream_statbuf *ssb)
|
||||
}
|
||||
|
||||
/* if the stream doesn't directly support stat-ing, return with failure.
|
||||
* We could try and emulate this by casting to a FD and fstat-ing it,
|
||||
* We could try and emulate this by casting to an FD and fstat-ing it,
|
||||
* but since the fd might not represent the actual underlying content
|
||||
* this would give bogus results. */
|
||||
if (stream->ops->stat == NULL) {
|
||||
@ -1503,7 +1503,7 @@ PHPAPI zend_string *_php_stream_copy_to_mem(php_stream *src, size_t maxlen, int
|
||||
return result;
|
||||
}
|
||||
|
||||
/* avoid many reallocs by allocating a good sized chunk to begin with, if
|
||||
/* avoid many reallocs by allocating a good-sized chunk to begin with, if
|
||||
* we can. Note that the stream may be filtered, in which case the stat
|
||||
* result may be inaccurate, as the filter may inflate or deflate the
|
||||
* number of bytes that we can read. In order to avoid an upsize followed
|
||||
|
@ -76,7 +76,7 @@ PHPAPI php_stream *_php_stream_xport_create(const char *name, size_t namelen, in
|
||||
if (persistent_id) {
|
||||
switch(php_stream_from_persistent_id(persistent_id, &stream)) {
|
||||
case PHP_STREAM_PERSISTENT_SUCCESS:
|
||||
/* use a 0 second timeout when checking if the socket
|
||||
/* use a 0-second timeout when checking if the socket
|
||||
* has already died */
|
||||
if (PHP_STREAM_OPTION_RETURN_OK == php_stream_set_option(stream, PHP_STREAM_OPTION_CHECK_LIVENESS, 0, NULL)) {
|
||||
return stream;
|
||||
|
Loading…
Reference in New Issue
Block a user