Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F3295478
PhutilProgressSink.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
PhutilProgressSink.php
View Options
<?php
abstract
class
PhutilProgressSink
extends
Phobject
{
private
$isRunning
;
private
$totalWork
;
private
$completedWork
;
public
function
__construct
(
)
{
$this
->
isRunning
=
true
;
}
public
function
__destruct
(
)
{
if
(
$this
->
isRunning
)
{
$this
->
didFailWork
(
)
;
}
}
final
public
function
setTotalWork
(
$total_work
)
{
$this
->
totalWork
=
$total_work
;
return
$this
;
}
final
public
function
getTotalWork
(
)
{
return
$this
->
totalWork
;
}
final
public
function
getCompletedWork
(
)
{
return
$this
->
completedWork
;
}
final
public
function
didMakeProgress
(
$amount
=
1
)
{
if
(
$this
->
isRunning
)
{
$this
->
completedWork
+=
$amount
;
$this
->
publishProgress
(
)
;
}
}
final
public
function
didCompleteWork
(
)
{
$this
->
isRunning
=
false
;
$this
->
publishCompletion
(
)
;
}
final
public
function
didFailWork
(
)
{
$this
->
isRunning
=
false
;
$this
->
publishFailure
(
)
;
}
abstract
protected
function
publishProgress
(
)
;
abstract
protected
function
publishCompletion
(
)
;
abstract
protected
function
publishFailure
(
)
;
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Thu, Mar 27, 02:11 (3 w, 19 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1114419
Default Alt Text
PhutilProgressSink.php (1 KB)
Attached To
Mode
rARC Arcanist
Attached
Detach File
Event Timeline
Log In to Comment