Size: a a a

2020 May 11

DS

Dmitriy S in Yii Framework 3
TradersVE
??
Symfony ConsoleOutput,  how to log stream content?
источник

T

TradersVE in Yii Framework 3
public function output(): OutputInterface
{
    if ($this->output === null) {
       $this->output = new ConsoleOutput();
    }

    return $this->output;
}
источник

T

TradersVE in Yii Framework 3
It was the form that made it impossible to register it in the di container.
источник

T

TradersVE in Yii Framework 3
Create a consoleHelper that returns InputInterface, OutputInterface, SymphonyStyle
источник

T

TradersVE in Yii Framework 3
источник

DS

Dmitriy S in Yii Framework 3
I mean I need a stream content. I have ConsoleCommandEvent with input and output, how I can get output stream content?
источник

T

TradersVE in Yii Framework 3
Dmitriy S
I mean I need a stream content. I have ConsoleCommandEvent with input and output, how I can get output stream content?
ah
источник

DS

Dmitriy S in Yii Framework 3
Something like that, but it doesn't work
источник

T

TradersVE in Yii Framework 3
источник

T

TradersVE in Yii Framework 3
but you need to modify the yii wrapper to inject the event dispatcher.
источник

T

TradersVE in Yii Framework 3
https://github.com/yiisoft/yii-console/blob/83e9086b130cf1f21621ae5d10eae60bcf13d41a/bin/yii#L45 The event dispatcher is not configured so it does not work for you.
источник

DS

Dmitriy S in Yii Framework 3
TradersVE
but you need to modify the yii wrapper to inject the event dispatcher.
Thats all done already
источник

DS

Dmitriy S in Yii Framework 3
But output is empty
источник

T

TradersVE in Yii Framework 3
Dmitriy S
But output is empty
are you using the symphony or yii event dispatcher?
источник

DS

Dmitriy S in Yii Framework 3
TradersVE
are you using the symphony or yii event dispatcher?
No difference, I'm using Yii EventDisptacher, but it works with symfony (with wrapper)
источник

T

TradersVE in Yii Framework 3
I would try the symphony event dispatcher.
источник

DS

Dmitriy S in Yii Framework 3
источник

T

TradersVE in Yii Framework 3
that console has its magic.
источник

DS

Dmitriy S in Yii Framework 3
TradersVE
I would try the symphony event dispatcher.
There is no problem with dispatcher, problem is to get console output stream
источник

AT

Anton Titov in Yii Framework 3
in symfony console i usually wrap OutputInterface with buffer interceptor, then you can forward it to the designated log
источник