Skip to content

Commit 18c0068

Browse files
authored
Merge pull request #313 from thecodingmachine/regenerate
FEATURE: deprecated the module mysqli and regenerated the files
2 parents e661d5d + 017e0ff commit 18c0068

19 files changed

+492
-164
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"deprecated/mssql.php",
1717
"deprecated/stats.php",
1818
"lib/special_cases.php",
19+
"deprecated/mysqli.php",
1920
"generated/apache.php",
2021
"generated/apcu.php",
2122
"generated/array.php",
@@ -55,7 +56,6 @@
5556
"generated/mbstring.php",
5657
"generated/misc.php",
5758
"generated/mysql.php",
58-
"generated/mysqli.php",
5959
"generated/network.php",
6060
"generated/oci8.php",
6161
"generated/opcache.php",
File renamed without changes.

deprecated/functionsList.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
'mssql_pconnect',
4949
'mssql_query',
5050
'mssql_select_db',
51+
'mysqli_get_client_stats',
5152
'stats_covariance',
5253
'stats_standard_deviation',
5354
'stats_stat_correlation',
File renamed without changes.

generated/array.php

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -28,36 +28,6 @@ function array_combine(array $keys, array $values): array
2828
}
2929

3030

31-
/**
32-
* array_flip returns an array in flip
33-
* order, i.e. keys from array become values and values
34-
* from array become keys.
35-
*
36-
* Note that the values of array need to be valid
37-
* keys, i.e. they need to be either int or
38-
* string. A warning will be emitted if a value has the wrong
39-
* type, and the key/value pair in question will not be included
40-
* in the result.
41-
*
42-
* If a value has several occurrences, the latest key will be
43-
* used as its value, and all others will be lost.
44-
*
45-
* @param array $array An array of key/value pairs to be flipped.
46-
* @return array Returns the flipped array on success.
47-
* @throws ArrayException
48-
*
49-
*/
50-
function array_flip(array $array): array
51-
{
52-
error_clear_last();
53-
$result = \array_flip($array);
54-
if ($result === null) {
55-
throw ArrayException::createFromPhpError();
56-
}
57-
return $result;
58-
}
59-
60-
6131
/**
6232
* array_replace_recursive replaces the values of
6333
* array with the same values from all the following

generated/curl.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2354,7 +2354,7 @@ function curl_multi_setopt($multi_handle, int $option, $value): void
23542354
* multipart/form-data.
23552355
*
23562356
*
2357-
* Files can be sent using CURLFile,
2357+
* Files can be sent using CURLFile or CURLStringFile,
23582358
* in which case value must be an array.
23592359
*
23602360
*

generated/errorfunc.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
* message is sent by email to the address in
3131
* the destination parameter. This is the only
3232
* message type where the fourth parameter,
33-
* extra_headers is used.
33+
* additional_headers is used.
3434
*
3535
*
3636
*
@@ -59,18 +59,18 @@
5959
*
6060
* @param string $destination The destination. Its meaning depends on the
6161
* message_type parameter as described above.
62-
* @param string $extra_headers The extra headers. It's used when the message_type
62+
* @param string $additional_headers The extra headers. It's used when the message_type
6363
* parameter is set to 1.
6464
* This message type uses the same internal function as
6565
* mail does.
6666
* @throws ErrorfuncException
6767
*
6868
*/
69-
function error_log(string $message, int $message_type = 0, string $destination = null, string $extra_headers = null): void
69+
function error_log(string $message, int $message_type = 0, string $destination = null, string $additional_headers = null): void
7070
{
7171
error_clear_last();
72-
if ($extra_headers !== null) {
73-
$result = \error_log($message, $message_type, $destination, $extra_headers);
72+
if ($additional_headers !== null) {
73+
$result = \error_log($message, $message_type, $destination, $additional_headers);
7474
} elseif ($destination !== null) {
7575
$result = \error_log($message, $message_type, $destination);
7676
} else {

generated/filesystem.php

Lines changed: 83 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,13 @@ function chown(string $filename, $user): void
8989

9090

9191
/**
92-
* Makes a copy of the file source to
93-
* dest.
92+
* Makes a copy of the file from to
93+
* to.
9494
*
9595
* If you wish to move a file, use the rename function.
9696
*
97-
* @param string $source Path to the source file.
98-
* @param string $dest The destination path. If dest is a URL, the
97+
* @param string $from Path to the source file.
98+
* @param string $to The destination path. If to is a URL, the
9999
* copy operation may fail if the wrapper does not support overwriting of
100100
* existing files.
101101
*
@@ -105,13 +105,13 @@ function chown(string $filename, $user): void
105105
* @throws FilesystemException
106106
*
107107
*/
108-
function copy(string $source, string $dest, $context = null): void
108+
function copy(string $from, string $to, $context = null): void
109109
{
110110
error_clear_last();
111111
if ($context !== null) {
112-
$result = \copy($source, $dest, $context);
112+
$result = \copy($from, $to, $context);
113113
} else {
114-
$result = \copy($source, $dest);
114+
$result = \copy($from, $to);
115115
}
116116
if ($result === false) {
117117
throw FilesystemException::createFromPhpError();
@@ -226,6 +226,52 @@ function fflush($stream): void
226226
}
227227

228228

229+
/**
230+
* Similar to fgets except that
231+
* fgetcsv parses the line it reads for fields in
232+
* CSV format and returns an array containing the fields
233+
* read.
234+
*
235+
* @param resource $stream A valid file pointer to a file successfully opened by
236+
* fopen, popen, or
237+
* fsockopen.
238+
* @param int $length Must be greater than the longest line (in characters) to be found in
239+
* the CSV file (allowing for trailing line-end characters). Otherwise the
240+
* line is split in chunks of length characters,
241+
* unless the split would occur inside an enclosure.
242+
*
243+
* Omitting this parameter (or setting it to 0,
244+
* or NULL in PHP 8.0.0 or later) the maximum line length is not limited,
245+
* which is slightly slower.
246+
* @param string $separator The optional separator parameter sets the field separator (one single-byte character only).
247+
* @param string $enclosure The optional enclosure parameter sets the field enclosure character (one single-byte character only).
248+
* @param string $escape The optional escape parameter sets the escape character (at most one single-byte character).
249+
* An empty string ("") disables the proprietary escape mechanism.
250+
* @return array|false|null Returns an indexed array containing the fields read on success.
251+
* @throws FilesystemException
252+
*
253+
*/
254+
function fgetcsv($stream, int $length = null, string $separator = ",", string $enclosure = "\"", string $escape = "\\")
255+
{
256+
error_clear_last();
257+
if ($escape !== "\\") {
258+
$result = \fgetcsv($stream, $length, $separator, $enclosure, $escape);
259+
} elseif ($enclosure !== "\"") {
260+
$result = \fgetcsv($stream, $length, $separator, $enclosure);
261+
} elseif ($separator !== ",") {
262+
$result = \fgetcsv($stream, $length, $separator);
263+
} elseif ($length !== null) {
264+
$result = \fgetcsv($stream, $length);
265+
} else {
266+
$result = \fgetcsv($stream);
267+
}
268+
if ($result === false) {
269+
throw FilesystemException::createFromPhpError();
270+
}
271+
return $result;
272+
}
273+
274+
229275
/**
230276
* This function is similar to file, except that
231277
* file_get_contents returns the file in a
@@ -872,7 +918,7 @@ function fopen(string $filename, string $mode, bool $use_include_path = false, $
872918
* @throws FilesystemException
873919
*
874920
*/
875-
function fputcsv($stream, array $fields, string $separator = ",", string $enclosure = '"', string $escape = "\\", string $eol = "\n"): int
921+
function fputcsv($stream, array $fields, string $separator = ",", string $enclosure = "\"", string $escape = "\\", string $eol = "\n"): int
876922
{
877923
error_clear_last();
878924
$result = \fputcsv($stream, $fields, $separator, $enclosure, $escape, $eol);
@@ -1009,24 +1055,23 @@ function ftruncate($stream, int $size): void
10091055
/**
10101056
*
10111057
*
1012-
* @param resource $handle A file system pointer resource
1058+
* @param resource $stream A file system pointer resource
10131059
* that is typically created using fopen.
1014-
* @param string $string The string that is to be written.
1015-
* @param int $length If the length argument is given, writing will
1016-
* stop after length bytes have been written or
1017-
* the end of string is reached, whichever comes
1018-
* first.
1060+
* @param string $data The string that is to be written.
1061+
* @param int $length If length is an integer, writing will stop
1062+
* after length bytes have been written or the
1063+
* end of data is reached, whichever comes first.
10191064
* @return int
10201065
* @throws FilesystemException
10211066
*
10221067
*/
1023-
function fwrite($handle, string $string, int $length = null): int
1068+
function fwrite($stream, string $data, int $length = null): int
10241069
{
10251070
error_clear_last();
10261071
if ($length !== null) {
1027-
$result = \fwrite($handle, $string, $length);
1072+
$result = \fwrite($stream, $data, $length);
10281073
} else {
1029-
$result = \fwrite($handle, $string);
1074+
$result = \fwrite($stream, $data);
10301075
}
10311076
if ($result === false) {
10321077
throw FilesystemException::createFromPhpError();
@@ -1420,22 +1465,22 @@ function realpath(string $path): string
14201465

14211466

14221467
/**
1423-
* Attempts to rename oldname to
1424-
* newname, moving it between directories if necessary.
1425-
* If renaming a file and newname exists,
1468+
* Attempts to rename from to
1469+
* to, moving it between directories if necessary.
1470+
* If renaming a file and to exists,
14261471
* it will be overwritten. If renaming a directory and
1427-
* newname exists,
1472+
* to exists,
14281473
* this function will emit a warning.
14291474
*
1430-
* @param string $oldname The old name.
1475+
* @param string $from The old name.
14311476
*
1432-
* The wrapper used in oldname
1477+
* The wrapper used in from
14331478
* must match the wrapper used in
1434-
* newname.
1435-
* @param string $newname The new name.
1479+
* to.
1480+
* @param string $to The new name.
14361481
*
14371482
*
1438-
* On Windows, if newname already exists, it must be writable.
1483+
* On Windows, if to already exists, it must be writable.
14391484
* Otherwise rename fails and issues E_WARNING.
14401485
*
14411486
*
@@ -1444,13 +1489,13 @@ function realpath(string $path): string
14441489
* @throws FilesystemException
14451490
*
14461491
*/
1447-
function rename(string $oldname, string $newname, $context = null): void
1492+
function rename(string $from, string $to, $context = null): void
14481493
{
14491494
error_clear_last();
14501495
if ($context !== null) {
1451-
$result = \rename($oldname, $newname, $context);
1496+
$result = \rename($from, $to, $context);
14521497
} else {
1453-
$result = \rename($oldname, $newname);
1498+
$result = \rename($from, $to);
14541499
}
14551500
if ($result === false) {
14561501
throw FilesystemException::createFromPhpError();
@@ -1573,29 +1618,29 @@ function tmpfile()
15731618
/**
15741619
* Attempts to set the access and modification times of the file named in the
15751620
* filename parameter to the value given in
1576-
* time.
1621+
* mtime.
15771622
* Note that the access time is always modified, regardless of the number
15781623
* of parameters.
15791624
*
15801625
* If the file does not exist, it will be created.
15811626
*
15821627
* @param string $filename The name of the file being touched.
1583-
* @param int $time The touch time. If time is not supplied,
1628+
* @param int $mtime The touch time. If mtime is NULL,
15841629
* the current system time is used.
1585-
* @param int $atime If present, the access time of the given filename is set to
1630+
* @param int $atime If NULL, the access time of the given filename is set to
15861631
* the value of atime. Otherwise, it is set to
1587-
* the value passed to the time parameter.
1588-
* If neither are present, the current system time is used.
1632+
* the value passed to the mtime parameter.
1633+
* If both are NULL, the current system time is used.
15891634
* @throws FilesystemException
15901635
*
15911636
*/
1592-
function touch(string $filename, int $time = null, int $atime = null): void
1637+
function touch(string $filename, int $mtime = null, int $atime = null): void
15931638
{
15941639
error_clear_last();
15951640
if ($atime !== null) {
1596-
$result = \touch($filename, $time, $atime);
1597-
} elseif ($time !== null) {
1598-
$result = \touch($filename, $time);
1641+
$result = \touch($filename, $mtime, $atime);
1642+
} elseif ($mtime !== null) {
1643+
$result = \touch($filename, $mtime);
15991644
} else {
16001645
$result = \touch($filename);
16011646
}

generated/ftp.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,28 @@ function ftp_pwd($ftp): string
411411
}
412412

413413

414+
/**
415+
* Sends an arbitrary command to the FTP server.
416+
*
417+
* @param resource $ftp An FTP\Connection instance.
418+
* @param string $command The command to execute.
419+
* @return array Returns the server's response as an array of strings.
420+
* No parsing is performed on the response string, nor does
421+
* ftp_raw determine if the command succeeded.
422+
* @throws FtpException
423+
*
424+
*/
425+
function ftp_raw($ftp, string $command): array
426+
{
427+
error_clear_last();
428+
$result = \ftp_raw($ftp, $command);
429+
if ($result === null) {
430+
throw FtpException::createFromPhpError();
431+
}
432+
return $result;
433+
}
434+
435+
414436
/**
415437
* ftp_rename renames a file or a directory on the FTP
416438
* server.

0 commit comments

Comments
 (0)