Create PhyreShellExecutor.php

This commit is contained in:
Bozhidar Slaveykov 2024-04-03 17:17:24 +03:00
parent 2a33895a33
commit 5068890756

View 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);
}
}