- Still WIP on storage and a new Update function also started

This commit is contained in:
mcndave committed 2023-03-22 19:09:37 -04:00
1 parent 689120dd44
commit bf1bec644b
8 files changed
+112 -11

No files matched your search

+49
View File
@@ -0,0 +1,49 @@
<?php
namespace Lean\Console\Form\Update;
use Picea\Ui\Method\{ FormInterface, FormContext, FormContextInterface };
use \Lean\Console\{ Lib, Entity };
use Picea\Compiler\Context;
use Psr\Http\Message\ServerRequestInterface;
use Ulmus\{ EntityCollection };
class Git implements FormInterface
{
public function __construct(
public string $projectPath = "",
)
{
}
public function initialize(FormContextInterface $context) : void
{
}
public function validate(FormContextInterface $context) : bool
{
return $context->valid();
}
public function execute(FormContextInterface $context) : void
{
}
public function run(string $command) : \Generator
{
$command = escapeshellcmd($command);
$handle = popen("$command", 'r');
while ( false !== $output = fgets($handle, 2096) ){
yield trim($output);
}
pclose($handle);
}
}