Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F110306096
Registry.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
Fri, Apr 25, 15:39
Size
542 B
Mime Type
text/x-php
Expires
Sun, Apr 27, 15:39 (2 d)
Engine
blob
Format
Raw Data
Handle
25803871
Attached To
rPH Phabricator
Registry.php
View Options
<?php
namespace
RESTful
;
class
Registry
{
protected
$_resources
=
array
();
public
function
add
(
$resource
)
{
array_push
(
$this
->
_resources
,
$resource
);
}
public
function
match
(
$uri
)
{
foreach
(
$this
->
_resources
as
$resource
)
{
$spec
=
$resource
::
getURISpec
();
$result
=
$spec
->
match
(
$uri
);
if
(
$result
==
null
)
{
continue
;
}
$result
[
'class'
]
=
$resource
;
return
$result
;
}
return
null
;
}
}
Event Timeline
Log In to Comment