zhanjh / minify

Automatically exported from code.google.com/p/minify
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

use SCRIPT_FILENAME rather than PATH_TRANSLATED #162

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Minify version: 2.1.3
PHP version: 5.2.12

/min/config.php line 59
$min_documentRoot = '';

/min/index.php line 26
if ($min_documentRoot) {
    $_SERVER['DOCUMENT_ROOT'] = $min_documentRoot;
} elseif (0 === stripos(PHP_OS, 'win')) {
    Minify::setDocRoot(); // IIS may need help
}

/min/lib/Minify.php line 366
public static function setDocRoot($unsetPathInfo = false)
{
    if (isset($_SERVER['SERVER_SOFTWARE'])
        && 0 === strpos($_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS/')
    ) {
        $_SERVER['DOCUMENT_ROOT'] = rtrim(substr(
            $_SERVER['PATH_TRANSLATED']
            ,0
            ,strlen($_SERVER['PATH_TRANSLATED']) -
strlen($_SERVER['SCRIPT_NAME'])
        ), '\\');
        if ($unsetPathInfo) {
            unset($_SERVER['PATH_INFO']);
        }
        require_once 'Minify/Logger.php';
        Minify_Logger::log("setDocRoot() set DOCUMENT_ROOT to
\"{$_SERVER['DOCUMENT_ROOT']}\"");
    }
}

FastCGI
_SERVER["DOCUMENT_ROOT"] C:\wwwroot
_SERVER["PATH_TRANSLATED"] C:\wwwroot\test\phpinfo.php
_SERVER["SCRIPT_NAME"] /test/phpinfo.php
_SERVER["SCRIPT_FILENAME"] C:\wwwroot\test\phpinfo.php
[PHP_SAPI] => cgi-fcgi

ISAPI
_SERVER["DOCUMENT_ROOT"] C:\wwwroot
_SERVER["PATH_TRANSLATED"] C:\wwwroot
_SERVER["SCRIPT_NAME"] /test/phpinfo.php
_SERVER["SCRIPT_FILENAME"] C:\wwwroot\test\phpinfo.php
[PHP_SAPI] => isapi

Original issue reported on code.google.com by chihwen....@gmail.com on 10 Feb 2010 at 7:21

GoogleCodeExporter commented 9 years ago
And you're sure this is OK in IIS5/6?

Original comment by mrclay....@gmail.com on 20 Feb 2010 at 7:55

GoogleCodeExporter commented 9 years ago
Yes, I'm sure that is OK in IIS5/6.

Original comment by chihwen....@gmail.com on 21 Feb 2010 at 1:55

GoogleCodeExporter commented 9 years ago

Original comment by mrclay....@gmail.com on 22 Feb 2010 at 2:40

GoogleCodeExporter commented 9 years ago
In R411 and will be in next release.

Original comment by mrclay....@gmail.com on 9 May 2010 at 4:50