mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-28 09:42:41 +01:00
d8c11a2106
Summary: Ref T4222. This fixes some issues with Phame's resource construction. Phame requires a fully virtual resource source, and since I want to run wordpress templates unmodified some day I don't want to build resource maps for skins. Move all the stuff that depends on resource lists being discoverable at build time to `CelerityPhysicalResources`, and only generate maps for subclasses. The root `CelerityResources` can now construct virtual resources; construct a virtual resource for Phame and use it. Test Plan: Off-domain blogs work correctly now. On-domain blogs with custom skins work correctly now. Reviewers: btrahan, hach-que Reviewed By: hach-que CC: aran Maniphest Tasks: T4222 Differential Revision: https://secure.phabricator.com/D7873
28 lines
545 B
PHP
28 lines
545 B
PHP
<?php
|
|
|
|
/**
|
|
* Defines Phabricator's static resources.
|
|
*/
|
|
final class PhameCelerityResources extends CelerityResources {
|
|
|
|
private $skin;
|
|
|
|
public function setSkin($skin) {
|
|
$this->skin = $skin;
|
|
return $this;
|
|
}
|
|
|
|
public function getSkin() {
|
|
return $this->skin;
|
|
}
|
|
|
|
public function getName() {
|
|
return 'phame:'.$this->getSkin()->getName();
|
|
}
|
|
|
|
public function getResourceData($name) {
|
|
$resource_path = $this->skin->getRootDirectory().DIRECTORY_SEPARATOR.$name;
|
|
return Filesystem::readFile($resource_path);
|
|
}
|
|
|
|
}
|