Page Menu
Home
GnuPG
Search
Configure Global Search
Log In
Files
F35155984
CelerityPhabricatorResourceController.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Size
1 KB
Subscribers
None
CelerityPhabricatorResourceController.php
View Options
<?php
/**
* Delivers CSS and JS resources to the browser. This controller handles all
* ##/res/## requests, and manages caching, package construction, and resource
* preprocessing.
*
* @group celerity
*/
final
class
CelerityPhabricatorResourceController
extends
CelerityResourceController
{
private
$path
;
private
$hash
;
public
function
getCelerityResourceMap
()
{
return
CelerityResourceMap
::
getNamedInstance
(
'phabricator'
);
}
public
function
willProcessRequest
(
array
$data
)
{
$this
->
path
=
$data
[
'path'
];
$this
->
hash
=
$data
[
'hash'
];
}
public
function
processRequest
()
{
return
$this
->
serveResource
(
$this
->
path
);
}
protected
function
buildResourceTransformer
()
{
$minify_on
=
PhabricatorEnv
::
getEnvConfig
(
'celerity.minify'
);
$developer_on
=
PhabricatorEnv
::
getEnvConfig
(
'phabricator.developer-mode'
);
$should_minify
=
(
$minify_on
&&
!
$developer_on
);
return
id
(
new
CelerityResourceTransformer
())
->
setMinify
(
$should_minify
)
->
setCelerityMap
(
$this
->
getCelerityResourceMap
());
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, Feb 2, 8:11 AM (7 h, 7 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
6a/ec/5a46e35bf6995a556a49e04f19e4
Attached To
rPHAB Phabricator
Event Timeline
Log In to Comment