Skip to content

Commit b0cf34a

Browse files
committed
Merge branch 'PHP-7.4'
2 parents bd21e20 + 8b5c351 commit b0cf34a

34 files changed

+53
-320
lines changed

ext/sockets/tests/socket_create_listen-nobind.phpt

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@ Test if socket_create_listen() returns false, when it cannot bind to the port.
55
if (!extension_loaded('sockets')) {
66
die('SKIP The sockets extension is not loaded.');
77
}
8-
$filename = __DIR__ . '/006_root_check.tmp';
8+
$filename = __FILE__ . '.root_check.tmp';
99
$fp = fopen($filename, 'w');
1010
fclose($fp);
1111
if (fileowner($filename) == 0) {
12-
unlink ($filename);
12+
unlink($filename);
1313
die('SKIP Test cannot be run as root.');
1414
}
15+
unlink($filename);
1516
if (@socket_create_listen(80)) {
1617
die('SKIP Test cannot be run in environment that will allow binding to port 80 (azure)');
1718
}
@@ -20,9 +21,6 @@ if (@socket_create_listen(80)) {
2021
$sock = socket_create_listen(80);
2122
--EXPECTF--
2223
Warning: socket_create_listen(): unable to bind to given address [13]: Permission denied in %s on line %d
23-
--CLEAN--
24-
<?php
25-
unlink(__DIR__ . '/006_root_check.tmp');
2624
--CREDITS--
2725
Till Klampaeckel, till@php.net
2826
PHP Testfest Berlin 2009-05-09

ext/sockets/tests/socket_set_option_error_socket_option.phpt

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,14 @@ if (!extension_loaded('sockets')) {
88
if (PHP_OS == 'Darwin') {
99
die('skip Not for OSX');
1010
}
11-
$filename = __DIR__ . '/006_root_check.tmp';
11+
$filename = __FILE__ . '.root_check.tmp';
1212
$fp = fopen($filename, 'w');
1313
fclose($fp);
1414
if (fileowner($filename) == 0) {
15-
unlink ($filename);
15+
unlink($filename);
1616
die('SKIP Test cannot be run as root.');
1717
}
18+
unlink($filename);
1819
?>
1920
--FILE--
2021
<?php
@@ -26,9 +27,6 @@ if (!$socket) {
2627
socket_set_option( $socket, SOL_SOCKET, 1, 1);
2728
socket_close($socket);
2829
?>
29-
--CLEAN--
30-
<?php
31-
unlink(__DIR__ . '/006_root_check.tmp');
3230
--EXPECTF--
3331
Warning: socket_set_option(): unable to set socket option [%d]: Permission denied in %s on line %d
3432
--CREDITS--

ext/standard/tests/dir/dir_variation3.phpt

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,7 @@ Test dir() function : usage variations - different directory permissions
55
if( substr(PHP_OS, 0, 3) == 'WIN') {
66
die('skip Not for Windows');
77
}
8-
// Skip if being run by root (files are always readable, writeable and executable)
9-
$filename = __DIR__."/dir_root_check.tmp";
10-
$fp = fopen($filename, 'w');
11-
fclose($fp);
12-
if(fileowner($filename) == 0) {
13-
unlink ($filename);
14-
die('skip...cannot be run as root\n');
15-
}
16-
unlink($filename);
8+
require __DIR__ . '/../skipif_root.inc';
179
?>
1810
--FILE--
1911
<?php

ext/standard/tests/dir/dir_variation7.phpt

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,7 @@ Test dir() function : usage variations - directories with restricted permissions
55
if( substr(PHP_OS, 0, 3) == 'WIN') {
66
die('skip Not for Windows');
77
}
8-
// Skip if being run by root (files are always readable, writeable and executable)
9-
$filename = __DIR__."/dir_root_check.tmp";
10-
$fp = fopen($filename, 'w');
11-
fclose($fp);
12-
if(fileowner($filename) == 0) {
13-
unlink ($filename);
14-
die('skip...cannot be run as root\n');
15-
}
16-
unlink($filename);
8+
require __DIR__ . '/../skipif_root.inc';
179
?>
1810
--FILE--
1911
<?php

ext/standard/tests/dir/opendir_variation5.phpt

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,7 @@ Test opendir() function : usage variations - directories with restricted permiss
55
if( substr(PHP_OS, 0, 3) == 'WIN') {
66
die('skip Not for Windows');
77
}
8-
// Skip if being run by root (files are always readable, writeable and executable)
9-
$filename = __DIR__."/dir_root_check.tmp";
10-
$fp = fopen($filename, 'w');
11-
fclose($fp);
12-
if(fileowner($filename) == 0) {
13-
unlink ($filename);
14-
die('skip...cannot be run as root\n');
15-
}
16-
unlink($filename);
8+
require __DIR__ . '/../skipif_root.inc';
179
?>
1810
--FILE--
1911
<?php

ext/standard/tests/dir/opendir_variation7.phpt

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,7 @@ Test opendir() function : usage variations - different directory permissions
55
if( substr(PHP_OS, 0, 3) == 'WIN') {
66
die('skip Not for Windows');
77
}
8-
// Skip if being run by root (files are always readable, writeable and executable)
9-
$filename = __DIR__ . "/opendir_root_check.tmp";
10-
$fp = fopen($filename, 'w');
11-
fclose($fp);
12-
if(fileowner($filename) == 0) {
13-
unlink ($filename);
14-
die('skip...cannot be run as root\n');
15-
}
16-
unlink($filename);
8+
require __DIR__ . '/../skipif_root.inc';
179
?>
1810
--FILE--
1911
<?php

ext/standard/tests/dir/readdir_variation5.phpt

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,7 @@ Test readdir() function : usage variations - different permissions
55
if( substr(PHP_OS, 0, 3) == 'WIN') {
66
die('skip Not for Windows');
77
}
8-
// Skip if being run by root (files are always readable, writeable and executable)
9-
$filename = __DIR__."/readdir_root_check.tmp";
10-
$fp = fopen($filename, 'w');
11-
fclose($fp);
12-
if(fileowner($filename) == 0) {
13-
unlink ($filename);
14-
die('skip...cannot be run as root\n');
15-
}
16-
unlink($filename);
8+
require __DIR__ . '/../skipif_root.inc';
179
?>
1810
--FILE--
1911
<?php

ext/standard/tests/dir/scandir_variation5.phpt

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,7 @@ Test scandir() function : usage variations - different directory permissions
55
if( substr(PHP_OS, 0, 3) == 'WIN') {
66
die('skip Not for Windows');
77
}
8-
// Skip if being run by root (files are always readable, writeable and executable)
9-
$filename = __DIR__."/dir_root_check.tmp";
10-
$fp = fopen($filename, 'w');
11-
fclose($fp);
12-
if(fileowner($filename) == 0) {
13-
unlink ($filename);
14-
die('skip...cannot be run as root\n');
15-
}
16-
unlink($filename);
8+
require __DIR__ . '/../skipif_root.inc';
179
?>
1810
--FILE--
1911
<?php

ext/standard/tests/dir/scandir_variation7.phpt

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,7 @@ Test scandir() function : usage variations - different directory permissions
55
if( substr(PHP_OS, 0, 3) == 'WIN') {
66
die('skip Not for Windows');
77
}
8-
// Skip if being run by root (files are always readable, writeable and executable)
9-
$filename = __DIR__ . "/dir_root_check.tmp";
10-
$fp = fopen($filename, 'w');
11-
fclose($fp);
12-
if(fileowner($filename) == 0) {
13-
unlink ($filename);
14-
die('skip...cannot be run as root\n');
15-
}
16-
unlink($filename);
8+
require __DIR__ . '/../skipif_root.inc';
179
?>
1810
--FILE--
1911
<?php

ext/standard/tests/file/006_basic.phpt

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,7 @@ Test fileperms() & chmod() functions: basic functionality
55
if (substr(PHP_OS, 0, 3) == 'WIN') {
66
die('skip Not on Windows');
77
}
8-
// Skip if being run by root
9-
$filename = __DIR__."/006_root_check.tmp";
10-
$fp = fopen($filename, 'w');
11-
fclose($fp);
12-
if(fileowner($filename) == 0) {
13-
unlink ($filename);
14-
die('skip cannot be run as root');
15-
}
16-
17-
unlink($filename);
18-
8+
require __DIR__ . '/../skipif_root.inc';
199
?>
2010
--FILE--
2111
<?php

ext/standard/tests/file/006_error.phpt

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,7 @@ Test fileperms(), chmod() functions: error conditions
55
if (substr(PHP_OS, 0, 3) == 'WIN') {
66
die('skip Not on Windows');
77
}
8-
// Skip if being run by root
9-
$filename = __DIR__."/006_root_check.tmp";
10-
$fp = fopen($filename, 'w');
11-
fclose($fp);
12-
if(fileowner($filename) == 0) {
13-
unlink ($filename);
14-
die('skip cannot be run as root');
15-
}
16-
17-
unlink($filename);
18-
8+
require __DIR__ . '/../skipif_root.inc';
199
?>
2010
--FILE--
2111
<?php

ext/standard/tests/file/006_variation1.phpt

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,7 @@ Test fileperms() & chmod() functions: usage variation - perms(0000-0777)
55
if (substr(PHP_OS, 0, 3) == 'WIN') {
66
die('skip Not on Windows');
77
}
8-
// Skip if being run by root
9-
$filename = __DIR__."/006_root_check.tmp";
10-
$fp = fopen($filename, 'w');
11-
fclose($fp);
12-
if(fileowner($filename) == 0) {
13-
unlink ($filename);
14-
die('skip cannot be run as root');
15-
}
16-
17-
unlink($filename);
18-
8+
require __DIR__ . '/../skipif_root.inc';
199
?>
2010
--FILE--
2111
<?php

ext/standard/tests/file/006_variation2.phpt

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,7 @@ Test fileperms() & chmod() functions: usage variation - misc. perms
55
if (substr(PHP_OS, 0, 3) == 'WIN') {
66
die('skip Not on Windows');
77
}
8-
// Skip if being run by root
9-
$filename = __DIR__."/006_root_check.tmp";
10-
$fp = fopen($filename, 'w');
11-
fclose($fp);
12-
if(fileowner($filename) == 0) {
13-
unlink ($filename);
14-
die('skip cannot be run as root');
15-
}
16-
17-
unlink($filename);
18-
8+
require __DIR__ . '/../skipif_root.inc';
199
?>
2010
--FILE--
2111
<?php

ext/standard/tests/file/copy_variation15.phpt

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,7 @@ Test copy() function: usage variations - destination dir access perms
44
<?php
55
if(substr(PHP_OS, 0, 3) == 'WIN')
66
die("skip do not run on Windows");
7-
// Skip if being run by root (files are always readable, writeable and executable)
8-
$filename = __DIR__."/copy_variation15_root_check.tmp";
9-
$fp = fopen($filename, 'w');
10-
fclose($fp);
11-
if(fileowner($filename) == 0) {
12-
unlink ($filename);
13-
die('skip cannot be run as root');
14-
}
15-
unlink($filename);
7+
require __DIR__ . '/../skipif_root.inc';
168
?>
179
--FILE--
1810
<?php

ext/standard/tests/file/copy_variation9.phpt

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,7 @@ Test copy() function: usage variations - destination file access perms
44
<?php
55
if(substr(PHP_OS, 0, 3) == 'WIN')
66
die("skip do not run on Windows");
7-
8-
// Skip if being run by root (files are always readable, writeable and executable)
9-
$filename = __DIR__."/copy_variation9_root_check.tmp";
10-
$fp = fopen($filename, 'w');
11-
fclose($fp);
12-
if(fileowner($filename) == 0) {
13-
unlink ($filename);
14-
die('skip cannot be run as root');
15-
}
16-
unlink($filename);
7+
require __DIR__ . '/../skipif_root.inc';
178
?>
189
--FILE--
1910
<?php

ext/standard/tests/file/is_executable_basic.phpt

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,7 @@ Test is_executable() function: basic functionality
55
if (substr(PHP_OS, 0, 3) == 'WIN') {
66
die('skip not for windows');
77
}
8-
// Skip if being run by root (files are always readable, writeable and executable)
9-
$filename = __DIR__."/is_executable_basic_root_check.tmp";
10-
$fp = fopen($filename, 'w');
11-
fclose($fp);
12-
if(fileowner($filename) == 0) {
13-
unlink ($filename);
14-
die('skip cannot be run as root');
15-
}
16-
17-
unlink($filename);
8+
require __DIR__ . '/../skipif_root.inc';
189
?>
1910
--FILE--
2011
<?php

ext/standard/tests/file/is_executable_variation2.phpt

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,7 @@ Test is_executable() function: usage variations - file/dir with diff. perms
55
if (substr(PHP_OS, 0, 3) == 'WIN') {
66
die('skip not for windows');
77
}
8-
// Skip if being run by root
9-
$filename = __DIR__."/is_executable_variation2_root_check.tmp";
10-
$fp = fopen($filename, 'w');
11-
fclose($fp);
12-
if(fileowner($filename) == 0) {
13-
unlink ($filename);
14-
die('skip cannot be run as root');
15-
}
16-
17-
unlink($filename);
8+
require __DIR__ . '/../skipif_root.inc';
189
?>
1910
--FILE--
2011
<?php

ext/standard/tests/file/is_executable_variation3.phpt

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,7 @@ Test is_executable() function: usage variations - invalid file names
55
if (substr(PHP_OS, 0, 3) == 'WIN') {
66
die('skip not for windows');
77
}
8-
// Skip if being run by root (files are always readable, writeable and executable)
9-
$filename = __DIR__."/is_executable_root_check.tmp";
10-
$fp = fopen($filename, 'w');
11-
fclose($fp);
12-
if(fileowner($filename) == 0) {
13-
unlink ($filename);
14-
die('skip cannot be run as root');
15-
}
16-
17-
unlink($filename);
8+
require __DIR__ . '/../skipif_root.inc';
189
?>
1910
--FILE--
2011
<?php

ext/standard/tests/file/is_readable_basic.phpt

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,7 @@ Test is_readable() function: basic functionality
55
if (substr(PHP_OS, 0, 3) == 'WIN') {
66
die('skip not for windows');
77
}
8-
// Skip if being run by root (files are always readable, writeable and executable)
9-
$filename = __DIR__."/is_readable_basic_root_check.tmp";
10-
$fp = fopen($filename, 'w');
11-
fclose($fp);
12-
if(fileowner($filename) == 0) {
13-
unlink ($filename);
14-
die('skip cannot be run as root');
15-
}
16-
17-
unlink($filename);
8+
require __DIR__ . '/../skipif_root.inc';
189
?>
1910
--FILE--
2011
<?php

ext/standard/tests/file/is_readable_variation1.phpt

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,7 @@
22
Test is_readable() function: usage variations - diff. file notations
33
--SKIPIF--
44
<?php
5-
if (substr(PHP_OS, 0, 3) != 'WIN') {
6-
// Skip if being run by root (files are always readable, writeable and executable)
7-
$filename = __DIR__."/is_readable_variation1_root_check.tmp";
8-
$fp = fopen($filename, 'w');
9-
fclose($fp);
10-
if(fileowner($filename) == 0) {
11-
unlink ($filename);
12-
die('skip cannot be run as root');
13-
}
14-
unlink($filename);
15-
}
5+
require __DIR__ . '/../skipif_root.inc';
166
?>
177
--FILE--
188
<?php

ext/standard/tests/file/is_readable_variation2.phpt

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,7 @@ Test is_readable() function: usage variations - file/dir with diff. perms
55
if (substr(PHP_OS, 0, 3) == 'WIN') {
66
die('skip not for windows');
77
}
8-
// Skip if being run by root
9-
$filename = __DIR__."/is_readable_variation2_root_check.tmp";
10-
$fp = fopen($filename, 'w');
11-
fclose($fp);
12-
if(fileowner($filename) == 0) {
13-
unlink ($filename);
14-
die('skip cannot be run as root');
15-
}
16-
unlink($filename);
8+
require __DIR__ . '/../skipif_root.inc';
179
?>
1810
--FILE--
1911
<?php

0 commit comments

Comments
 (0)