Final Class Yiisoft\Yii\Debug\Collector\Stream\HttpStreamCollector
| Inheritance | Yiisoft\Yii\Debug\Collector\Stream\HttpStreamCollector |
|---|---|
| Implements | Yiisoft\Yii\Debug\Collector\SummaryCollectorInterface |
| Uses Traits | Yiisoft\Yii\Debug\Collector\CollectorTrait |
Public Methods
Method Details
| public mixed __construct ( array $ignoredPathPatterns = [], array $ignoredClasses = [], array $ignoredUrls = [] ) | ||
| $ignoredPathPatterns | array | |
| $ignoredClasses | array | |
| $ignoredUrls | array | |
public function __construct(
/**
* @var string[]
*/
private readonly array $ignoredPathPatterns = [],
/**
* @var string[]
*/
private readonly array $ignoredClasses = [],
/**
* @var string[]
*/
private readonly array $ignoredUrls = []
) {
}
| public void collect ( string $operation, string $path, array $args ) | ||
| $operation | string | |
| $path | string | |
| $args | array | |
public function collect(string $operation, string $path, array $args): void
{
if (!$this->isActive()) {
return;
}
$this->requests[$operation][] = [
'uri' => $path,
'args' => $args,
];
}
| public array getCollected ( ) |
public function getCollected(): array
{
if (!$this->isActive()) {
return [];
}
return $this->requests;
}
| public array getSummary ( ) |
public function getSummary(): array
{
if (!$this->isActive()) {
return [];
}
return [
'streams' => array_merge(
...array_map(
fn (string $operation) => [
$operation => count($this->requests[$operation]),
],
array_keys($this->requests)
)
),
];
}
| public void shutdown ( ) |
public function shutdown(): void
{
HttpStreamProxy::unregister();
HttpStreamProxy::$collector = null;
$this->reset();
$this->isActive = false;
}
| public void startup ( ) |
public function startup(): void
{
$this->isActive = true;
HttpStreamProxy::register();
HttpStreamProxy::$ignoredPathPatterns = $this->ignoredPathPatterns;
HttpStreamProxy::$ignoredClasses = $this->ignoredClasses;
HttpStreamProxy::$ignoredUrls = $this->ignoredUrls;
HttpStreamProxy::$collector = $this;
// TODO: add cURL support, maybe through proxy?
// https://github.com/php/php-src/issues/10509
//stream_context_set_default([
// 'http' => [
// 'proxy' => 'yii-debug-http://127.0.0.1',
// ],
//]);
}
Signup or Login in order to comment.