Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93121670
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
Tue, Nov 26, 09:01
Size
558 B
Mime Type
text/x-php
Expires
Thu, Nov 28, 09:01 (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