Tests: chdir() and open() for PHP module.
These tests ensure optimizations in the chdir calls don't break SAPI semantics.
This commit is contained in:
19
test/php/cwd/index.php
Normal file
19
test/php/cwd/index.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
if (isset($_GET['chdir']) && $_GET['chdir'] != "") {
|
||||
if (!chdir($_GET['chdir'])) {
|
||||
echo "failure to chdir(" . $_GET['chdir'] . ")\n";
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
$opcache = -1;
|
||||
|
||||
if (function_exists('opcache_get_status')) {
|
||||
$opcache = opcache_get_status()->opcache_enabled;
|
||||
}
|
||||
|
||||
header('X-OPcache: ' . $opcache);
|
||||
|
||||
print(getcwd());
|
||||
?>
|
||||
1
test/php/cwd/subdir/index.php
Normal file
1
test/php/cwd/subdir/index.php
Normal file
@@ -0,0 +1 @@
|
||||
<?php print(getcwd()); ?>
|
||||
7
test/php/open/index.php
Normal file
7
test/php/open/index.php
Normal file
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
if (isset($_GET['chdir'])) {
|
||||
chdir($_GET['chdir']);
|
||||
}
|
||||
|
||||
echo file_get_contents('test.txt');
|
||||
?>
|
||||
1
test/php/open/test.txt
Normal file
1
test/php/open/test.txt
Normal file
@@ -0,0 +1 @@
|
||||
test
|
||||
Reference in New Issue
Block a user