Skip to content

Commit 54de5d9

Browse files
committed
Merge remote-tracking branch 'off/PHP-8.0' into win_ci.cipush
2 parents 4955ab1 + 722e9b9 commit 54de5d9

File tree

11 files changed

+74
-35
lines changed

11 files changed

+74
-35
lines changed

NEWS

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@ PHP NEWS
55
- Core:
66
. Fixed Haiku ZTS builds. (David Carlier)
77

8+
- FPM:
9+
. Fixed ACL build check on MacOS. (David Carlier)
10+
11+
- SPL:
12+
. Fixed bug GH-8235 (iterator_count() may run indefinitely). (cmb)
13+
14+
- Zip:
15+
. Fixed type for index in ZipArchive::replaceFile. (Martin Rehberger)
16+
817
12 May 2022, PHP 8.0.19
918

1019
- Core:

ext/curl/tests/curl_basic_007.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ curl_close($ch);
2020

2121
?>
2222
--EXPECTF--
23-
string(%d) "No URL set!%w"
23+
string(%d) "No URL set%A"
2424
int(3)

ext/pdo_mysql/tests/pdo_mysql___construct_uri.phpt

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,9 @@ MySQLPDOTest::skip();
1818
$dsn = MySQLPDOTest::getDSN();
1919
$user = PDO_MYSQL_TEST_USER;
2020
$pass = PDO_MYSQL_TEST_PASS;
21-
$uri = sprintf('uri:file://%s', (substr(PHP_OS, 0, 3) == 'WIN' ? str_replace('\\', '/', $file) : $file));
21+
$uri = 'uri:file://' . $file;
2222

2323
if ($fp = @fopen($file, 'w')) {
24-
// ok, great we can create a file with a DSN in it
2524
fwrite($fp, $dsn);
2625
fclose($fp);
2726
clearstatcache();
@@ -38,31 +37,23 @@ MySQLPDOTest::skip();
3837
}
3938

4039
if ($fp = @fopen($file, 'w')) {
41-
fwrite($fp, sprintf('mysql:dbname=letshopeinvalid;%s%s',
42-
chr(0), $dsn));
40+
fwrite($fp, $dsn . chr(0) . ';host=nonsense;unix_socket=nonsense');
4341
fclose($fp);
4442
clearstatcache();
4543
assert(file_exists($file));
4644
try {
4745
$db = new PDO($uri, $user, $pass);
4846
} catch (PDOException $e) {
49-
$expected = array(
50-
"SQLSTATE[HY000] [1049] Unknown database 'letshopeinvalid'",
51-
"SQLSTATE[42000] [1049] Unknown database 'letshopeinvalid'",
52-
"SQLSTATE[HY000] [2002] No such file or directory"
53-
);
54-
printf("[003] URI=%s, DSN=%s, File=%s (%d bytes, '%s'), chr(0) test, %s\n",
55-
$uri, $dsn,
56-
$file, filesize($file), file_get_contents($file),
57-
(in_array($e->getMessage(), $expected) ? 'EXPECTED ERROR' : $e->getMessage()));
47+
printf("[003] URI=%s, DSN=%s, File=%s (%d bytes, '%s'), %s\n",
48+
$uri, $dsn,
49+
$file, filesize($file), file_get_contents($file),
50+
$e->getMessage());
5851
}
5952
unlink($file);
6053
}
6154

6255
}
6356

64-
/* TODO: safe mode */
65-
6657
} catch (PDOException $e) {
6758
printf("[001] %s, [%s] %s\n",
6859
$e->getMessage(),
@@ -73,5 +64,4 @@ MySQLPDOTest::skip();
7364
print "done!";
7465
?>
7566
--EXPECTF--
76-
[003] URI=uri:file://%spdomuri.tst, DSN=mysql%sdbname=%s, File=%spdomuri.tst (%d bytes, 'mysql%sdbname=letshopeinvalid%s'), chr(0) test, EXPECTED ERROR
7767
done!

ext/phar/tests/fatal_error_webphar.phpt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
--TEST--
22
Phar web-based phar with fatal error
3-
--XFAIL--
4-
Uses no longer supported __autoload() function, new phar needed
53
--INI--
64
default_charset=UTF-8
75
--SKIPIF--
@@ -15,7 +13,6 @@ files/pear2coverage.phar
1513
--EXPECTHEADERS--
1614
Content-type: text/html; charset=UTF-8
1715
--EXPECTF--
18-
Deprecated: __autoload() is deprecated, use spl_autoload_register() instead in %s on line %d
1916
string(9) "\Web\View"
2017

2118
Parse error: syntax error, unexpected %s, expecting %s in phar://%r([A-Za-z]:)?%r/%sfatal_error_webphar.php/Web/View.php on line 380
14 Bytes
Binary file not shown.

ext/spl/spl_iterators.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3157,6 +3157,9 @@ PHP_FUNCTION(iterator_to_array)
31573157

31583158
static int spl_iterator_count_apply(zend_object_iterator *iter, void *puser) /* {{{ */
31593159
{
3160+
if (UNEXPECTED(*(zend_long*)puser == ZEND_LONG_MAX)) {
3161+
return ZEND_HASH_APPLY_STOP;
3162+
}
31603163
(*(zend_long*)puser)++;
31613164
return ZEND_HASH_APPLY_KEEP;
31623165
}

ext/zip/php_zip.stub.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public function addFromString(string $name, string $content, int $flags = ZipArc
9191
public function addFile(string $filepath, string $entryname = "", int $start = 0, int $length = 0, int $flags = ZipArchive::FL_OVERWRITE) {}
9292

9393
/** @return bool */
94-
public function replaceFile(string $filepath, string $index, int $start = 0, int $length = 0, int $flags = 0) {}
94+
public function replaceFile(string $filepath, int $index, int $start = 0, int $length = 0, int $flags = 0) {}
9595

9696
/** @return array|false */
9797
public function addGlob(string $pattern, int $flags = 0, array $options = []) {}

ext/zip/php_zip_arginfo.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 095084d2a2df557398191af5dd6c8bea6bb7c338 */
2+
* Stub hash: 5ebaf48b6736126648a981f5bbb25b0bf46dc22a */
33

44
ZEND_BEGIN_ARG_INFO_EX(arginfo_zip_open, 0, 0, 1)
55
ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0)
@@ -77,7 +77,7 @@ ZEND_END_ARG_INFO()
7777

7878
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ZipArchive_replaceFile, 0, 0, 2)
7979
ZEND_ARG_TYPE_INFO(0, filepath, IS_STRING, 0)
80-
ZEND_ARG_TYPE_INFO(0, index, IS_STRING, 0)
80+
ZEND_ARG_TYPE_INFO(0, index, IS_LONG, 0)
8181
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, start, IS_LONG, 0, "0")
8282
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 0, "0")
8383
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0")

sapi/fpm/config.m4

Lines changed: 50 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -555,18 +555,57 @@ if test "$PHP_FPM" != "no"; then
555555
fi
556556

557557
if test "$PHP_FPM_ACL" != "no" ; then
558+
AC_MSG_CHECKING([for acl user/group permissions support])
558559
AC_CHECK_HEADERS([sys/acl.h])
559-
dnl *BSD has acl_* built into libc.
560-
AC_CHECK_FUNC(acl_free, [
561-
AC_DEFINE(HAVE_FPM_ACL, 1, [ POSIX Access Control List ])
562-
],[
563-
AC_CHECK_LIB(acl, acl_free, [
564-
PHP_ADD_LIBRARY(acl)
565-
AC_DEFINE(HAVE_FPM_ACL, 1, [ POSIX Access Control List ])
566-
],[
567-
AC_MSG_ERROR(libacl required not found)
568-
])
569-
])
560+
561+
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <sys/acl.h>
562+
int main()
563+
{
564+
acl_t acl;
565+
acl_entry_t user, group;
566+
acl = acl_init(1);
567+
acl_create_entry(&acl, &user);
568+
acl_set_tag_type(user, ACL_USER);
569+
acl_create_entry(&acl, &group);
570+
acl_set_tag_type(user, ACL_GROUP);
571+
acl_free(acl);
572+
return 0;
573+
}
574+
]])], [
575+
AC_CHECK_LIB(acl, acl_free,
576+
[PHP_ADD_LIBRARY(acl)
577+
have_fpm_acl=yes
578+
AC_MSG_RESULT([yes])
579+
],[
580+
AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <sys/acl.h>
581+
int main()
582+
{
583+
acl_t acl;
584+
acl_entry_t user, group;
585+
acl = acl_init(1);
586+
acl_create_entry(&acl, &user);
587+
acl_set_tag_type(user, ACL_USER);
588+
acl_create_entry(&acl, &group);
589+
acl_set_tag_type(user, ACL_GROUP);
590+
acl_free(acl);
591+
return 0;
592+
}
593+
]])], [
594+
have_fpm_acl=yes
595+
AC_MSG_RESULT([yes])
596+
], [
597+
have_fpm_acl=no
598+
AC_MSG_RESULT([no])
599+
], [AC_MSG_RESULT([skipped])])
600+
])
601+
], [
602+
have_fpm_acl=no
603+
AC_MSG_RESULT([no])
604+
], [AC_MSG_RESULT([skipped (cross-compiling)])])
605+
606+
if test "$have_fpm_acl" = "yes"; then
607+
AC_DEFINE([HAVE_FPM_ACL], 1, [do we have acl support?])
608+
fi
570609
fi
571610

572611
if test "x$PHP_FPM_APPARMOR" != "xno" ; then

sapi/fpm/tests/bug77023-pm-dynamic-blocking-sigquit.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ pcntl
66
<?php
77
include "skipif.inc";
88
if (!function_exists('pcntl_sigprocmask')) die('skip Requires pcntl_sigprocmask()');
9+
if (!getenv("FPM_RUN_RESOURCE_HEAVY_TESTS")) die("skip resource heavy test");
910
if (getenv('SKIP_SLOW_TESTS')) die('skip slow tests excluded by request');
1011
?>
1112
--FILE--

sapi/fpm/tests/proc-idle-timeout.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ FPM: Process manager config pm.process_idle_timeout
33
--SKIPIF--
44
<?php
55
include "skipif.inc";
6+
if (!getenv("FPM_RUN_RESOURCE_HEAVY_TESTS")) die("skip resource heavy test");
67
if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
7-
if (!getenv("FPM_LOCAL_TESTS")) die("skip local test")
88
?>
99
--FILE--
1010
<?php

0 commit comments

Comments
 (0)