Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F3281524
ArcanistGitRepositoryRemoteQuery.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
1 KB
Referenced Files
None
Subscribers
None
ArcanistGitRepositoryRemoteQuery.php
View Options
<?php
final
class
ArcanistGitRepositoryRemoteQuery
extends
ArcanistRepositoryRemoteQuery
{
protected
function
newRemoteRefs
(
)
{
$api
=
$this
->
getRepositoryAPI
(
)
;
$future
=
$api
->
newFuture
(
'remote --verbose'
)
;
list
(
$lines
)
=
$future
->
resolve
(
)
;
$pattern
=
'(^'
.
'(?P<name>[^\t]+)'
.
'\t'
.
'(?P<uri>[^\s]+)'
.
' '
.
'\((?P<mode>fetch|push)\)'
.
'\z'
.
')'
;
$map
=
array
(
)
;
$lines
=
phutil_split_lines
(
$lines
,
false
)
;
foreach
(
$lines
as
$line
)
{
$matches
=
null
;
if
(
!
preg_match
(
$pattern
,
$line
,
$matches
)
)
{
throw
new
Exception
(
pht
(
'Failed to match remote pattern against line "%s".'
,
$line
)
)
;
}
$name
=
$matches
[
'name'
]
;
$uri
=
$matches
[
'uri'
]
;
$mode
=
$matches
[
'mode'
]
;
$map
[
$name
]
[
$mode
]
=
$uri
;
}
$refs
=
array
(
)
;
foreach
(
$map
as
$name
=>
$uris
)
{
$fetch_uri
=
idx
(
$uris
,
'fetch'
)
;
$push_uri
=
idx
(
$uris
,
'push'
)
;
$ref
=
id
(
new
ArcanistRemoteRef
(
)
)
->
setRemoteName
(
$name
)
;
if
(
$fetch_uri
!==
null
)
{
$ref
->
setFetchURI
(
$fetch_uri
)
;
}
if
(
$push_uri
!==
null
)
{
$ref
->
setPushURI
(
$push_uri
)
;
}
$refs
[
]
=
$ref
;
}
return
$refs
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Mar 23, 23:02 (4 d, 1 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1115652
Default Alt Text
ArcanistGitRepositoryRemoteQuery.php (1 KB)
Attached To
Mode
rARC Arcanist
Attached
Detach File
Event Timeline
Log In to Comment