linkorb/registry-whoops

Whoops 格式化器和处理器:将异常存储在注册表中。

v1.0.3 2017-02-08 16:38 UTC

This package is auto-updated.

Last update: 2024-08-29 03:05:55 UTC


README

注册表 Whoops 格式化器和处理器。

安装

$ composer require linkorb/registry-client-php linkorb/registry-whoops

集成

创建注册表存储客户端的实例:

use Registry\Client\ClientBuilder;
use Registry\Client\Store;

$config = array(
    'api_host' => 'registry.example.com',
    'auth' => array('myusername', 'mypassword'),
    'secure' => true,
);
$store = new Store(new ClientBuilder($config), 'myaccount', 'mystore');

以及 Whoops 处理器的实例:

use Registry\Whoops\Formatter\RequestExceptionFormatter;
use Registry\Whoops\Handler\RegistryHandler;

$handler = new RegistryHandler(new RequestExceptionFormatter, $store);

并在 Whoops 中注册 Whoops 处理器:

$whoops->pushHandler($handler);