1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-22 10:18:48 +02:00
phorge-phorge/src/applications/celerity/CelerityResourceGraph.php
epriestley c728c0ac60 Make Celerity a real application
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
2014-10-13 11:17:23 -07:00

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;
}
}