Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/aphront/site/AphrontSite.php
13395 views
1
<?php
2
3
abstract class AphrontSite extends Phobject {
4
5
abstract public function getPriority();
6
abstract public function getDescription();
7
8
abstract public function shouldRequireHTTPS();
9
abstract public function newSiteForRequest(AphrontRequest $request);
10
abstract public function getRoutingMaps();
11
12
public function new404Controller(AphrontRequest $request) {
13
return new Phabricator404Controller();
14
}
15
16
protected function isHostMatch($host, array $uris) {
17
foreach ($uris as $uri) {
18
if (!strlen($uri)) {
19
continue;
20
}
21
22
$domain = id(new PhutilURI($uri))->getDomain();
23
24
if ($domain === $host) {
25
return true;
26
}
27
}
28
29
return false;
30
}
31
32
protected function newRoutingMap() {
33
return id(new AphrontRoutingMap())
34
->setSite($this);
35
}
36
37
final public static function getAllSites() {
38
return id(new PhutilClassMapQuery())
39
->setAncestorClass(__CLASS__)
40
->setSortMethod('getPriority')
41
->execute();
42
}
43
44
}
45
46