1
0
mirror of https://github.com/php/php-src.git synced 2026-04-13 19:14:16 +02:00
Commit Graph

1417 Commits

Author SHA1 Message Date
Remi Collet
55a88f36b6 add SensitiveParameter as known string and use it in arginfo 2022-07-18 11:43:33 +02:00
Tim Düsterhus
342e18f105 Support the actual #[\SensitiveParameter] attribute in stubs (#8836) 2022-07-12 12:43:44 +02:00
Pierrick Charron
1bcd8d394a Update gen_stub to support #if around classes 2022-06-13 16:34:12 -04:00
Pierrick Charron
6fd2b39397 Indent with TAB in .h files generated by gen_stub 2022-06-13 08:55:54 -04:00
Tim Düsterhus
6906d1fc8d Mark parameter in ext/pdo as sensitive 2022-06-13 11:09:12 +02:00
Christoph M. Becker
e86acb1861 Run POD_Firebird tests on AppVeyor CI
We also fix gh8626.phpt for the firebird driver by allowing negative
status codes as well.  We mark the other two test cases as xfail for
the firebird driver for now.

Closes GH-8666.
2022-06-10 12:22:44 +02:00
Christoph M. Becker
c451a9bddc Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix recently broken test case
2022-06-08 18:34:25 +02:00
Christoph M. Becker
f768f3d60b Fix recently broken test case
This test was written to always use the sqlite PDO driver; however,
that driver may no longer be available[1], and actually the test is
supposed to work for all drivers – otherwise it should be placed in
ext/pdo_sqlite/tests.

[1] <938049b927>

Closes GH-8732.
2022-06-08 18:33:55 +02:00
George Peter Banyard
306f8d282d Merge branch 'PHP-8.1' 2022-06-08 11:38:16 +01:00
George Peter Banyard
938049b927 PDO Common tests should not require a driver 2022-06-08 11:37:07 +01:00
David Carlier
271b723915 Merge branch 'PHP-8.1' 2022-06-03 15:15:46 +01:00
David Carlier
4a1c50b9be Merge branch 'PHP-8.0' into PHP-8.1 2022-06-03 15:15:30 +01:00
Yurun
bfe63f565f Fix dblib ghtest8626 test.
Follow-up of GH-8628.
Closes GH-9694.
2022-06-03 15:12:09 +01:00
David Carlier
59503c0518 Merge branch 'PHP-8.1' 2022-06-02 17:36:02 +01:00
David Carlier
0f428ae240 Merge branch 'PHP-8.0' into PHP-8.1 2022-06-02 17:35:45 +01:00
Yurun
df52903ee0 Closes GH-8626: Fix PDOStatement->execute() failed.
Then execute successfully, errorInfo() information is incorrect
2022-06-02 17:32:43 +01:00
Máté Kocsis
84cd2a9047 Add some stub related todo comments 2022-05-25 13:24:11 +02:00
Levi Morrison
282655083e Fix some minor warnings (#8568)
* Fix php_apache_get_version prototype

Avoids an error with -Werror=strict-prototypes when building the
Apache SAPI.

* Fix -Werror=stringop-truncation in pdo_raise_impl_error

* Note pdo_error_type BC break
2022-05-18 08:30:59 -06:00
Máté Kocsis
e127f3ff8f Merge branch 'PHP-8.1'
* PHP-8.1:
  Redefine PDOException::$code with correct type
2022-01-01 17:55:33 +01:00
Máté Kocsis
96a5026bfd Redefine PDOException::$code with correct type
Closes GH-7839
2022-01-01 17:54:59 +01:00
Christoph M. Becker
9c6b843ff0 Merge branch 'PHP-8.1'
* PHP-8.1:
  Skip bug_36798.phpt for PDO_DBLIB
2021-12-07 20:26:19 +01:00
Christoph M. Becker
7d4fdf1510 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Skip bug_36798.phpt for PDO_DBLIB
2021-12-07 20:25:35 +01:00
Christoph M. Becker
efb901ebed Skip bug_36798.phpt for PDO_DBLIB
For some reason, this test fails now with "Incorrect syntax near ''.
[SELECT '�' as test FROM test WHERE id = '1']", so we skip it.
2021-12-07 20:24:15 +01:00
Nikita Popov
902d64390e Deprecate implicit dynamic properties
Writing to a proprety that hasn't been declared is deprecated,
unless the class uses the #[AllowDynamicProperties] attribute or
defines __get()/__set().

RFC: https://wiki.php.net/rfc/deprecate_dynamic_properties
2021-11-26 14:10:11 +01:00
Nikita Popov
a4da60f4b5 Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix leak when persistent PDO connection fails
2021-11-16 16:16:34 +01:00
Nikita Popov
c02aa46126 Fix leak when persistent PDO connection fails
As we don't register the resource, the resource dtor is not called
and will not decrement the refcount.
2021-11-16 16:14:29 +01:00
hassan
888bec1be3 Merge duplicate identical conditions in PDO (#7638) 2021-11-10 12:21:04 +00:00
Dmitry Stogov
90b7bde615 Use more compact representation for packed arrays.
- for packed arrays we store just an array of zvals without keys.
- the elements of packed array are accessible throuf as ht->arPacked[i]
  instead of ht->arData[i]
- in addition to general ZEND_HASH_FOREACH_* macros, we introduced similar
  familied for packed (ZEND_HASH_PACKED_FORECH_*) and real hashes
  (ZEND_HASH_MAP_FOREACH_*)
- introduced an additional family of macros to access elements of array
  (packed or real hashes) ZEND_ARRAY_ELEMET_SIZE, ZEND_ARRAY_ELEMET_EX,
  ZEND_ARRAY_ELEMET, ZEND_ARRAY_NEXT_ELEMENT, ZEND_ARRAY_PREV_ELEMENT
- zend_hash_minmax() prototype was changed to compare only values

Because of smaller data set, this patch may show performance improvement
on some apps and benchmarks that use packed arrays. (~1% on PHP-Parser)

TODO:
    - sapi/phpdbg needs special support for packed arrays (WATCH_ON_BUCKET).
    - zend_hash_sort_ex() may require converting packed arrays to hash.
2021-11-03 15:18:26 +03:00
Máté Kocsis
6a47831e6e Add more specific array return type hints for various extensions - part 3 (#7467) 2021-09-06 12:27:28 +02:00
Nikita Popov
1e012ecb3f Fix bug #81405: Restore old PDO::PARAM_* values
Doctrine hardcodes the values of these constants, avoid changing
them.

Closes GH-7445.
2021-09-01 13:54:41 +02:00
Nikita Popov
6385006102 Merge branch 'PHP-8.0'
* PHP-8.0:
  Mark PDO::setAttribute() $value as mixed
2021-08-20 16:53:25 +02:00
Nikita Popov
2e343fcb42 Mark PDO::setAttribute() $value as mixed
For consistency with PDOStatement::setAttribute(). Attribute values
can for example also be bool.

This is backwards-compatible, as mixed is the same as no type for
parameter variance.
2021-08-20 16:51:52 +02:00
Jeremy Mikola
858d0c0916 Include class name in Serializable deprecation message
The deprecation message was originally introduced in 3e6b447 (#6494).

I first encountered this notice when testing the MongoDB extension
with PHP 8.1, which produced many duplicate messages that provided
no detail about the particular class that needed to be fixed.

Closes GH-7346.
2021-08-11 10:35:47 +02:00
Nikita Popov
8a26cbe0dd Remove unnecessary PDORow get_method / get_class_name handlers
These implement the default behavior, but badly.
2021-07-22 10:40:10 +02:00
Máté Kocsis
2378f35787 Use single line phpdoc in stubs where possible 2021-07-20 13:16:56 +02:00
Joe Watkins
570d9b63e9 Not serializable flag permeation 2021-07-20 12:28:35 +02:00
Nikita Popov
584dc19df1 Move tests requiring pdo_sqlite into ext directory
If the test is written against a specific PDO driver, it should
not be part of the generic ext/pdo tests.
2021-06-14 15:01:16 +02:00
Nikita Popov
7485978339 Migrate SKIPIF -> EXTENSIONS (#7138)
This is an automated migration of most SKIPIF extension_loaded checks.
2021-06-11 11:57:42 +02:00
Nikita Popov
9d2a466c4b Remove explicit assignments of zend_objects_destroy_object
This is the default handler, no need to set it explicitly. This
makes it easier to see which objects really have a custom dtor_obj.
2021-06-09 11:29:50 +02:00
Nikita Popov
91eb201fd8 Allow initializing assignment to PDOStatement::$queryString
If the object is not created through PDO::prepare(), e.g. in a
mock scenario, it should still be possible to initialize the
$queryString property.

See bug #81084.
2021-05-31 14:54:29 +02:00
Máté Kocsis
62f7c0a2d6 Remove unnecessary return doc comment from PDOStatement::errorInfo() 2021-05-26 17:33:14 +02:00
Máté Kocsis
4ed66ff2a9 Declare tentative return types for ext/pdo
Closes GH-6996
2021-05-25 19:17:40 +02:00
KsaR
01b3fc03c3 Update http->https in license (#6945)
1. Update: http://www.php.net/license/3_01.txt to https, as there is anyway server header "Location:" to https.
2. Update few license 3.0 to 3.01 as 3.0 states "php 5.1.1, 4.1.1, and earlier".
3. In some license comments is "at through the world-wide-web" while most is without "at", so deleted.
4. fixed indentation in some files before |
2021-05-06 12:16:35 +02:00
Máté Kocsis
7df7867624 Merge branch 'PHP-8.0'
* Fix the signature of PDOStatement::fetchObject()
2021-05-05 16:51:23 +02:00
Máté Kocsis
068c8db276 Fix the signature of PDOStatement::fetchObject()
The ?array $ctorArgs = null parameter is changed to array $constructorArgs = [], and an additional memory leak revealed by the new test case is fixed.

Closes GH-6937

Co-Authored-By: Nikita Popov <nikita.ppv@gmail.com>
2021-05-05 16:48:22 +02:00
Máté Kocsis
e2ad44357e Merge branch 'PHP-8.0'
* Fix the default value of $mode in PDOStatement::fetch*()
2021-05-03 13:08:36 +02:00
Máté Kocsis
30d3062c9b Fix the default value of $mode in PDOStatement::fetch*()
Closes GH-6933
2021-05-03 13:06:38 +02:00
Nikita Popov
3e6b447979 Partially deprecate Serializable
If Serializable is implemented, require that __serialize() and
__unserialize() are implemented as well, else issue a deprecation
warning.

Also deprecate use of PDO::FETCH_SERIALIZE.

RFC: https://wiki.php.net/rfc/phase_out_serializable

Closes GH-6494.
2021-04-28 16:55:14 +02:00
Kamil Tekiela
0a779040a0 Add test case for errorCode() 2021-04-25 15:57:43 +01:00
Kamil Tekiela
3292b9761a Add ZEND_ASSERT to stmt->errorCode 2021-04-25 15:57:43 +01:00