Commit Graph

1375 Commits

Author SHA1 Message Date
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
Máté Kocsis
f11411ea0d Use typed property in PDOException 2021-04-20 14:45:42 +02:00
George Peter Banyard
e3403d80af Use ZEND_FALLTHROUGH instead of a comment in PDO 2021-04-19 13:59:18 +01:00
Nikita Popov
65a5c184d7 Add functions to convert i64/u64 to string
PDO implement half of this, but this functionality is generally
useful. Provide these as zend_u64_to_str and zend_i64_to_str to
complement zend_long_to_str.
2021-04-13 15:43:23 +02:00
Nikita Popov
19775afab3 Merge branch 'PHP-8.0'
* PHP-8.0:
  PDO: Respect connection transaction state for dtor rollback
2021-04-12 12:39:50 +02:00
Nikita Popov
8effbd1cb0 PDO: Respect connection transaction state for dtor rollback
As mentioned in bug #80949, if a transaction is implicitly
committed, then PDO may still issue a ROLLBACK when the PDO
object is destroyed, as the transaction is still marked as active
in PDO's (inaccurate) transaction emulation.

Make sure we use the connection transaction state also for that
final ROLLBACK. A caveat here is that the connection might have
been dropped already, which may be the case for some drivers if
construction fails. Make sure we don't crash in that case.
2021-04-12 12:39:44 +02:00
George Peter Banyard
5caaf40b43
Introduce pseudo-keyword ZEND_FALLTHROUGH
And use it instead of comments
2021-04-07 00:46:29 +01:00
Máté Kocsis
aa45eedef0
Merge branch 'PHP-8.0' 2021-03-25 19:32:21 +01:00
Máté Kocsis
d7ae64627f
Fix PDOStatement::bindColumn() parameter default value 2021-03-25 19:31:04 +01:00
Máté Kocsis
f15d52796e
Declare PDORow::queryString property
Relates GH-6742
2021-03-17 09:42:35 +01:00
George Peter Banyard
ebaeb93c3f Add API to fetch bool value for PDO attribute values
Closes GH-6766
2021-03-17 00:58:01 +00:00
George Peter Banyard
32fb9b6fd1 Validate string is numeric for integer PDO attribute value 2021-03-17 00:58:00 +00:00
George Peter Banyard
f89f600d4f Add comment explaining empty default case 2021-03-15 16:39:40 +00:00
George Peter Banyard
6cc0d7c0ec Boolify pdo_dbh_attribute_set() 2021-03-15 14:48:33 +00:00
George Peter Banyard
3e6940fe29 Boolify pdo_hash_methods() 2021-03-15 14:48:33 +00:00
George Peter Banyard
262744ff0d Boolify pdo_stmt_describe_columns() 2021-03-15 14:48:33 +00:00
George Peter Banyard
63c4e8b5ab Voidify internal pdo_sqlstate_init_error_table()
This always returned SUCCESS
2021-03-15 14:48:33 +00:00
George Peter Banyard
0807c6cbb0 Remove php_pdo_str_tolower_dup() function 2021-03-15 14:48:33 +00:00
Nikita Popov
7e3840df90 Assert that stmt is set in PDORow 2021-03-15 14:22:49 +01:00
Nikita Popov
f7751f2d8b Use zend_objects_not_comparable in PDO 2021-03-15 13:01:42 +01:00
Dmitry Stogov
72c3ededed Change the order of properties used for var_dump(), serialize(), comparison, etc.
Now properties are ordered according to their layout in zend_object structure.
2021-03-01 13:29:49 +03:00
Máté Kocsis
bf0f6aaf18
Improve class entry generation
Related to GH-6701
2021-02-16 13:09:56 +01:00
Máté Kocsis
af56982a5e
Generate class entries from stubs for oci8, odbc, openssl, pcntl, pdo, pgsql
Closes GH-6691
2021-02-14 23:19:21 +01:00
Máté Kocsis
45fa7596dc
Add missing classes to stubs 2021-02-09 22:38:06 +01:00
Máté Kocsis
99b08ac281
Implicitly enable function entry generation when class entry generation is enabled
Closes GH-6675
2021-02-09 13:37:24 +01:00
Máté Kocsis
1954e59758
Add support for generating class entries from stubs
Closes GH-6289

Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
2021-01-26 11:50:36 +01:00
George Peter Banyard
ef36de1317 Use zend_string_equals() in PDO
Closes GH-6623
2021-01-19 15:11:21 +00:00
George Peter Banyard
a6e8ebf99a Use standard C99 64bits int types
Closes GH-6622
2021-01-19 13:44:36 +00:00
George Peter Banyard
b44e29f843 php_pdo_register_driver() might fail
Therefore correctly report failure in MINIT for the drivers which didn't.
2021-01-19 12:55:07 +00:00
George Peter Banyard
424b4802d2 Remove unnecessary (char*) casts
The functions accepts a const char*
2021-01-19 12:40:50 +00:00
George Peter Banyard
a78aea8948 Refactor PDO's last inserted ID handler to use and return zend_string
Closes GH-6617
2021-01-19 11:54:25 +00:00
George Peter Banyard
94ea8e247b Refactor PDO doer handler to use zend_string 2021-01-19 11:42:39 +00:00
Nikita Popov
3e01f5afb1 Replace zend_bool uses with bool
We're starting to see a mix between uses of zend_bool and bool.
Replace all usages with the standard bool type everywhere.

Of course, zend_bool is retained as an alias.
2021-01-15 12:33:06 +01:00
Adam Baratz
b569698095 Add MSSQL setup to Azure Pipelines build 2021-01-11 21:46:41 -05:00
Nikita Popov
792f8fb1b5 Switch name variable to zend_string 2021-01-07 15:53:47 +00:00
Nikita Popov
7aa00369b0 Switch bound_param_map to zend_string 2021-01-07 15:53:47 +00:00
Nikita Popov
1b31a76221 Remove freeq member 2021-01-07 15:53:47 +00:00
George Peter Banyard
848f7e0e07 Refactor PDO placeholder's quoted string to zend_string 2021-01-07 15:53:54 +00:00
George Peter Banyard
63cda0fea8 Refactor PDO's quoter handler to return a zend_string
Closes GH-6547
2021-01-07 15:53:48 +00:00
George Peter Banyard
1a58611ae5 Voidify PDO's fetch_error handler 2021-01-06 10:20:57 +00:00
George Peter Banyard
60a61afd3c Boolify PDO's preparer handler 2021-01-06 10:20:57 +00:00
George Peter Banyard
53ba72ec03 Voidify PDO's closer handler 2021-01-06 10:20:57 +00:00
George Peter Banyard
954d3743cc Boolify PDO's quoter handler 2021-01-06 10:21:06 +00:00