Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F100875520
PhabricatorShortSite.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
Mon, Feb 3, 12:44
Size
965 B
Mime Type
text/x-php
Expires
Wed, Feb 5, 12:44 (1 d, 20 h)
Engine
blob
Format
Raw Data
Handle
24032975
Attached To
rPH Phabricator
PhabricatorShortSite.php
View Options
<?php
final
class
PhabricatorShortSite
extends
PhabricatorSite
{
public
function
getDescription
()
{
return
pht
(
'Serves shortened URLs.'
);
}
public
function
getPriority
()
{
return
2500
;
}
public
function
newSiteForRequest
(
AphrontRequest
$request
)
{
$host
=
$request
->
getHost
();
$uri
=
PhabricatorEnv
::
getEnvConfig
(
'phurl.short-uri'
);
if
(!
strlen
(
$uri
))
{
return
null
;
}
$phurl_installed
=
PhabricatorApplication
::
isClassInstalled
(
'PhabricatorPhurlApplication'
);
if
(!
$phurl_installed
)
{
return
false
;
}
if
(
$this
->
isHostMatch
(
$host
,
array
(
$uri
)))
{
return
new
PhabricatorShortSite
();
}
return
null
;
}
public
function
getRoutingMaps
()
{
$app
=
PhabricatorApplication
::
getByClass
(
'PhabricatorPhurlApplication'
);
$maps
=
array
();
$maps
[]
=
$this
->
newRoutingMap
()
->
setApplication
(
$app
)
->
setRoutes
(
$app
->
getShortRoutes
());
return
$maps
;
}
}
Event Timeline
Log In to Comment