Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F5976341
BoxedExecutor.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
BoxedExecutor.php
View Options
<?php
namespace
Shellbox\Command
;
/**
* Base class for things that execute BoxedCommands
*/
abstract
class
BoxedExecutor
{
/** @var Validator|null */
protected
$validator
;
/**
* Execute a boxed command.
*
* @param BoxedCommand $command
* @return BoxedResult
*/
final
public
function
execute
(
BoxedCommand
$command
)
{
$this
->
assertIsValid
(
$command
);
return
$this
->
executeValid
(
$command
);
}
/**
* Execute a BoxedCommand that has already been validated.
*
* @param BoxedCommand $command
* @return BoxedResult
*/
abstract
public
function
executeValid
(
BoxedCommand
$command
);
/**
* Create an empty command linked to this executor
*
* @return BoxedCommand
*/
public
function
createCommand
()
{
return
new
BoxedCommand
(
$this
);
}
/**
* Set validation configuration
*
* @param array $config
*/
public
function
setValidationConfig
(
$config
)
{
$this
->
validator
=
new
Validator
(
$config
);
}
/**
* Validate the command. If it is not valid, throw an exception
*
* @param BoxedCommand $command
* @throws ValidationError
*/
protected
function
assertIsValid
(
BoxedCommand
$command
)
{
if
(
!
$this
->
validator
)
{
return
;
}
$this
->
validator
->
validate
(
$command
);
}
/**
* Whether the executor can download input files and upload output files
* specified with BoxedCommand::inputFileFromUrl and the like.
*
* @since 4.1.0
* @return bool
*/
abstract
public
function
areUrlFilesAllowed
();
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, Oct 3, 19:03 (1 d, 17 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
34/5c/5f1fd2511cb58285860970fc348c
Default Alt Text
BoxedExecutor.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment