26 lines
868 B
PHP
26 lines
868 B
PHP
--TEST--
|
|||
|
|
cac_path_parity: rewrites the configured prefix on a filesystem $_SERVER key
|
||
|
|
--EXTENSIONS--
|
||
|
|
cac_path_parity
|
||
|
|
--INI--
|
||
|
|
cac_path_parity.from=/mnt/users/bob/site.com
|
||
|
|
cac_path_parity.to=/home/bob
|
||
|
|
variables_order=EGPCS
|
||
|
|
--ENV--
|
||
|
|
CONTEXT_DOCUMENT_ROOT=/mnt/users/bob/site.com/public_html
|
||
|
|
HTTP_HOST=site.com
|
||
|
|
--FILE--
|
||
|
|
<?php
|
||
|
|
// NOTE: the CLI SAPI overwrites DOCUMENT_ROOT (to "") and SCRIPT_FILENAME /
|
||
|
|
// PATH_TRANSLATED (to the script path) AFTER the env import, so those three
|
||
|
|
// cannot be driven from --ENV-- here. They go through the identical code path
|
||
|
|
// as CONTEXT_DOCUMENT_ROOT (one loop over one key table); the real web-SAPI
|
||
|
|
// proof for them is tests/web-sapi-parity-check.sh.
|
||
|
|
var_dump($_SERVER['CONTEXT_DOCUMENT_ROOT']);
|
||
|
|
// Non-path vars must be untouched.
|
||
|
|
var_dump($_SERVER['HTTP_HOST']);
|
||
|
|
?>
|
||
|
|
--EXPECT--
|
||
|
|
string(21) "/home/bob/public_html"
|
||
|
|
string(8) "site.com"
|