Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F875343
PhabricatorShortSite.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
981 B
Referenced Files
None
Subscribers
None
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
(!
phutil_nonempty_string
(
$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
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Fri, May 30, 10:44 PM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
208920
Default Alt Text
PhabricatorShortSite.php (981 B)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment