1
0
mirror of https://github.com/php/php-src.git synced 2026-04-25 08:58:28 +02:00
Commit Graph

123340 Commits

Author SHA1 Message Date
Dmitry Stogov 8ed8cf86a9 Use zend_string* instead of char* 2021-03-22 14:56:16 +03:00
Dmitry Stogov 9162116a85 Use better function 2021-03-22 14:55:54 +03:00
Nikita Popov 48986653fe Remove unused READDIR_R lock 2021-03-22 10:48:59 +01:00
Max Semenik 6c9a05667b run-tests: use the EXTENSIONS section for skipping
Currently, most skip checks are just for making sure an extension is
available. Even with recent addition of skip caching, this makes tests
needlessly slow:
* Checks for the same extension in its tests can have small differences
  impacting cacheability.
* Even identical skip checks in two tests can still be executed twice if
  they're run by different workers.

To remedy this, I'm repurposing the existing --EXTENSIONS-- section of
.phpt files to specify wjich extensions are required for current test to
run. Current behavior:
1) If the extension is already visible to PHP, all is good
2) If it isn't, assume it's present as a shared module and attempt to add
   it via a command line parameter
3) If that works, all is good
4) If it doesn't, PHP fails with a cryptic error message trying to
   execute the test itself

After this commit:
1) and 2) are kept unchanged
3) Check if shared extension file from 2) is actually present
4) Skip the test if it isn't

Other benefits include clear skip reasons (vs. sometimes none in many
current skip checks) and moving test information from code to metadata,
opening more opportunities for search and analysis.

Since --EXTENSIONS-- is barely ever used, this change poses no risk of
hidden failures.

As a demonstration of the new approach, this commit migrates one
extension to it. If merged, I will migrate other extensions in
subsequent PRs.

Closes GH-6787.
2021-03-22 09:53:38 +01:00
Jakub Zelenka a3e1082e0a Merge branch 'PHP-8.0' 2021-03-21 21:21:38 +00:00
Jakub Zelenka 4dca1140cf Merge branch 'PHP-7.4' into PHP-8.0 2021-03-21 21:21:05 +00:00
Jakub Zelenka bc7ea73da5 Use ServerClientTestCase in a test for default_socket_timeout=-1 2021-03-21 21:19:40 +00:00
Jakub Zelenka 118cd3efd3 Merge branch 'PHP-8.0' 2021-03-21 19:01:50 +00:00
Jakub Zelenka 713b82131b Merge branch 'PHP-7.4' into PHP-8.0 2021-03-21 19:00:38 +00:00
Jakub Zelenka 538f95b1b7 Fix NEWS entry position for the latest FPM fix 2021-03-21 18:58:57 +00:00
Jakub Zelenka c483b59124 Fix bug #80024: Duplication of info about inherited socket after pool removing 2021-03-21 18:52:07 +00:00
Jakub Zelenka 37969dcab0 Update NEWS for FPM process renaming on macOS 2021-03-21 18:42:55 +00:00
David CARLIER d54fa6f778 fpm master/child process rename, enable on mac os.
Note the change appears mainly in command like ps.
2021-03-21 18:36:12 +00:00
Jakub Zelenka 661731d4f1 Upadate NEWS and UPRADING with info about FPM openmetrics format addition 2021-03-21 18:32:19 +00:00
Jakub Zelenka c6c571d92b Fix indent in FPM openmetrics status 2021-03-21 18:24:46 +00:00
Cees-Jan Kiewiet d36ac9640a Add support for openmetrics formatting to FPM status 2021-03-21 18:08:53 +00:00
Máté Kocsis cd40fc3cb1 Convert resources to objects in ext/ldap
Closes GH-6770
2021-03-21 10:43:25 +01:00
Dmitry Stogov 6690547a58 Use zend_hash_lookup() 2021-03-19 23:34:38 +03:00
Dmitry Stogov 340013ad01 Add zend_hash_lookup() and zend_hash_index_lookup() functions.
Thet search for an element with given key/index and add an empty one (NULL), if no found.
2021-03-19 22:36:24 +03:00
Christoph M. Becker 64e589cab6 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix #80889: Cannot set save handler when save_handler is invalid
2021-03-19 17:05:32 +01:00
Christoph M. Becker 2a1ed81ffc Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #80889: Cannot set save handler when save_handler is invalid
2021-03-19 17:03:54 +01:00
Christoph M. Becker 06bfada99b Fix #80889: Cannot set save handler when save_handler is invalid
There is no need to require a (valid) save_handler to be set, when a
user handler is supposed to be set.  We just have to make sure, that
no user handler is already set in this case.

Closes GH-6788.
2021-03-19 16:59:54 +01:00
Nikita Popov 5fd2a5b13b Fix handling of unknown class in trait precedence list
Fixes oss-fuzz #31983.
2021-03-19 16:04:47 +01:00
Dmitry Stogov 89c61186ff micro-optimization 2021-03-19 16:57:42 +03:00
Nikita Popov 7279a66139 Install de_DE locale on azure 2021-03-19 11:34:42 +01:00
Nikita Popov 2d0e2733c8 Support prototypes in call graph
Even if we don't know the exact method being called, include it
in the call graph with the is_prototype flag. In particular, we
can still make use of return types from prototype methods, as
PHP 8 makes LSP violations a hard error.

Most other places are adjusted to skip calls with !is_prototype.
Maybe some of them would be fine, but ignoring them is conservative.
2021-03-19 10:49:15 +01:00
Dmitry Stogov 6689bedd17 XFAIL on WIN64 because of problem in libffi 2021-03-19 12:19:24 +03:00
Nikita Popov e67156e967 Add missing rc1/rcn to return type initialization 2021-03-19 10:04:56 +01:00
Nikita Popov dcac654fd5 Allow inferring narrowed return type
Even if an explicit return type is given, we might still infer
a more narrow one based on return statements. We shouldn't
pessimize this just because a type has been declared.
2021-03-18 17:11:56 +01:00
Nikita Popov 2f73cbb1b1 Update one more use of NO_AUTOLOAD 2021-03-18 16:25:22 +01:00
Máté Kocsis d91051da2c Update mysqli stub hash 2021-03-18 16:09:25 +01:00
Christoph M. Becker 02fdf9fd3b Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix #80783: PDO ODBC truncates BLOB records at every 256th byte
2021-03-18 15:31:23 +01:00
Nikita Popov 8690efd1f8 Update opt test
And fix a type in the fetch class flags dumping while here.
2021-03-18 15:25:40 +01:00
Christoph M. Becker 97cfdcd73b Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #80783: PDO ODBC truncates BLOB records at every 256th byte
2021-03-18 15:18:53 +01:00
Nikita Popov 4df39f4bd0 Don't imply SILENT from NO_AUTOLOAD
We have separate flags for non-autoloading class fetches and
silent class fetches. There's no reason why NO_AUTOLOAD should
be special-cased to be implicitly silent.
2021-03-18 15:15:21 +01:00
Christoph M. Becker bccca0b53a Fix #80783: PDO ODBC truncates BLOB records at every 256th byte
It is not guaranteed, that the driver inserts only a single NUL byte at
the end of the buffer.  Apparently, there is no way to find out the
actual data length in the buffer after calling `SQLGetData()`, so we
adjust after the next `SQLGetData()` call.

We also prevent PDO::ODBC_ATTR_ASSUME_UTF8 from fetching garbage, by
fetching all chunks with the same C type.

Closes GH-6716.
2021-03-18 15:13:27 +01:00
Dmitry Stogov c8a8c47f7e Merge branch 'PHP-8.0'
* PHP-8.0:
  Additional fix for bug #80847. On x86_64 part of structure may be passed in CPU registers.
2021-03-18 16:16:29 +03:00
Dmitry Stogov 465cfc499b Additional fix for bug #80847.
On x86_64 part of structure may be passed in CPU registers.
2021-03-18 16:13:42 +03:00
Dmitry Stogov 9373d159c2 "zend-test" was renamed to "zend_test" 2021-03-18 14:36:46 +03:00
Nikita Popov 3b88e65265 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix locale switch back to C in pcre
2021-03-18 10:51:04 +01:00
Nikita Popov 4dce2f83f5 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix locale switch back to C in pcre
2021-03-18 10:50:57 +01:00
Nikita Popov 4be867e910 Fix locale switch back to C in pcre
The compile context is shared between patterns, so we need to set
the character tables unconditionally in case we switched from
a non-C locale to the C locale.
2021-03-18 10:48:43 +01:00
Nikita Popov 234af00bcb Destroy constant values before object store
Now that constants can contain objects (currently only enums),
we should destroy them before we free the object store, otherwise
there will be false positive leak reports.

This doesn't affect the fast_shutdown sequence.
2021-03-18 10:31:28 +01:00
Dharman 7e9f6d2a48 Deprecate OO style mysqli::get_client_info method
Deprecate passing connection object to mysqli_get_client_info()

Closes GH-6777.
2021-03-17 20:10:18 +00:00
Dmitry Stogov eb8f5e4347 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fixed bug #80861 (erronous array key overflow in 2D array with JIT)
2021-03-17 23:00:22 +03:00
Dmitry Stogov 7e494d9225 Fixed bug #80861 (erronous array key overflow in 2D array with JIT) 2021-03-17 22:59:59 +03:00
Ilija Tovilo d628d7e015 Add enums to UPGRADING [ci skip] 2021-03-17 19:15:35 +01:00
Ilija Tovilo 269c8dac1d Implement enums
RFC: https://wiki.php.net/rfc/enumerations

Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>

Closes GH-6489.
2021-03-17 19:08:03 +01:00
George Peter Banyard a6fc427b8c Use zend_string_equals() API instead of strcmp() in various places
Closes GH-6784
2021-03-17 16:36:23 +00:00
George Peter Banyard a74e248c43 Use zend_string_equals() API instead of strcmp() in COM extension 2021-03-17 16:36:16 +00:00