Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F548060
PhabricatorPHID.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
483 B
Referenced Files
None
Subscribers
None
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}"
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, May 12, 1:43 PM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
113155
Default Alt Text
PhabricatorPHID.php (483 B)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment