1 | <?php |
||
24 | class PhpFile implements BuilderIOInterface |
||
25 | { |
||
26 | |||
27 | /** |
||
28 | * Generated path. |
||
29 | * This is path, where signals definition will be stored. |
||
30 | * Path is relative to project root. |
||
31 | * @var string |
||
32 | */ |
||
33 | public $generatedPath = 'generated'; |
||
34 | |||
35 | /** |
||
36 | * File name for file containing signals definitions. |
||
37 | * @var string |
||
38 | */ |
||
39 | public $configFilename = 'signals-definition.php'; |
||
40 | |||
41 | /** |
||
42 | * Signal instance |
||
43 | * @var Signal |
||
44 | */ |
||
45 | private $signal = null; |
||
46 | |||
47 | public function read() |
||
48 | { |
||
49 | $file = $this->generatedPath . '/' . $this->configFilename; |
||
50 | if (file_exists($file)) |
||
51 | { |
||
52 | return (array) require $file; |
||
53 | } |
||
54 | else |
||
55 | { |
||
56 | $this->signal->getLogger()->debug('Config file "{file}" does not exists, have you generated signals config file?', ['file' => $file]); |
||
57 | } |
||
58 | } |
||
59 | |||
60 | 1 | public function setSignal(Signal $signal) |
|
65 | |||
66 | public function write($data) |
||
78 | |||
79 | } |
||
80 |