Commit Graph

152 Commits

Author SHA1 Message Date
Davey Shafik
b33e965111 Use non-deprecated %pure-parser 2016-08-11 18:29:55 +02:00
Dmitry Stogov
c19cb70dac Revert "Refactor zval cleanup into single function"
This reverts commit bac6fdb0c5.
2016-05-06 10:47:58 +03:00
Bob Weinand
bac6fdb0c5 Refactor zval cleanup into single function
Also use zval_ptr_dtor_nogc() everywhere in Zend in favor of zval_dtor()
2016-05-05 23:31:57 +02:00
Nikita Popov
5595dd5ffa Revert code to use DUP instead of COPY
In a1c405e0c5 next to the actual fix
I have also switched some (effective) ZVAL_DUPs to ZVAL_COPYs. I'm
reverting this part as those were probably there for a reason
(presumably issues with non-atomic refcounting on ZTS).
2016-04-29 22:02:31 +02:00
Nikita Popov
a1c405e0c5 Fix usages of zend_update_constant_ex
If an in-place update in an external zval is performed, it needs
to incref'd beforehand, not afterwards.
2016-04-29 14:06:39 +02:00
Dmitry Stogov
6499162ff0 - get rid of EG(scope). zend_get_executed_scope() should be used instead.
- ichanged zval_update_constant_ex(). Use IS_TYPE_IMMUTABLE flag on shared constants and AST, instead of "inline_change" parameter.
2016-04-28 04:13:34 +03:00
Xinchen Hui
97a9470d97 bump year which is missed in rev 49493a2 2016-01-02 17:56:11 +08:00
Xinchen Hui
4674f18a4b Improved previously fix a little 2015-11-20 06:54:57 -08:00
Xinchen Hui
519f9bc675 Fixed bug #70947 (INI parser segfault with INI_SCANNER_TYPED) 2015-11-20 06:37:38 -08:00
Dmitry Stogov
e549ebdb23 Mark parse error functions as cold 2015-08-26 18:29:42 +03:00
Tjerk Meesters
0bd7d7a369 Merge branch 'PHP-5.6'
* PHP-5.6:
  Updated NEWS for #70157
  Fixed #70157 parse_ini_string() segmentation fault with INI_SCANNER_TYPED
2015-08-15 16:49:30 +08:00
Tjerk Meesters
0d7159d26d Fixed #70157 parse_ini_string() segmentation fault with INI_SCANNER_TYPED 2015-08-15 15:10:34 +08:00
Kalle Sommer Nielsen
ce2cd89258 Replace references to PHP_WIN32 and TSRM_WIN32 with ZEND_WIN32 in Zend/, this also fixes 1 instance of where fflush(stderr) was misplaced (zend_extensions.c) 2015-07-04 18:55:22 +02:00
Dmitry Stogov
d71105b90a Use string primitive 2015-04-22 14:23:22 +03:00
Dmitry Stogov
d146d15003 Optimize zend_string_realloc() add more specialized versions zend_string_extend() and zend_string_truncate() 2015-03-20 02:02:42 +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
Stanislav Malyshev
b7a7b1a624 trailing whitespace removal 2015-01-10 15:07:38 -08: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
Anatol Belski
463c615dfe Merge branch 'PHP-5.6'
* PHP-5.6:
  updated NEWS
  updated NEWS
  Fixed bug #55541 errors spawn MessageBox, which blocks test automation
2014-12-03 16:49:13 +01:00
Anatol Belski
f3b4c05423 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  updated NEWS
  Fixed bug #55541 errors spawn MessageBox, which blocks test automation
2014-12-03 16:48:07 +01:00
Anatol Belski
65fce7f950 Fixed bug #55541 errors spawn MessageBox, which blocks test automation
With that, also fixed bug #68297 (Application Popup provides too few
information) as a better error message is provided to the event log.

In the second case, the condition for display_startup_error was removed. The
condition was added as a fix for bug #30760 which was preventing the
MessageBox to appear. When display_startup_error=on, the error will be seen
on the console. But when running under a webserver it'll probably get lost,
so we need to log it other way into the event log (would be done automatically
when message box was used, but that would eventually cause issues of blocked
execution).

Generally speaking - any MessageBox or other graphical element is a potential
issue and that was repeatedly reported. Graphical elements shouldn't be used
in the core. Even being a rare one it can cause a bad situation where the
server is blocked. Yet some places have to cleaned up.
2014-12-03 16:33:05 +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
cf581178e7 fix "inconsistent dll linkage" warning caused by bison
stdlib.h might not be always using _STDLIB_H, that will move bison
to redeclare the malloc/free prototypes.
2014-10-29 15:30:00 +01:00
Anatol Belski
d9d16d2e68 fix datatype mismatch warnings 2014-10-29 15:29:59 +01: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
06d0230a0f cleanup TSRMLS_FETCH 2014-09-26 09:58:19 +02:00
Anatol Belski
83fac1855f fix signature 2014-09-25 19:30:39 +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
Dmitry Stogov
88d7ca44f6 Refactored INI subsystem to use zend_string* instead of char* 2014-09-01 20:57:33 +04:00
Tjerk Meesters
5d5a7b1f7f Merge branch 'PHP-5.6'
* PHP-5.6:
  Updated UPGRADING for #38409
  Updated NEWS for #38409
  Added test case
  Making ini parser typed - Added ZEND_INI_SCANNER_TYPED mode for parse_ini_string() and parse_ini_file() - Added NULL_NULL token to separate it from BOOL_FALSE and BOOL_TRUE - Added zend_ini_copy_typed_value() function for zval initialisation - Updated RETURN_TOKEN() to observe scanner_mode

Conflicts:
	Zend/zend_ini_parser.y
	Zend/zend_ini_scanner.c
2014-09-01 22:43:17 +08:00
Tjerk Meesters
5270ee1aef Making ini parser typed
- Added ZEND_INI_SCANNER_TYPED mode for parse_ini_string() and parse_ini_file()
- Added NULL_NULL token to separate it from BOOL_FALSE and BOOL_TRUE
- Added zend_ini_copy_typed_value() function for zval initialisation
- Updated RETURN_TOKEN() to observe scanner_mode
2014-09-01 22:04:06 +08:00
Anatol Belski
c3e3c98ec6 master renames phase 1 2014-08-25 19:24:55 +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
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
df7ca608ce Optimized constant lookup 2014-04-25 00:56:15 +04:00
Dmitry Stogov
76cc99fe60 Refactored ZVAL flags usage to simplify various checks (e.g. Z_REFCOUNTED(), candidate for GC, etc) 2014-04-03 15:26:23 +04:00
Xinchen Hui
f1ed4f6bf9 Fixed parse_ini_file 2014-03-09 11:35:20 +08:00
Dmitry Stogov
2b9b9afa7a Use better data structures (incomplete) 2014-02-17 17:59:18 +04:00
Dmitry Stogov
0e425121b3 Use better data structures (incomplete) 2014-02-17 11:50:32 +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
Dejan Marjanovic
05016b7e96 Added XOR support for expressions in INI parser 2013-03-27 21:28:53 +01:00
Xinchen Hui
a666285bc2 Happy New Year 2013-01-01 16:37:09 +08:00
Felipe Pena
8775a37559 - Year++ 2012-01-01 13:15:04 +00:00
Felipe Pena
0203cc3d44 - Year++ 2011-01-01 02:17:06 +00:00
Felipe Pena
b355aa00b0 - Fixed bug #52138 (Constants are parsed into the ini file for section names) 2010-06-24 22:32:42 +00:00
Sebastian Bergmann
3defe76254 sed -i "s#1998-2009#1998-2010#g" **/*.re **/*.y **/*.l 2010-01-05 20:40:23 +00:00
Sebastian Bergmann
06de2c4de2 MFH: Bump copyright year, 1 of 3. 2008-12-31 11:13:47 +00:00
Marcus Boerger
af316021e8 - Rewrite scanner to be based on re2c instead of flex
The full patch is available as:
  http://php.net/~helly/php-re2c-5.3-20080316.diff.txt
  This is against php-re2c repository version 98
  An older patch against version 97 is available under:
  http://php.net/~helly/php-re2c-97-20080316.diff.txt
2008-03-16 21:06:55 +00:00
Jani Taskinen
8a70a554d6 MFH: - Fixed bugs #43915, #43923 and #44019, a tiny performance issue fixed too 2008-02-04 20:45:20 +00:00
Sebastian Bergmann
d1dded8751 MFH: Bump copyright year, 2 of 2. 2007-12-31 07:17:19 +00:00
Jani Taskinen
108dddcac0 MFH:- Removed the %destructor declaration (requires bison 1.875 or above) 2007-10-03 13:03:18 +00:00
Jani Taskinen
09b6f37f20 MFH:
- Added ".htaccess" style user-defined php.ini files support for
  CGI/FastCGI.
- Added support for special [PATH=/opt/httpd/www.example.com/] sections
  in php.ini. All directives set in these sections will not be able to be
  overridden in user-defined ini-files or during runtime in the specified
  path.

- Improved php.ini handling:
  . Added better error reporting for syntax errors in php.ini files
  . Allowed "ini-variables" to be used almost everywhere ini php.ini files
  . Allowed using alphanumeric/variable indexes in "array" ini options
  . Fixed get_cfg_var() to be able to return "array" ini options

- Fixed bug #27372 (parse error loading browscap.ini at apache startup)
- Fixed bug #42069 (parse_ini_file() allows using some non-alpha numeric
  characters)
2007-09-28 02:05:10 +00:00
Jani Taskinen
c9f6d5941e MFH: - Fixed buf #42071 (ini scanner allows using NULL as option name).
MFH: Use Z_* macros to access the zvals.
2007-07-23 16:17:10 +00:00
Dmitry Stogov
7d14dad02e MFH: Fixed mess with CGI/CLI -d command line option (now it works with cgi; constants are working exactly like in php.ini; with FastCGI -d affects all requests). 2006-09-19 20:33:12 +00:00
Dmitry Stogov
6e762e648c Fixed bug #37002 (Have to quote literals in INI when concatenating with vars) 2006-04-12 09:51:54 +00:00
Andi Gutmans
61e93ccfe8 - Update copyright notices to 2006 2006-01-04 23:53:05 +00:00
foobar
916815b779 Bump up the year 2005-08-03 13:30:58 +00:00
Marcus Boerger
406e85a8d8 - Fix memleak 2005-01-19 00:55:56 +00:00
Andrei Zmievski
44468214b5 Revert inadvertent commit. 2004-11-09 20:59:02 +00:00
Andrei Zmievski
c2f8c1a79b .dylib extension are Mach-O shared libraries that meant for linking
against. Loadable modules (aka bundles) can have any extension, so we
should probably stick with .so

http://fink.sourceforge.net/doc/porting/shared.php?phpLang=en#lib-and-mod
2004-11-09 20:58:24 +00:00
Zeev Suraski
85a36e2bc3 Fix reverse dependency 2004-09-05 22:40:35 +00:00
Sara Golemon
5a81efa31f Fix compile 2004-08-20 23:53:59 +00:00
Andrei Zmievski
f60dc4699f Forgot to turn off debugging. 2004-08-18 18:10:31 +00:00
Andrei Zmievski
fe5c131a0d Re-add my patch for .ini variable access. 2004-08-18 16:58:20 +00:00
Stanislav Malyshev
d84702836a export INI parser 2004-07-19 16:32:24 +00:00
Andrei Zmievski
427561446f Revert the .ini vars patch. Will have to try again next Christmas
apparently.
2004-05-17 20:09:37 +00:00
Andrei Zmievski
26eaab7641 Fix the apparent bug (; at the end of parse rule block). 2004-05-17 17:12:07 +00:00
Andrei Zmievski
e97f733515 Adding ability to refer to existing .ini variables from within .ini
files. Example:

open_basedir = ${open_basedir} ":/new/dir"
2004-05-14 20:58:15 +00:00
Wez Furlong
d4deb460bd Don't treat strings containing : as potential constant names in
the .ini parser.
This fixes Bug #26893
2004-01-13 17:00:10 +00:00
Andi Gutmans
6b87194bd9 - - A belated happy holidays (by two years) 2004-01-08 08:23:23 +00:00
Ilia Alshanetsky
a2e95e4b91 Fixed formatting issue. 2003-10-17 02:47:44 +00:00
Zeev Suraski
d16d25b136 Fix the fix :)
Not thoroughly tested, but appears to work fine
2003-10-07 10:05:10 +00:00
Marcus Boerger
2c2af7c7ef Bugfix #25770 Segfault with PHP and bison 1.875 2003-10-07 09:33:20 +00:00
James Cox
f68c7ff249 updating license information in the headers. 2003-06-10 20:04:29 +00:00
Zeev Suraski
566e41226f Improve Win32 build performance 2003-02-17 13:20:41 +00:00
foobar
333406bdc2 - Added some missing CVS $Id$ tags, headers and footers. 2003-02-01 01:49:15 +00:00
Harald Radi
697398e18e ini patch to allow 'entry[] = value' entries 2003-01-19 12:01:38 +00:00
Ilia Alshanetsky
dff55752aa MFZE2 2003-01-14 14:21:45 +00:00
Ilia Alshanetsky
ad3b2ccec9 Reverting previous patch. 2003-01-14 02:41:47 +00:00
Ilia Alshanetsky
8e7df3fbf1 MFZE2 2003-01-13 16:34:19 +00:00
Ilia Alshanetsky
fac8eaff1a MFZE1 2002-10-14 23:41:32 +00:00
Sebastian Bergmann
62dc854bb0 Happy New Year. 2002-01-06 15:21:36 +00:00
Sebastian Bergmann
d863d52a5d Update headers. 2001-12-11 15:16:21 +00:00
Zeev Suraski
609d58a4d6 Merge from branch - move to standard C scanners in thread safe mode 2001-08-06 13:48:51 +00:00
Zeev Suraski
0b7fdbb690 More TSRMLS_FETCH work 2001-07-31 06:07:25 +00:00
Zeev Suraski
4187439cff More TSRMLS_FETCH work 2001-07-30 07:43:02 +00:00
Zeev Suraski
8ce8324e59 More TSRMLS_FETCH annihilation 2001-07-30 04:54:16 +00:00
Zeev Suraski
b4f3b9d3ce Redesigned thread safety mechanism - nua nua 2001-07-28 10:51:54 +00:00
Andi Gutmans
d2c9e8074c - Update copyright year 2001-02-26 05:43:27 +00:00
Zeev Suraski
3dd6c2d96f Remove unnecessary variables 2000-11-02 11:33:34 +00:00
Zeev Suraski
9596255da8 Final touches on the INI parser 2000-10-30 23:19:48 +00:00
Zeev Suraski
3c06816532 Fix leaks 2000-10-29 23:10:04 +00:00
Zeev Suraski
ab3beffad7 The new INI parser is showing some signs of life 2000-10-29 22:40:01 +00:00
Zeev Suraski
366c16e561 Fix build 2000-10-29 18:30:00 +00:00
Zeev Suraski
6b4c369164 Generalization work 2000-10-29 18:23:51 +00:00