Commit Graph

338 Commits

Author SHA1 Message Date
Michael Wallner
225af964c0 Fixed bug #65593 (Segfault when calling ob_start from output buffering callback) 2015-02-18 13:58:31 +01:00
Anatol Belski
af3ca74501 made ZEND_TSRMLS_CACHE_* macros look like function calls
which also comply with the current semantics for such macros
2015-02-16 17:19:32 +01:00
Dmitry Stogov
1eb4352143 Use new ZEND_HASH_FOREACH_... API. 2015-02-10 15:43:12 +03:00
Xinchen Hui
fc33f52d8c bump year 2015-01-15 23:27:30 +08:00
Xinchen Hui
0579e8278d bump year 2015-01-15 23:26:37 +08:00
Xinchen Hui
73c1be2653 Bump year 2015-01-15 23:26:03 +08:00
Stanislav Malyshev
b7a7b1a624 trailing whitespace removal 2015-01-10 15:07:38 -08:00
Kalle Sommer Nielsen
ff7e8e94d7 Implemented FR #55428 (E_RECOVERABLE_ERROR when output buffering in output buffering handler)
## Can probably go in lower branches, but I'd like to keep it in
## master for now
2014-12-27 20:56:39 +01:00
Anatol Belski
bdeb220f48 first shot remove TSRMLS_* things 2014-12-13 23:06:14 +01:00
Anatol Belski
88bb9fedc4 Merge remote-tracking branch 'origin/master' into native-tls
* origin/master: (111 commits)
  Fix zend_fcall_info_arg*() to use ZVAL_COPY
  Fixed #65213 - cannot cast SplFileInfo to boolean
  add initial install
  switch to C travis project instead of PHP
  use the generic TRAVIS environment var to check for travis (see http://docs.travis-ci.com/user/ci-environment/)
  fix TS build
  add config option to target codegen architectures
  updated NEWS
  updated NEWS
  Fixed bug #55541 errors spawn MessageBox, which blocks test automation
  Get rid of duplicate handlers (ZEND_ADD_SPEC_TMP_TMP and ZEND_ADD_SPEC_VAR_VAR are absolutely the same).
  Use zend_string* for op_array->arg_info[]->name and op_array->arg_info[]->class_name. For internal functions we still use char*.
  Fixed __debugInfo() support
  Update UPGRADING for the new variadic functions, and re-sort.
  Improved POST INC/DEC
  make sure that we don't truncate the stack trace and cause false test failures when the test is executed in a directory with long path
  Missed closed folder mark
  Revert "Unecessary assignment"
  Fixed improper memory release
  Unecessary assignment
  ...
2014-12-05 03:50:02 +01:00
Michael Wallner
f0a17c293b Fix zend_fcall_info_arg*() to use ZVAL_COPY
As zend_fcall_info_args_clear() calls zval_ptr_dtor() we also have
to increase the refcount of refcounted zvals added as params,
like it is already done in zend_fcall_info_args_ex().
2014-12-04 13:02:30 +01:00
Anatol Belski
c6bad96f30 Merge remote-tracking branch 'origin/master' into native-tls
* origin/master: (398 commits)
  NEWS
  add test for bug #68381
  Fixed bug #68381 Set FPM log level earlier during init
  proper dllexport
  move to size_t where zend_string is used internally
  fix some datatype mismatches
  return after the warning, to fix uninitialized salt usage
  fix datatype mismatches
  add missing type specifier
  fix datatype mismatches
  fix unsigned check
  "extern" shouldn't be used for definitions
  joined identical conditional blocks
  simplify fpm tests
  SEND_VAR_NO_REF optimization
  Add test for bug #68442
  Add various tests for FPM - covering recent bugs (68420, 68421, 68423, 68428) - for UDS - for ping and status URI - for multi pool and multi mode
  Include small MIT FastCGI client library from https://github.com/adoy/PHP-FastCGI-Client
  Get rid of zend_free_op structure (use zval* instead). Get rid of useless TSRMLS arguments.
  Add new FPM test for IPv4/IPv6
  ...

Conflicts:
	win32/build/config.w32
2014-11-18 21:18:52 +01:00
Anatol Belski
e6874a9b41 Merge branch 'PHP-5.6'
* PHP-5.6:
  add DLL export to the output globals
2014-10-30 10:28:05 +01:00
Anatol Belski
73e2dd3381 add DLL export to the output globals 2014-10-30 10:27:20 +01:00
Xinchen Hui
429b0bb38a Merge branch 'PHP-5.6' 2014-10-30 11:54:00 +08:00
Xinchen Hui
9e1da42af1 Use macro 2014-10-30 11:52:29 +08:00
Xinchen Hui
64a44eab77 Merge branch 'PHP-5.6' 2014-10-30 11:42:40 +08:00
Xinchen Hui
7b4993dd16 Fixed build.... (shouldn't it be zend_output_globals?) 2014-10-30 11:42:02 +08:00
Anatol Belski
d77ce31763 Merge branch 'PHP-5.6'
* PHP-5.6:
  fix output globals importing
  export output globals
  use portable strndup implementation
  unix sockets aren't available on windows
  dll export APIs needed by phpdbg
  fix sapi/phpdbg/config.w32
  Don't treat warnings as failures in the junit output
2014-10-29 20:04:56 +01:00
Anatol Belski
5d76185792 export output globals
needed by phpdbg
2014-10-29 20:02:41 +01:00
Anatol Belski
11b119d526 fix datatype mismatches 2014-10-27 16:38:47 +01:00
Anatol Belski
8aeffdd74c moved most of the core to use static tsrm ls cache pointer
plus apache2handler, cli and cgi
2014-10-15 16:33:40 +02:00
Anatol Belski
c00424e427 bring back all the TSRMLS_FETCH() stuff
for better comparability with the mainstream
2014-10-15 09:37:55 +02:00
Anatol Belski
f790036711 some cleanups for TSRMLS_FETCH and direct tsrm_ls usage in main 2014-09-26 11:06:58 +02:00
Anatol Belski
d11734b4b0 reworked the patch, less new stuff but worky
TLS is already used in TSRM, the way exporting the tsrm cache through
a thread local variable is not portable. Additionally, the current
patch suffers from bugs which are hard to find, but prevent it to
be worky with apache. What is done here is mainly uses the idea
from the RFC patch, but

- __thread variable is removed
- offset math and declarations are removed
- extra macros and definitions are removed

What is done merely is

- use an inline function to access the tsrm cache. The function uses
  the portable tsrm_tls_get macro which is cheap
- all the TSRM_* macros are set to placebo. Thus this opens the way
  remove them later

Except that, the logic is old. TSRMLS_FETCH will have to be done once
per thread, then tsrm_get_ls_cache() can be used. Things seeming to be
worky are cli, cli server and apache. I also tried to enable bz2
shared and it has worked out of the box. The change is yet minimal
diffing to the current master bus is a worky start, IMHO. Though will
have to recheck the other previously done SAPIs - embed and cgi.

The offsets can be added to the tsrm_resource_type struct, then
it'll not be needed to declare them in the userspace. Even the
"done" member type can be changed to int16 or smaller, then adding
the offset as int16 will not change the struct size. As well on the
todo might be removing the hashed storage, thread_id != thread_id and
linked list logic in favour of the explicit TLS operations.
2014-09-25 18:48:27 +02:00
krakjoe
b3aebda9ea native tls initial patch 2014-09-20 20:22:14 +01:00
Johannes Schlüter
d0cb715373 s/PHP 5/PHP 7/ 2014-09-19 18:33:14 +02:00
Anatol Belski
3234480827 first show to make 's' work with size_t 2014-08-27 20:49:31 +02:00
Anatol Belski
202e8db1dc fixed several long vs zend_long casts 2014-08-26 11:26:53 +02:00
Anatol Belski
c3e3c98ec6 master renames phase 1 2014-08-25 19:24:55 +02:00
Anatol Belski
8e8a30654e fix zpp 2014-08-20 17:56:07 +02:00
Anatol Belski
8ee2a4a9b5 first shot on merging the core fro the int64 branch 2014-08-16 11:16:11 +02:00
Dmitry Stogov
9fea4348fd cleanup 2014-08-13 16:55:21 +04:00
Dmitry Stogov
4a3e501fb3 cleanup 2014-08-08 13:47:34 +04:00
Dmitry Stogov
16d3d5dc53 Fixed wrong comparisons 2014-05-15 21:06:39 +04:00
Nikita Popov
e0247de147 zend_stack_top() now returns pointer directly 2014-05-01 09:08:30 +02:00
Nikita Popov
5a03efe279 Don't allocate zend_stack elements individually
Instead allocate a vector of elements. Size must now be specified
on initialization rather than on push.
2014-05-01 09:08:29 +02:00
Dmitry Stogov
17d027ed47 Split IS_BOOL into IS_FALSE and IS_TRUE 2014-04-30 18:32:42 +04:00
Dmitry Stogov
f9927a6c97 Merge mainstream 'master' branch into refactoring
During merge I had to revert:
	Nikita's patch for php_splice() (it probably needs to be applyed again)
	Bob Weinand's patches related to constant expression handling (we need to review them carefully)
	I also reverted all our attempts to support sapi/phpdbg (we didn't test it anyway)

Conflicts:
	Zend/zend.h
	Zend/zend_API.c
	Zend/zend_ast.c
	Zend/zend_compile.c
	Zend/zend_compile.h
	Zend/zend_constants.c
	Zend/zend_exceptions.c
	Zend/zend_execute.c
	Zend/zend_execute.h
	Zend/zend_execute_API.c
	Zend/zend_hash.c
	Zend/zend_highlight.c
	Zend/zend_language_parser.y
	Zend/zend_language_scanner.c
	Zend/zend_language_scanner_defs.h
	Zend/zend_variables.c
	Zend/zend_vm_def.h
	Zend/zend_vm_execute.h
	ext/date/php_date.c
	ext/dom/documenttype.c
	ext/hash/hash.c
	ext/iconv/iconv.c
	ext/mbstring/tests/zend_multibyte-10.phpt
	ext/mbstring/tests/zend_multibyte-11.phpt
	ext/mbstring/tests/zend_multibyte-12.phpt
	ext/mysql/php_mysql.c
	ext/mysqli/mysqli.c
	ext/mysqlnd/mysqlnd_reverse_api.c
	ext/mysqlnd/php_mysqlnd.c
	ext/opcache/ZendAccelerator.c
	ext/opcache/zend_accelerator_util_funcs.c
	ext/opcache/zend_persist.c
	ext/opcache/zend_persist_calc.c
	ext/pcre/php_pcre.c
	ext/pdo/pdo_dbh.c
	ext/pdo/pdo_stmt.c
	ext/pdo_pgsql/pgsql_driver.c
	ext/pgsql/pgsql.c
	ext/reflection/php_reflection.c
	ext/session/session.c
	ext/spl/spl_array.c
	ext/spl/spl_observer.c
	ext/standard/array.c
	ext/standard/basic_functions.c
	ext/standard/html.c
	ext/standard/mail.c
	ext/standard/php_array.h
	ext/standard/proc_open.c
	ext/standard/streamsfuncs.c
	ext/standard/user_filters.c
	ext/standard/var_unserializer.c
	ext/standard/var_unserializer.re
	main/php_variables.c
	sapi/phpdbg/phpdbg.c
	sapi/phpdbg/phpdbg_bp.c
	sapi/phpdbg/phpdbg_frame.c
	sapi/phpdbg/phpdbg_help.c
	sapi/phpdbg/phpdbg_list.c
	sapi/phpdbg/phpdbg_print.c
	sapi/phpdbg/phpdbg_prompt.c
2014-04-26 00:32:51 +04:00
Dmitry Stogov
72c287bd23 Combine HashTable.flags and HashTable.nApplyCount into single 32-bit word 2014-04-21 18:25:34 +04:00
Dmitry Stogov
050d7e38ad Cleanup (1-st round) 2014-04-15 15:40:40 +04:00
Michael Wallner
bbd25ca01f Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fix Bug #66736 	fpassthru broken
2014-04-03 10:40:20 +02:00
Michael Wallner
d08b4dbf23 Fix Bug #66736 fpassthru broken 2014-04-03 10:40:06 +02:00
Dmitry Stogov
76cd829efd Fixed double free 2014-03-19 17:00:58 +04:00
Xinchen Hui
be6e417fdc Fixed memory leak (double array_init) 2014-03-07 17:48:54 +08:00
Xinchen Hui
c2933c234c Fixed invalid pointer usage (tests/output/ob_start_callbacks.phpt) 2014-03-07 16:49:01 +08:00
Xinchen Hui
7c623c0e89 Fixed asseration failed in ob_get_status 2014-03-07 15:12:52 +08:00
Dmitry Stogov
9ae9460bd0 Fixed refcounting 2014-03-06 13:32:26 +04:00
Dmitry Stogov
639e4e1afa Changes zend_is_callable() to use zend_string* instead of char* 2014-02-25 16:03:34 +04:00
Dmitry Stogov
f4cfaf36e2 Use better data structures (incomplete) 2014-02-10 10:04:30 +04:00
Xinchen Hui
c081ce628f Bump year 2014-01-03 11:08:10 +08:00
Xinchen Hui
47c9027772 Bump year 2014-01-03 11:06:16 +08:00
Xinchen Hui
c0d060f5c0 Bump year 2014-01-03 11:04:26 +08:00
Xinchen Hui
a666285bc2 Happy New Year 2013-01-01 16:37:09 +08:00
Xinchen Hui
0a7395e009 Happy New Year 2013-01-01 16:28:54 +08:00
Xinchen Hui
093d119597 Merge branch 'PHP-5.4' into PHP-5.5 2012-11-30 14:30:37 +08:00
Michael Wallner
575790e842 fix bug #61272 ob_start callback get passed empty string 2012-11-28 10:19:44 +01:00
Dmitry Stogov
04789300a4 Merge branch 'PHP-5.4'
* PHP-5.4:
  Fixed unintendent clearance of PHP_OUTPUT_ACTIVATED flag
2012-09-10 14:57:45 +04:00
Dmitry Stogov
62d86209cf Fixed unintendent clearance of PHP_OUTPUT_ACTIVATED flag 2012-09-10 14:54:18 +04:00
Michael Wallner
2d11e55b94 cleanup merge 2012-05-15 09:44:01 +02:00
Michael Wallner
0ad53bfd7d fix bug #60761 zlib.output_compression fails on refresh 2012-05-15 09:33:47 +02:00
Michael Wallner
7a58d9f679 fix compat function not passing along input buffer with php_output_context_pass() if the output_handler_func does not set out_str 2012-02-14 19:31:54 +00:00
Michael Wallner
685a3c86c2 fix compat function not passing along input buffer with php_output_context_pass() if the output_handler_func does not set out_str 2012-02-14 19:31:54 +00:00
Michael Wallner
c64a69c8b8 MFH: r322963
fix headers print to stdout/stderr if no output written; 
fix crashes and invalid usage of output control in cli server while passing by
2012-01-31 09:58:26 +00:00
Michael Wallner
29c8658dc8 fix headers print to stdout/stderr if no output written; need to make some more testsbefore committing to PHP_5_4; fix crashes and invalid usage of output control in cli server while passing by 2012-01-31 08:51:24 +00:00
Michael Wallner
3c03829429 use stderr before, stdout after php_output_startup() and sapi_module.ub_write() after php_output_activate()
- fixes Bug #60920  CLI: php -v on STDERR
- fixes Bug #60923  Failing tests for sapi/cli
2012-01-30 12:17:51 +00:00
Michael Wallner
9de5b6dc7c use stderr before, stdout after php_output_startup() and sapi_module.ub_write() after php_output_activate()
- fixes Bug #60920  CLI: php -v on STDERR
- fixes Bug #60923  Failing tests for sapi/cli
2012-01-30 12:17:51 +00:00
Michael Wallner
bfccc4ed58 fix crash with display_startup_errors=1 2012-01-25 17:22:46 +00:00
Michael Wallner
ef388d1f28 fix crash with display_startup_errors=1 2012-01-25 17:22:46 +00:00
Michael Wallner
6b31413b13 Fix bug #60768 Output buffer not discarded
in php_output_handler_op():
  * if appending to buffer succeeds, just return HANDLER_NO_DATA
    and do nothing else
  * if a zero sized string or true is returned from the handler
    function, reset the context as well as the handler's buffer
2012-01-16 17:51:35 +00:00
Michael Wallner
f32760bd40 Fix bug #60768 Output buffer not discarded
in php_output_handler_op():
  * if appending to buffer succeeds, just return HANDLER_NO_DATA
    and do nothing else
  * if a zero sized string or true is returned from the handler
    function, reset the context as well as the handler's buffer
2012-01-16 17:51:35 +00:00
Felipe Pena
8775a37559 - Year++ 2012-01-01 13:15:04 +00:00
Felipe Pena
4e19825281 - Year++ 2012-01-01 13:15:04 +00:00
Michael Wallner
db51b6b84b follow naming convention 2011-12-30 09:20:07 +00:00
Michael Wallner
ecfb3af78f follow naming convention 2011-12-30 09:20:07 +00:00
Dmitry Stogov
8de2aa24b6 Added an API call to return active output handler 2011-12-30 08:50:49 +00:00
Dmitry Stogov
f7942c9e63 Added an API call to return active output handler 2011-12-30 08:50:49 +00:00
Stanislav Malyshev
63e5f97da4 fix bug #60322 (ob_get_clean() now raises an E_NOTICE if no buffers exist) 2011-12-26 05:01:46 +00:00
Stanislav Malyshev
87b9f7bb3a fix bug #60322 (ob_get_clean() now raises an E_NOTICE if no buffers exist) 2011-12-26 05:01:46 +00:00
Pierrick Charron
52ca90428d Fixed bug #60321 (ob_get_status(true) no longer returns an array when buffer is empty). 2011-11-18 00:16:58 +00:00
Pierrick Charron
8e2dcfd8b6 Fixed bug #60321 (ob_get_status(true) no longer returns an array when buffer is empty). 2011-11-18 00:16:58 +00:00
Xinchen Hui
efd3e69511 Fixed bug #60282 (Segfault when using ob_gzhandler() with open buffers) 2011-11-13 04:11:57 +00:00
Xinchen Hui
89feaefce1 Fixed bug #60282 (Segfault when using ob_gzhandler() with open buffers) 2011-11-13 04:11:57 +00:00
Dmitry Stogov
4a25a7740d Fixed ZE specific compile warnings (Bug #55629) 2011-09-13 13:29:35 +00:00
Dmitry Stogov
e43ff1359e Fixed ZE specific compile warnings (Bug #55629) 2011-09-13 13:29:35 +00:00
Michael Wallner
70c284009d fix coverity issue 1054: missing break/return 2011-08-10 11:01:09 +00:00
Michael Wallner
daccb503b2 fix coverity issue 1054: missing break/return 2011-08-10 11:01:09 +00:00
Felipe Pena
0203cc3d44 - Year++ 2011-01-01 02:17:06 +00:00
Jani Taskinen
72ae65bc9d - CS and "de-facto" style of returning NULL for failing parse-params, sync partially with PHP_5_3 too (reordering part :) 2010-12-03 15:34:24 +00:00
Michael Wallner
823d7cb55f explicitness FTW; it should have been like that before, so it wouldn't have happened 2010-11-03 08:35:16 +00:00
Gustavo André dos Santos Lopes
743f50927c - Fixed bug #53153 (memory leak with phpinfo() + output buffering + zlib compression). 2010-11-02 03:49:49 +00:00
Dmitry Stogov
caffc1c972 Preallocate zend_hash instead of allocation/deallocation it on each request 2010-08-27 06:09:18 +00:00
Antony Dovgal
9d65730961 fix minor memleak 2010-06-09 11:04:03 +00:00
Michael Wallner
99da695ec9 fix cxx build 2010-06-02 12:49:12 +00:00
Michael Wallner
43154f2a7c * raise warning if zend_fcall_info_init() cannot resolve the callback
* fix pointer mismatch
2010-06-01 13:16:33 +00:00
Michael Wallner
11d24c1593 * implement new output API, fixing some bugs and implementing some feature
requests--let's see what I can dig out of the bugtracker for NEWS--
  and while crossing the road:
   * implemented new zlib API
   * fixed up ext/tidy (what was "s&" in zend_parse_parameters() supposed to do?)

Thanks to Jani and Felipe for pioneering.
2010-05-31 10:29:43 +00:00
Jani Taskinen
af49e58f51 - Reverted r296062 and r296065 2010-03-12 10:28:59 +00:00
Jani Taskinen
06f072cb5e MFH: Improved / fixed output buffering (Michael Wallner) 2010-03-11 10:24:29 +00:00
Pierre Joye
5eb4db5e8f - Ensure that stderr output are not buffered, portability for tests 2010-01-25 14:47:19 +00:00
Sebastian Bergmann
9ba1e81665 sed -i "s#1997-2009#1997-2010#g" **/*.c **/*.h **/*.php 2010-01-03 09:23:27 +00:00