mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-18 19:40:55 +01:00
Point the Phabricator resource map back to webroot/, not webroot/rsrc/
Summary: Ref T4222. Earlier, I adjusted the root from `webroot/` to `webroot/rsrc/`. However, this means that all the `/rsrc/x/y/z.jpg` fragments in CSS are no longer recognized as resource names. Since we have like 9,000 things in CSS that do `url(/rsrc/xyz.jpg)` and I don't want to fix/test them all, so just make them work as-is. There's no real reason either setting is better than the other. (Both URLs also work fine, but the parsed one will be better once we have real CDN support.) Test Plan: Verified CSS gets managed resource URIs transformed into it. Reviewers: btrahan, hach-que Reviewed By: hach-que CC: aran Maniphest Tasks: T4222 Differential Revision: https://secure.phabricator.com/D7875
This commit is contained in:
parent
5173b4954d
commit
73e88bb101
3 changed files with 1852 additions and 1840 deletions
File diff suppressed because it is too large
Load diff
|
@ -112,14 +112,26 @@ final class CelerityResourceTransformer {
|
|||
public function translateResourceURI(array $matches) {
|
||||
$uri = trim($matches[1], "'\" \r\t\n");
|
||||
|
||||
if ($this->rawURIMap !== null) {
|
||||
if (isset($this->rawURIMap[$uri])) {
|
||||
$uri = $this->rawURIMap[$uri];
|
||||
$alternatives = array_unique(
|
||||
array(
|
||||
$uri,
|
||||
ltrim($uri, '/'),
|
||||
));
|
||||
|
||||
foreach ($alternatives as $alternative) {
|
||||
if ($this->rawURIMap !== null) {
|
||||
if (isset($this->rawURIMap[$alternative])) {
|
||||
$uri = $this->rawURIMap[$alternative];
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if ($this->celerityMap) {
|
||||
$resource_uri = $this->celerityMap->getURIForName($uri);
|
||||
if ($resource_uri) {
|
||||
$uri = $resource_uri;
|
||||
|
||||
if ($this->celerityMap) {
|
||||
$resource_uri = $this->celerityMap->getURIForName($alternative);
|
||||
if ($resource_uri) {
|
||||
$uri = $resource_uri;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ final class CelerityPhabricatorResources extends CelerityResourcesOnDisk {
|
|||
}
|
||||
|
||||
public function getPathToResources() {
|
||||
return $this->getPhabricatorPath('webroot/rsrc/');
|
||||
return $this->getPhabricatorPath('webroot/');
|
||||
}
|
||||
|
||||
public function getPathToMap() {
|
||||
|
|
Loading…
Reference in a new issue