Commit graph

61 commits

Author SHA1 Message Date
Máté Kocsis
2b4fee03af
Mark ext/mysqli properties as readonly for documentation purposes 2022-04-05 13:24:21 +02:00
Máté Kocsis
62e4ac9439
Add support for custom property links
Closes GH-7892
2022-01-07 08:28:26 +01:00
Máté Kocsis
f70ca0acd4
Mark mysqli_driver properties readonly 2022-01-04 08:41:02 +01:00
Kamil Tekiela
8869bbe0e9
Fix bug GH-7746 (mysqli_sql_exception->sqlstate is inaccessible)
Closes GH-7747
2021-12-30 14:23:06 +00:00
Máté Kocsis
1bf1481a2a
Specify a few array func info entries (#7425) 2021-08-30 14:29:18 +02:00
Máté Kocsis
8e6e9838b0
Add support for generating MAY_BE_ARRAY_OF_REF func info flag (#7416) 2021-08-30 13:50:34 +02:00
Máté Kocsis
7d3cdb3681
Fix mysqli stub alias verification issues
I had to add a few no-verify annotations since the return type of the function and method counterparts cannot be aligned properly (easily)
2021-08-26 17:36:53 +02:00
Máté Kocsis
17ccabc6b6
Generate optimizer func info from stubs for ext/curl, ext/mysqli, ext/pcre (#7407) 2021-08-26 17:11:45 +02:00
Máté Kocsis
fc0d8983d3
Fix some smaller formatting inconsistencies in stubs 2021-07-20 00:52:26 +02:00
Nikita Popov
625b89af2f Deprecate mysqli::init()
In favor of parent::__construct().

Part of https://wiki.php.net/rfc/deprecations_php_8_1.
2021-07-08 16:45:05 +02:00
Máté Kocsis
6af5b369d7
Merge branch 'PHP-8.0'
* mysqli_get_client_info() cannot return null
2021-05-26 17:49:39 +02:00
Máté Kocsis
ceb0951fa5
mysqli_get_client_info() cannot return null
This method is already deprecated
2021-05-26 17:48:35 +02:00
Máté Kocsis
01775fa104
Declare tentative return types for ext/mysqli (#6998) 2021-05-26 17:29:58 +02:00
Máté Kocsis
1a1a9b2e4a
Merge branch 'PHP-8.0'
* Fix the return type of mysqli_connect()
2021-05-26 12:11:09 +02:00
Máté Kocsis
97f7279353
Fix the return type of mysqli_connect() 2021-05-26 12:07:02 +02:00
Máté Kocsis
a6c9f148b6
Merge branch 'PHP-8.0'
* Fix return type of mysqli::connect()
2021-05-26 11:56:21 +02:00
Máté Kocsis
86ef34fc61
Fix the return type of mysqli::connect() 2021-05-26 11:55:03 +02:00
Máté Kocsis
4ece535f19
Merge branch 'PHP-8.0'
* Fix return type of php_user_filter::onCreate()
* Fix return type of mysqli::init()
* Fix return type of UConverter::fromUCallback() and UConverter::toUCallback()
2021-05-07 15:23:28 +02:00
Máté Kocsis
e8361eb0e3
Fix return type of mysqli::init() 2021-05-07 15:21:41 +02:00
Kamil Tekiela
54222a6fe4
Implement mysqli_fetch_column (#6798)
* Implement mysqli_fetch_column
2021-05-01 20:11:47 +01:00
Máté Kocsis
30a082cb16
Make some exception properties typed
Closes GH-6891
2021-04-22 10:22:50 +02:00
Kamil Tekiela
45bad6474e
Mysqli bind in execute (#6271) 2021-04-14 12:52:51 +01:00
Nikita Popov
d905e77483 Enforce types when writing to mysqli dynamic properties
Previously this just assumed that the value was of a certain type.

I'm doing this in a generic way that checks against the declared
property type -- the handler function can then assume the value
to be of the correct type.
2021-04-13 15:30:56 +02: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
Máté Kocsis
4833309bd2
Use typed properties in ext/mysqli
Closes GH-6739
2021-03-15 13:11:57 +01:00
Máté Kocsis
cad66533f0
Generate class entries from stubs for ldap, libxml, mbstring and mysqli
Closes GH-6684
2021-02-16 14:46:19 +01:00
Nikita Popov
1cd33d83db Merge branch 'PHP-8.0'
* PHP-8.0:
  Make mysqli_ssl_set() arguments nullable
2021-02-10 15:33:25 +01:00
Nikita Popov
39c6aaa9cc Make mysqli_ssl_set() arguments nullable
This function internally converts zero length arguments to NULL
argument -- but we should also accept them in the first place.

Null arguments being accepted was actually documented, before
bug #78399 adjusted the docs to match current behavior.
2021-02-10 15:31:27 +01:00
Nikita Popov
7b2c098f87 Merge branch 'PHP-8.0'
* PHP-8.0:
  Make fetch_* OO same as func
2021-01-06 15:03:28 +01:00
Dharman
34ef804b04 Make fetch_* OO same as func
Clsoses GH-6580.
2021-01-06 15:02:52 +01:00
Nikita Popov
73f989a83b Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix/improve mysqli stubs
2021-01-06 11:29:38 +01:00
Dharman
44a311dbbe Fix/improve mysqli stubs
* mysqli_commit $flags default value is 0, not -1.
* A number of functions cannot actually return null.
* mysqli_poll parameter names were incorrect, as this function
  has a different signature from select.
* fetch functions apart from fetch_all can return false on failure.
2021-01-06 11:28:45 +01:00
Nikita Popov
037512cfce Move fetch_all implementation out of mysqlnd
There doesn't seem to be any compelling reason to implement this
in mysqlnd rather than mysqli. It's just a loop over fetch_into.

This makes the function available under libmysqlclient as well,
and thus fixes bug #79372.
2020-12-18 12:27:30 +01:00
Nikita Popov
be93e5a120 Make mysqli_stmt_next_result available under libmysql
The libmysqlclient version we require supports mysql_stmt_next_result.
2020-12-18 11:32:41 +01:00
Máté Kocsis
d5f92baad0 Fix default value handling of mysqli_fetch_object()
Make [] acceptable both for classes without constructors and
classes with a constructor that takes no arguments.

Closes GH-6336.
2020-10-20 16:48:12 +02:00
Máté Kocsis
d6264b0966
Verify parameter names of function aliases
Closes GH-6335
2020-10-16 10:56:33 +02:00
Nikita Popov
e86a6ced06 Use $statement in mysqli
As we went with $statement rather than $stmts in other places,
let's also use it in mysqli. The discrepancy with mysqli_stmt
is a bit unfortunate, but we can't be consistent with *both*.

Closes GH-6330.
2020-10-13 14:20:00 +02:00
Nikita Popov
8138ed73d7 Make mysqli_warning constructor private
The constructor was already effectively inaccessible (protected
on a final class). This just makes it more obvious and removes
the implementation in favor of directly throwing.

Per the removed test, this was an unfinished feature, and I don't
think it makes a lot of sense to finish it -- the
mysqli_stmt::get_warnings() interface makes more sense than
direct construction.

Closes GH-6208.
2020-09-27 22:08:24 +02:00
Larry Garfield
02dc9ce6e5 Rename mysqli parameters to be more logical
Closes GH-6172.
2020-09-27 21:28:29 +02:00
Nikita Popov
be4553b61a More precise type in mysqli_result constructor
This ctor requires a mysqli object. Possibly there was some
confusion with the mysqli_warning constructor here.
2020-09-24 09:56:48 +02:00
Nikita Popov
e7f98f82ac Add missing mysqlnd checks to stubs 2020-09-17 11:40:14 +02:00
George Peter Banyard
7a95e943d6 Promote warnings to Error in MySQLi extension
Closes GH-5803
2020-09-15 19:12:02 +02:00
Nikita Popov
6570fc2cf8 Remove dummy aliases for mysqli constructors
These are only available as methods. Directly declare them as
such instead of aliasing to functions that don't actually exist.
2020-08-14 11:12:41 +02:00
Máté Kocsis
046cc5e4c2
Add another round of missing parameter types to stubs
Closes GH-5950
2020-08-07 16:48:45 +02:00
Máté Kocsis
0d330e1a02
Add a few missing parameter types in stubs
Related to GH-5627
2020-07-30 14:26:45 +02:00
Nikita Popov
f7f557926e Fix arg/func info
* mysqli_get_server_info() cannot return null. The underlying API
   is infallible.
 * mysqli_select_db() func info is redundant.
 * mb_detect_order() can only return array|true, not array|false.

Also make the func_info.phpt test that is supposed to catch these
kinds of issues actually work.
2020-07-21 15:00:33 +02:00
Nikita Popov
ff19ec2df3 Introduce InternalIterator
Userland classes that implement Traversable must do so either
through Iterator or IteratorAggregate. The same requirement does
not exist for internal classes: They can implement the internal
get_iterator mechanism, without exposing either the Iterator or
IteratorAggregate APIs. This makes them usable in get_iterator(),
but incompatible with any Iterator based APIs.

A lot of internal classes do this, because exposing the userland
APIs is simply a lot of work. This patch alleviates this issue by
providing a generic InternalIterator class, which acts as an
adapater between get_iterator and Iterator, and can be easily
used by many internal classes. At the same time, we extend the
requirement that Traversable implies Iterator or IteratorAggregate
to internal classes as well.

Closes GH-5216.
2020-06-24 15:31:41 +02:00
Máté Kocsis
596561009c
Fix some UNKNOWN default values
In ext/ffi, ext/intl, ext/mysqli, and ext/pcntl
2020-06-09 09:46:51 +02:00
Máté Kocsis
b3718430de
Annotate internal functions with the mixed type
Closes GH-5618
2020-05-25 17:30:57 +02:00
Máté Kocsis
ed6cf67879
Fix some final classes in stubs 2020-05-19 14:54:37 +02:00