* executor basics added to repo

This commit is contained in:
Dávid Danyi
2017-03-17 16:30:19 +01:00
parent 2814f4f98e
commit 8bd0b827bf
14 changed files with 1537 additions and 3 deletions

View File

@@ -0,0 +1,27 @@
<?php
namespace App\Action;
use App\Response\JsonCorsResponse;
use App\Service\CiExecutorService;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
class CiExecutorAction extends AbstractAction
{
/**
* @var CiExecutorService
*/
private $ciExecutorService;
public function __construct(CiExecutorService $ciExecutorService)
{
$this->ciExecutorService = $ciExecutorService;
}
public function getList(ServerRequestInterface $request, ResponseInterface $response, callable $next = null)
{
return new JsonCorsResponse($this->ciExecutorService->debug());
}
}

View File

@@ -0,0 +1,15 @@
<?php
namespace App\Action;
use App\Service\CiExecutorService;
use Interop\Container\ContainerInterface;
class CiExecutorFactory
{
public function __invoke(ContainerInterface $container)
{
$service = $container->get(CiExecutorService::class);
return new CiExecutorAction($service);
}
}

View File

@@ -0,0 +1,27 @@
<?php
namespace App\Action;
use App\Response\JsonCorsResponse;
use App\Service\CiExecutorService;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
class CiStreamAction extends AbstractAction
{
/**
* @var CiExecutorService
*/
private $ciExecutorService;
public function __construct(CiExecutorService $ciExecutorService)
{
$this->ciExecutorService = $ciExecutorService;
}
public function getList(ServerRequestInterface $request, ResponseInterface $response, callable $next = null)
{
return new JsonCorsResponse($this->ciExecutorService->getCiStreams());
}
}

View File

@@ -0,0 +1,15 @@
<?php
namespace App\Action;
use App\Service\CiExecutorService;
use Interop\Container\ContainerInterface;
class CiStreamFactory
{
public function __invoke(ContainerInterface $container)
{
$service = $container->get(CiExecutorService::class);
return new CiStreamAction($service);
}
}

View File

@@ -0,0 +1,27 @@
<?php
namespace App\Action;
use App\Response\JsonCorsResponse;
use App\Service\CiExecutorService;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
class JcatPackageAction extends AbstractAction
{
/**
* @var CiExecutorService
*/
private $ciExecutorService;
public function __construct(CiExecutorService $ciExecutorService)
{
$this->ciExecutorService = $ciExecutorService;
}
public function getList(ServerRequestInterface $request, ResponseInterface $response, callable $next = null)
{
return new JsonCorsResponse($this->ciExecutorService->getJcatPackages());
}
}

View File

@@ -0,0 +1,15 @@
<?php
namespace App\Action;
use App\Service\CiExecutorService;
use Interop\Container\ContainerInterface;
class JcatPackageFactory
{
public function __invoke(ContainerInterface $container)
{
$service = $container->get(CiExecutorService::class);
return new JcatPackageAction($service);
}
}