Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F92973090
PhabricatorPHID.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
Mon, Nov 25, 06:50
Size
558 B
Mime Type
text/x-php
Expires
Wed, Nov 27, 06:50 (2 d)
Engine
blob
Format
Raw Data
Handle
22548123
Attached To
rPH Phabricator
PhabricatorPHID.php
View Options
<?php
final
class
PhabricatorPHID
{
protected
$phid
;
protected
$phidType
;
protected
$ownerPHID
;
protected
$parentPHID
;
public
static
function
generateNewPHID
(
$type
,
$subtype
=
null
)
{
if
(!
$type
)
{
throw
new
Exception
(
pht
(
'Can not generate PHID with no type.'
));
}
if
(
$subtype
===
null
)
{
$uniq_len
=
20
;
$type_str
=
"{$type}"
;
}
else
{
$uniq_len
=
15
;
$type_str
=
"{$type}-{$subtype}"
;
}
$uniq
=
Filesystem
::
readRandomCharacters
(
$uniq_len
);
return
"PHID-{$type_str}-{$uniq}"
;
}
}
Event Timeline
Log In to Comment