Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F99470000
AphrontSite.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Jan 24, 20:29
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Jan 26, 20:29 (2 d)
Engine
blob
Format
Raw Data
Handle
23807883
Attached To
rPH Phabricator
AphrontSite.php
View Options
<?php
abstract
class
AphrontSite
extends
Phobject
{
abstract
public
function
getPriority
();
abstract
public
function
getDescription
();
abstract
public
function
shouldRequireHTTPS
();
abstract
public
function
newSiteForRequest
(
AphrontRequest
$request
);
/**
* NOTE: This is temporary glue; eventually, sites will return an entire
* route map.
*/
public
function
getPathForRouting
(
AphrontRequest
$request
)
{
return
$request
->
getPath
();
}
protected
function
isHostMatch
(
$host
,
array
$uris
)
{
foreach
(
$uris
as
$uri
)
{
if
(!
strlen
(
$uri
))
{
continue
;
}
$domain
=
id
(
new
PhutilURI
(
$uri
))->
getDomain
();
if
(
$domain
===
$host
)
{
return
true
;
}
}
return
false
;
}
protected
function
isPathPrefixMatch
(
$path
,
array
$paths
)
{
foreach
(
$paths
as
$candidate
)
{
if
(
strncmp
(
$path
,
$candidate
,
strlen
(
$candidate
))
===
0
)
{
return
true
;
}
}
return
false
;
}
final
public
static
function
getAllSites
()
{
return
id
(
new
PhutilClassMapQuery
())
->
setAncestorClass
(
__CLASS__
)
->
setSortMethod
(
'getPriority'
)
->
execute
();
}
}
Event Timeline
Log In to Comment