Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F95838025
CelerityPhysicalResources.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
Thu, Dec 19, 19:28
Size
1 KB
Mime Type
text/x-php
Expires
Sat, Dec 21, 19:28 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
23049911
Attached To
rPH Phabricator
CelerityPhysicalResources.php
View Options
<?php
/**
* Defines the location of physical static resources which exist at build time
* and are precomputed into a resource map.
*/
abstract
class
CelerityPhysicalResources
extends
CelerityResources
{
private
$map
;
abstract
public
function
getPathToMap
();
abstract
public
function
findBinaryResources
();
abstract
public
function
findTextResources
();
public
function
loadMap
()
{
if
(
$this
->
map
===
null
)
{
$this
->
map
=
include
$this
->
getPathToMap
();
}
return
$this
->
map
;
}
public
static
function
getAll
()
{
static
$resources_map
;
if
(
$resources_map
===
null
)
{
$resources_list
=
id
(
new
PhutilClassMapQuery
())
->
setAncestorClass
(
__CLASS__
)
->
setUniqueMethod
(
'getName'
)
->
execute
();
foreach
(
$resources_list
as
$resources
)
{
$name
=
$resources
->
getName
();
if
(!
preg_match
(
'/^[a-z0-9]+/'
,
$name
))
{
throw
new
Exception
(
pht
(
'Resources name "%s" is not valid; it must contain only '
.
'lowercase latin letters and digits.'
,
$name
));
}
}
$resources_map
=
$resources_list
;
}
return
$resources_map
;
}
}
Event Timeline
Log In to Comment