Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F637899
PhabricatorPlatformSite.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
PhabricatorPlatformSite.php
View Options
<?php
final
class
PhabricatorPlatformSite
extends
PhabricatorSite
{
public
function
getDescription
()
{
return
pht
(
'Serves the core platform and applications.'
);
}
public
function
getPriority
()
{
return
1000
;
}
public
function
newSiteForRequest
(
AphrontRequest
$request
)
{
// If no base URI has been configured yet, match this site so the user
// can follow setup instructions.
$base_uri
=
PhabricatorEnv
::
getEnvConfig
(
'phabricator.base-uri'
);
if
(!
phutil_nonempty_string
(
$base_uri
))
{
return
new
PhabricatorPlatformSite
();
}
$uris
=
array
();
$uris
[]
=
$base_uri
;
$uris
[]
=
PhabricatorEnv
::
getEnvConfig
(
'phabricator.production-uri'
);
$allowed
=
PhabricatorEnv
::
getEnvConfig
(
'phabricator.allowed-uris'
);
if
(
$allowed
)
{
foreach
(
$allowed
as
$uri
)
{
$uris
[]
=
$uri
;
}
}
$host
=
$request
->
getHost
();
if
(
$this
->
isHostMatch
(
$host
,
$uris
))
{
return
new
PhabricatorPlatformSite
();
}
return
null
;
}
public
function
getRoutingMaps
()
{
$applications
=
PhabricatorApplication
::
getAllInstalledApplications
();
$maps
=
array
();
foreach
(
$applications
as
$application
)
{
$maps
[]
=
$this
->
newRoutingMap
()
->
setApplication
(
$application
)
->
setRoutes
(
$application
->
getRoutes
());
}
return
$maps
;
}
public
function
new404Controller
(
AphrontRequest
$request
)
{
return
new
PhabricatorPlatform404Controller
();
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Wed, May 14, 4:20 PM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
110773
Default Alt Text
PhabricatorPlatformSite.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment