Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F121655543
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
Sat, Jul 12, 21:14
Size
550 B
Mime Type
text/x-php
Expires
Mon, Jul 14, 21:14 (2 d)
Engine
blob
Format
Raw Data
Handle
27357347
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