Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F547448
DiffusionPreCommitUsesGitLFSHeraldField.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
DiffusionPreCommitUsesGitLFSHeraldField.php
View Options
<?php
final
class
DiffusionPreCommitUsesGitLFSHeraldField
extends
DiffusionPreCommitContentHeraldField
{
const
FIELDCONST
=
'diffusion.pre.commit.git-lfs'
;
public
function
getHeraldFieldName
()
{
return
pht
(
'Commit uses Git LFS'
);
}
public
function
getFieldGroupKey
()
{
return
DiffusionChangeHeraldFieldGroup
::
FIELDGROUPKEY
;
}
public
function
getHeraldFieldValue
(
$object
)
{
$map
=
$this
->
getAdapter
()->
getDiffContent
(
'+'
);
// At the time of writing, all current Git LFS files begin with this
// line, verbatim:
//
// version https://git-lfs.github.com/spec/v1
//
// ...but we don't try to match the specific version here, in the hopes
// that this might also detect future versions.
$pattern
=
'(^version
\s
*https://git-lfs.github.com/spec/)i'
;
foreach
(
$map
as
$path
=>
$content
)
{
if
(
preg_match
(
$pattern
,
$content
))
{
return
true
;
}
}
return
false
;
}
protected
function
getHeraldFieldStandardType
()
{
return
self
::
STANDARD_BOOL
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, May 12, 1:33 PM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
120597
Default Alt Text
DiffusionPreCommitUsesGitLFSHeraldField.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment