mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-13 10:22:42 +01:00
c728c0ac60
Summary: Ref T5702. This primarily gets URI routing out of Aphront and into an Application, for consistency. Test Plan: Loaded some pages, got static resources. Reviewers: chad, btrahan Reviewed By: btrahan Subscribers: epriestley Maniphest Tasks: T5702 Differential Revision: https://secure.phabricator.com/D10696
32 lines
713 B
PHP
32 lines
713 B
PHP
<?php
|
|
|
|
final class CelerityResourceGraph extends AbstractDirectedGraph {
|
|
|
|
private $resourceGraph = array();
|
|
private $graphSet = false;
|
|
|
|
protected function loadEdges(array $nodes) {
|
|
if (!$this->graphSet) {
|
|
throw new Exception(
|
|
'Call setResourceGraph before loading the graph!'
|
|
);
|
|
}
|
|
|
|
$graph = $this->getResourceGraph();
|
|
$edges = array();
|
|
foreach ($nodes as $node) {
|
|
$edges[$node] = idx($graph, $node, array());
|
|
}
|
|
return $edges;
|
|
}
|
|
|
|
final public function setResourceGraph(array $graph) {
|
|
$this->resourceGraph = $graph;
|
|
$this->graphSet = true;
|
|
return $this;
|
|
}
|
|
|
|
private function getResourceGraph() {
|
|
return $this->resourceGraph;
|
|
}
|
|
}
|