Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F117938972
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, Jun 16, 16:24
Size
483 B
Mime Type
text/x-php
Expires
Wed, Jun 18, 16:24 (2 d)
Engine
blob
Format
Raw Data
Handle
26783830
Attached To
rPH Phabricator
PhabricatorPHID.php
View Options
<?php
final
class
PhabricatorPHID
extends
Phobject
{
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