Skip to content

Commit

Permalink
Merge pull request #313 from thecodingmachine/regenerate
Browse files Browse the repository at this point in the history
FEATURE: deprecated the module mysqli and regenerated the files
  • Loading branch information
Kharhamel authored Dec 31, 2021
2 parents e661d5d + 017e0ff commit 18c0068
Show file tree
Hide file tree
Showing 19 changed files with 492 additions and 164 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"deprecated/mssql.php",
"deprecated/stats.php",
"lib/special_cases.php",
"deprecated/mysqli.php",
"generated/apache.php",
"generated/apcu.php",
"generated/array.php",
Expand Down Expand Up @@ -55,7 +56,6 @@
"generated/mbstring.php",
"generated/misc.php",
"generated/mysql.php",
"generated/mysqli.php",
"generated/network.php",
"generated/oci8.php",
"generated/opcache.php",
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions deprecated/functionsList.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
'mssql_pconnect',
'mssql_query',
'mssql_select_db',
'mysqli_get_client_stats',
'stats_covariance',
'stats_standard_deviation',
'stats_stat_correlation',
Expand Down
File renamed without changes.
30 changes: 0 additions & 30 deletions generated/array.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,36 +28,6 @@ function array_combine(array $keys, array $values): array
}


/**
* array_flip returns an array in flip
* order, i.e. keys from array become values and values
* from array become keys.
*
* Note that the values of array need to be valid
* keys, i.e. they need to be either int or
* string. A warning will be emitted if a value has the wrong
* type, and the key/value pair in question will not be included
* in the result.
*
* If a value has several occurrences, the latest key will be
* used as its value, and all others will be lost.
*
* @param array $array An array of key/value pairs to be flipped.
* @return array Returns the flipped array on success.
* @throws ArrayException
*
*/
function array_flip(array $array): array
{
error_clear_last();
$result = \array_flip($array);
if ($result === null) {
throw ArrayException::createFromPhpError();
}
return $result;
}


/**
* array_replace_recursive replaces the values of
* array with the same values from all the following
Expand Down
2 changes: 1 addition & 1 deletion generated/curl.php
Original file line number Diff line number Diff line change
Expand Up @@ -2354,7 +2354,7 @@ function curl_multi_setopt($multi_handle, int $option, $value): void
* multipart/form-data.
*
*
* Files can be sent using CURLFile,
* Files can be sent using CURLFile or CURLStringFile,
* in which case value must be an array.
*
*
Expand Down
10 changes: 5 additions & 5 deletions generated/errorfunc.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
* message is sent by email to the address in
* the destination parameter. This is the only
* message type where the fourth parameter,
* extra_headers is used.
* additional_headers is used.
*
*
*
Expand Down Expand Up @@ -59,18 +59,18 @@
*
* @param string $destination The destination. Its meaning depends on the
* message_type parameter as described above.
* @param string $extra_headers The extra headers. It's used when the message_type
* @param string $additional_headers The extra headers. It's used when the message_type
* parameter is set to 1.
* This message type uses the same internal function as
* mail does.
* @throws ErrorfuncException
*
*/
function error_log(string $message, int $message_type = 0, string $destination = null, string $extra_headers = null): void
function error_log(string $message, int $message_type = 0, string $destination = null, string $additional_headers = null): void
{
error_clear_last();
if ($extra_headers !== null) {
$result = \error_log($message, $message_type, $destination, $extra_headers);
if ($additional_headers !== null) {
$result = \error_log($message, $message_type, $destination, $additional_headers);
} elseif ($destination !== null) {
$result = \error_log($message, $message_type, $destination);
} else {
Expand Down
121 changes: 83 additions & 38 deletions generated/filesystem.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,13 @@ function chown(string $filename, $user): void


/**
* Makes a copy of the file source to
* dest.
* Makes a copy of the file from to
* to.
*
* If you wish to move a file, use the rename function.
*
* @param string $source Path to the source file.
* @param string $dest The destination path. If dest is a URL, the
* @param string $from Path to the source file.
* @param string $to The destination path. If to is a URL, the
* copy operation may fail if the wrapper does not support overwriting of
* existing files.
*
Expand All @@ -105,13 +105,13 @@ function chown(string $filename, $user): void
* @throws FilesystemException
*
*/
function copy(string $source, string $dest, $context = null): void
function copy(string $from, string $to, $context = null): void
{
error_clear_last();
if ($context !== null) {
$result = \copy($source, $dest, $context);
$result = \copy($from, $to, $context);
} else {
$result = \copy($source, $dest);
$result = \copy($from, $to);
}
if ($result === false) {
throw FilesystemException::createFromPhpError();
Expand Down Expand Up @@ -226,6 +226,52 @@ function fflush($stream): void
}


/**
* Similar to fgets except that
* fgetcsv parses the line it reads for fields in
* CSV format and returns an array containing the fields
* read.
*
* @param resource $stream A valid file pointer to a file successfully opened by
* fopen, popen, or
* fsockopen.
* @param int $length Must be greater than the longest line (in characters) to be found in
* the CSV file (allowing for trailing line-end characters). Otherwise the
* line is split in chunks of length characters,
* unless the split would occur inside an enclosure.
*
* Omitting this parameter (or setting it to 0,
* or NULL in PHP 8.0.0 or later) the maximum line length is not limited,
* which is slightly slower.
* @param string $separator The optional separator parameter sets the field separator (one single-byte character only).
* @param string $enclosure The optional enclosure parameter sets the field enclosure character (one single-byte character only).
* @param string $escape The optional escape parameter sets the escape character (at most one single-byte character).
* An empty string ("") disables the proprietary escape mechanism.
* @return array|false|null Returns an indexed array containing the fields read on success.
* @throws FilesystemException
*
*/
function fgetcsv($stream, int $length = null, string $separator = ",", string $enclosure = "\"", string $escape = "\\")
{
error_clear_last();
if ($escape !== "\\") {
$result = \fgetcsv($stream, $length, $separator, $enclosure, $escape);
} elseif ($enclosure !== "\"") {
$result = \fgetcsv($stream, $length, $separator, $enclosure);
} elseif ($separator !== ",") {
$result = \fgetcsv($stream, $length, $separator);
} elseif ($length !== null) {
$result = \fgetcsv($stream, $length);
} else {
$result = \fgetcsv($stream);
}
if ($result === false) {
throw FilesystemException::createFromPhpError();
}
return $result;
}


/**
* This function is similar to file, except that
* file_get_contents returns the file in a
Expand Down Expand Up @@ -872,7 +918,7 @@ function fopen(string $filename, string $mode, bool $use_include_path = false, $
* @throws FilesystemException
*
*/
function fputcsv($stream, array $fields, string $separator = ",", string $enclosure = '"', string $escape = "\\", string $eol = "\n"): int
function fputcsv($stream, array $fields, string $separator = ",", string $enclosure = "\"", string $escape = "\\", string $eol = "\n"): int
{
error_clear_last();
$result = \fputcsv($stream, $fields, $separator, $enclosure, $escape, $eol);
Expand Down Expand Up @@ -1009,24 +1055,23 @@ function ftruncate($stream, int $size): void
/**
*
*
* @param resource $handle A file system pointer resource
* @param resource $stream A file system pointer resource
* that is typically created using fopen.
* @param string $string The string that is to be written.
* @param int $length If the length argument is given, writing will
* stop after length bytes have been written or
* the end of string is reached, whichever comes
* first.
* @param string $data The string that is to be written.
* @param int $length If length is an integer, writing will stop
* after length bytes have been written or the
* end of data is reached, whichever comes first.
* @return int
* @throws FilesystemException
*
*/
function fwrite($handle, string $string, int $length = null): int
function fwrite($stream, string $data, int $length = null): int
{
error_clear_last();
if ($length !== null) {
$result = \fwrite($handle, $string, $length);
$result = \fwrite($stream, $data, $length);
} else {
$result = \fwrite($handle, $string);
$result = \fwrite($stream, $data);
}
if ($result === false) {
throw FilesystemException::createFromPhpError();
Expand Down Expand Up @@ -1420,22 +1465,22 @@ function realpath(string $path): string


/**
* Attempts to rename oldname to
* newname, moving it between directories if necessary.
* If renaming a file and newname exists,
* Attempts to rename from to
* to, moving it between directories if necessary.
* If renaming a file and to exists,
* it will be overwritten. If renaming a directory and
* newname exists,
* to exists,
* this function will emit a warning.
*
* @param string $oldname The old name.
* @param string $from The old name.
*
* The wrapper used in oldname
* The wrapper used in from
* must match the wrapper used in
* newname.
* @param string $newname The new name.
* to.
* @param string $to The new name.
*
*
* On Windows, if newname already exists, it must be writable.
* On Windows, if to already exists, it must be writable.
* Otherwise rename fails and issues E_WARNING.
*
*
Expand All @@ -1444,13 +1489,13 @@ function realpath(string $path): string
* @throws FilesystemException
*
*/
function rename(string $oldname, string $newname, $context = null): void
function rename(string $from, string $to, $context = null): void
{
error_clear_last();
if ($context !== null) {
$result = \rename($oldname, $newname, $context);
$result = \rename($from, $to, $context);
} else {
$result = \rename($oldname, $newname);
$result = \rename($from, $to);
}
if ($result === false) {
throw FilesystemException::createFromPhpError();
Expand Down Expand Up @@ -1573,29 +1618,29 @@ function tmpfile()
/**
* Attempts to set the access and modification times of the file named in the
* filename parameter to the value given in
* time.
* mtime.
* Note that the access time is always modified, regardless of the number
* of parameters.
*
* If the file does not exist, it will be created.
*
* @param string $filename The name of the file being touched.
* @param int $time The touch time. If time is not supplied,
* @param int $mtime The touch time. If mtime is NULL,
* the current system time is used.
* @param int $atime If present, the access time of the given filename is set to
* @param int $atime If NULL, the access time of the given filename is set to
* the value of atime. Otherwise, it is set to
* the value passed to the time parameter.
* If neither are present, the current system time is used.
* the value passed to the mtime parameter.
* If both are NULL, the current system time is used.
* @throws FilesystemException
*
*/
function touch(string $filename, int $time = null, int $atime = null): void
function touch(string $filename, int $mtime = null, int $atime = null): void
{
error_clear_last();
if ($atime !== null) {
$result = \touch($filename, $time, $atime);
} elseif ($time !== null) {
$result = \touch($filename, $time);
$result = \touch($filename, $mtime, $atime);
} elseif ($mtime !== null) {
$result = \touch($filename, $mtime);
} else {
$result = \touch($filename);
}
Expand Down
22 changes: 22 additions & 0 deletions generated/ftp.php
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,28 @@ function ftp_pwd($ftp): string
}


/**
* Sends an arbitrary command to the FTP server.
*
* @param resource $ftp An FTP\Connection instance.
* @param string $command The command to execute.
* @return array Returns the server's response as an array of strings.
* No parsing is performed on the response string, nor does
* ftp_raw determine if the command succeeded.
* @throws FtpException
*
*/
function ftp_raw($ftp, string $command): array
{
error_clear_last();
$result = \ftp_raw($ftp, $command);
if ($result === null) {
throw FtpException::createFromPhpError();
}
return $result;
}


/**
* ftp_rename renames a file or a directory on the FTP
* server.
Expand Down
Loading

0 comments on commit 18c0068

Please sign in to comment.