Create PhyreShellExecutor.php
This commit is contained in:
parent
2a33895a33
commit
5068890756
1 changed files with 34 additions and 0 deletions
34
web/Modules/Microweber/Shell/Adapters/PhyreShellExecutor.php
Normal file
34
web/Modules/Microweber/Shell/Adapters/PhyreShellExecutor.php
Normal file
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
namespace Modules\Microweber\Shell\Adapters;
|
||||
|
||||
use App\ShellApi;
|
||||
use MicroweberPackages\SharedServerScripts\Shell\Adapters\IShellExecutor;
|
||||
use MicroweberPackages\SharedServerScripts\Shell\Adapters\pm_ApiCli;
|
||||
|
||||
class PhyreShellExecutor implements IShellExecutor
|
||||
{
|
||||
/**
|
||||
* @param string $file
|
||||
* @param array $args
|
||||
* @return mixed
|
||||
*/
|
||||
public function executeFile(string $file, array $args)
|
||||
{
|
||||
$output = ShellApi::exec($file, $args);
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
public function executeCommand(array $command, $path, $args)
|
||||
{
|
||||
$commandAsLine = implode(' ', $command);
|
||||
|
||||
// dd([
|
||||
// 'command' => $command,
|
||||
// 'path' => $path,
|
||||
// 'args' => $args,
|
||||
// 'commandAsLine' => $commandAsLine
|
||||
// ]);
|
||||
return ShellApi::exec($commandAsLine);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue