get rid of www/ in phar
This commit is contained in:
parent
3070f234b6
commit
e991f209bc
@ -9,17 +9,14 @@ if (!in_array('phar', stream_get_wrappers())
|
||||
|
||||
function mapUrls($path)
|
||||
{
|
||||
if (substr($path, 0, 5) !== '/www/') {
|
||||
return false;
|
||||
}
|
||||
$arMap = array(
|
||||
'/www/' => '/www/index.php',
|
||||
'/www/gsearch/' => '/www/gsearch/index.php',
|
||||
'/' => '/www/index.php',
|
||||
'/gsearch/' => '/www/gsearch/index.php',
|
||||
);
|
||||
if (isset($arMap[$path])) {
|
||||
return $arMap[$path];
|
||||
}
|
||||
return $path;
|
||||
return '/www' . $path;
|
||||
}
|
||||
|
||||
Phar::interceptFileFuncs();
|
||||
|
@ -74,6 +74,7 @@ class SemanticScuttle_Environment
|
||||
$_SERVER['PATH_TRANSLATED'],
|
||||
strpos($_SERVER['PATH_TRANSLATED'], $rootTmp)
|
||||
+ strlen($rootTmp)
|
||||
+ 4 /* strip "www/" */
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -330,7 +330,7 @@ class SemanticScuttle_EnvironmentTest extends PHPUnit_Framework_TestCase
|
||||
'PHAR_PATH_TRANSLATED' => '/home/cweiske/Dev/html/hosts/dist.bm.bogo/www/index.php',
|
||||
);
|
||||
$this->assertEquals(
|
||||
'//dist.bm.bogo/SemanticScuttle-0.98.X.phar/www/',
|
||||
'//dist.bm.bogo/SemanticScuttle-0.98.X.phar/',
|
||||
SemanticScuttle_Environment::getRoot()
|
||||
);
|
||||
}
|
||||
@ -352,7 +352,7 @@ class SemanticScuttle_EnvironmentTest extends PHPUnit_Framework_TestCase
|
||||
'PHAR_PATH_TRANSLATED' => '/home/cweiske/Dev/html/hosts/dist.bm.bogo/www/index.php/foo/bar/',
|
||||
);
|
||||
$this->assertEquals(
|
||||
'//dist.bm.bogo/SemanticScuttle-0.98.X.phar/www/',
|
||||
'//dist.bm.bogo/SemanticScuttle-0.98.X.phar/',
|
||||
SemanticScuttle_Environment::getRoot()
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user