Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93780076
DiffusionBlameQuery.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
Sun, Dec 1, 10:57
Size
1 KB
Mime Type
text/x-php
Expires
Tue, Dec 3, 10:57 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22703359
Attached To
rPH Phabricator
DiffusionBlameQuery.php
View Options
<?php
abstract
class
DiffusionBlameQuery
extends
DiffusionQuery
{
private
$timeout
;
private
$paths
;
public
function
setTimeout
(
$timeout
)
{
$this
->
timeout
=
$timeout
;
return
$this
;
}
public
function
getTimeout
()
{
return
$this
->
timeout
;
}
public
function
setPaths
(
array
$paths
)
{
$this
->
paths
=
$paths
;
return
$this
;
}
public
function
getPaths
()
{
return
$this
->
paths
;
}
abstract
protected
function
newBlameFuture
(
DiffusionRequest
$request
,
$path
);
abstract
protected
function
resolveBlameFuture
(
ExecFuture
$future
);
final
public
static
function
newFromDiffusionRequest
(
DiffusionRequest
$request
)
{
return
parent
::
newQueryObject
(
__CLASS__
,
$request
);
}
final
protected
function
executeQuery
()
{
$paths
=
$this
->
getPaths
();
$request
=
$this
->
getRequest
();
$timeout
=
$this
->
getTimeout
();
$futures
=
array
();
foreach
(
$paths
as
$path
)
{
$future
=
$this
->
newBlameFuture
(
$request
,
$path
);
if
(
$timeout
)
{
$future
->
setTimeout
(
$timeout
);
}
$futures
[
$path
]
=
$future
;
}
$blame
=
array
();
if
(
$futures
)
{
$futures
=
id
(
new
FutureIterator
(
$futures
))
->
limit
(
4
);
foreach
(
$futures
as
$path
=>
$future
)
{
$path_blame
=
$this
->
resolveBlameFuture
(
$future
);
if
(
$path_blame
!==
null
)
{
$blame
[
$path
]
=
$path_blame
;
}
}
}
return
$blame
;
}
}
Event Timeline
Log In to Comment