|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
declare(strict_types=1); |
|
4
|
|
|
|
|
5
|
|
|
namespace App\Controller; |
|
6
|
|
|
|
|
7
|
|
|
use Psr\Http\Message\ResponseFactoryInterface; |
|
|
|
|
|
|
8
|
|
|
use Psr\Http\Message\ResponseInterface; |
|
|
|
|
|
|
9
|
|
|
use Psr\Http\Message\StreamFactoryInterface; |
|
|
|
|
|
|
10
|
|
|
use Yiisoft\Router\UrlGeneratorInterface; |
|
|
|
|
|
|
11
|
|
|
|
|
12
|
|
|
class HomeController |
|
13
|
|
|
{ |
|
14
|
|
|
public function index( |
|
15
|
|
|
ResponseFactoryInterface $responseFactory, |
|
16
|
|
|
StreamFactoryInterface $streamFactory, |
|
17
|
|
|
UrlGeneratorInterface $urlGenerator |
|
18
|
|
|
): ResponseInterface { |
|
19
|
|
|
$urlParameters = ['name' => 'World']; |
|
20
|
|
|
$simpleActionUrl = $urlGenerator->generate('temporal/simple', $urlParameters); |
|
21
|
|
|
$complicatedActionUrl = $urlGenerator->generate('temporal/complicated', $urlParameters); |
|
22
|
|
|
$asynchronousActionUrl = $urlGenerator->generate('temporal/asynchronous', $urlParameters); |
|
23
|
|
|
|
|
24
|
|
|
$response = <<<HTML |
|
25
|
|
|
This project is example how to use Temporal with Yii 3 application. |
|
26
|
|
|
<br> |
|
27
|
|
|
There are exist several examples how it works. |
|
28
|
|
|
<br> |
|
29
|
|
|
<h3>Examples:</h3> |
|
30
|
|
|
If you want to see how "simple" workflow works <a href="{$simpleActionUrl}" target="_blank">click here</a>. |
|
31
|
|
|
<br> |
|
32
|
|
|
There is usual call non-blocking action. It should work as faster as you can run usual php code. |
|
33
|
|
|
<br> |
|
34
|
|
|
If you want to see how "complicated" workflow works <a href="{$complicatedActionUrl}" target="_blank">click here</a>. |
|
35
|
|
|
<br> |
|
36
|
|
|
There are imitation for blocking action. Different methods calls will run with random delay: from 1 to 5 seconds per call. |
|
37
|
|
|
<br> |
|
38
|
|
|
If you want to see how "deferred" workflow works <a href="{$asynchronousActionUrl}" target="_blank">click here</a>. |
|
39
|
|
|
<br> |
|
40
|
|
|
There are imitation for asynchronous action. You will get "job id" and you can track the status in another endpoint.<br> |
|
41
|
|
|
Logic for workflow will be same as "complicated" workflow. |
|
42
|
|
|
<br> |
|
43
|
|
|
HTML; |
|
44
|
|
|
|
|
45
|
|
|
return $responseFactory->createResponse(200) |
|
46
|
|
|
->withBody( |
|
47
|
|
|
$streamFactory->createStream($response) |
|
48
|
|
|
) |
|
49
|
|
|
->withHeader('Content-Type', 'text/html') |
|
50
|
|
|
; |
|
51
|
|
|
} |
|
52
|
|
|
} |
|
53
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths