Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F99187138
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
Wed, Jan 22, 04:04
Size
553 B
Mime Type
text/x-php
Expires
Fri, Jan 24, 04:04 (2 d)
Engine
blob
Format
Raw Data
Handle
23724552
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
(
'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