Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93861046
PhutilGitBinaryAnalyzer.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, Dec 2, 02:13
Size
550 B
Mime Type
text/x-php
Expires
Wed, Dec 4, 02:13 (1 d, 21 h)
Engine
blob
Format
Raw Data
Handle
22715785
Attached To
rPHU libphutil
PhutilGitBinaryAnalyzer.php
View Options
<?php
final
class
PhutilGitBinaryAnalyzer
extends
PhutilBinaryAnalyzer
{
const
BINARY
=
'git'
;
protected
function
newBinaryVersion
()
{
list
(
$err
,
$stdout
)
=
exec_manual
(
'git --version'
);
if
(
$err
)
{
return
null
;
}
return
self
::
parseGitBinaryVersion
(
$stdout
);
}
public
static
function
parseGitBinaryVersion
(
$stdout
)
{
if
(
preg_match
(
'/^git version /'
,
$stdout
))
{
$version
=
substr
(
$stdout
,
strlen
(
'git version '
));
$version
=
trim
(
$version
);
return
$version
;
}
return
null
;
}
}
Event Timeline
Log In to Comment