Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93108483
DrydockCommandInterface.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
Tue, Nov 26, 06:50
Size
1 KB
Mime Type
text/x-php
Expires
Thu, Nov 28, 06:50 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22574665
Attached To
rPH Phabricator
DrydockCommandInterface.php
View Options
<?php
abstract
class
DrydockCommandInterface
extends
DrydockInterface
{
private
$workingDirectory
;
public
function
setWorkingDirectory
(
$working_directory
)
{
$this
->
workingDirectory
=
$working_directory
;
return
$this
;
}
public
function
getWorkingDirectory
()
{
return
$this
->
workingDirectory
;
}
final
public
function
getInterfaceType
()
{
return
'command'
;
}
final
public
function
exec
(
$command
)
{
$argv
=
func_get_args
();
$exec
=
call_user_func_array
(
array
(
$this
,
'getExecFuture'
),
$argv
);
return
$exec
->
resolve
();
}
final
public
function
execx
(
$command
)
{
$argv
=
func_get_args
();
$exec
=
call_user_func_array
(
array
(
$this
,
'getExecFuture'
),
$argv
);
return
$exec
->
resolvex
();
}
abstract
public
function
getExecFuture
(
$command
);
protected
function
applyWorkingDirectoryToArgv
(
array
$argv
)
{
if
(
$this
->
getWorkingDirectory
()
!==
null
)
{
$cmd
=
$argv
[
0
];
$cmd
=
"(cd %s; {$cmd})"
;
$argv
=
array_merge
(
array
(
$cmd
),
array
(
$this
->
getWorkingDirectory
()),
array_slice
(
$argv
,
1
));
}
return
$argv
;
}
}
Event Timeline
Log In to Comment