Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F488923
CelerityPhysicalResources.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
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_map
=
array
();
$resources_list
=
id
(
new
PhutilSymbolLoader
())
->
setAncestorClass
(
'CelerityPhysicalResources'
)
->
loadObjects
();
foreach
(
$resources_list
as
$resources
)
{
$name
=
$resources
->
getName
();
if
(
empty
(
$resources_map
[
$name
]))
{
$resources_map
[
$name
]
=
$resources
;
}
else
{
$old
=
get_class
(
$resources_map
[
$name
]);
$new
=
get_class
(
$resources
);
throw
new
Exception
(
pht
(
'Celerity resource maps must have unique names, but maps %s and '
.
'%s share the same name, "%s".'
,
$old
,
$new
,
$name
));
}
}
}
return
$resources_map
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Wed, May 7, 7:29 PM (1 d, 20 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
94491
Default Alt Text
CelerityPhysicalResources.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment