label305/bugsnag-cakephp

该软件包已被放弃,不再维护。未建议替代软件包。

CakePHP应用程序的Bugsnag通知器

安装量30,244

依赖项: 0

建议者: 0

安全: 0

星标: 3

关注者: 10

分支: 6

类型:cakephp-plugin

0.1.1 2015-01-12 16:15 UTC

This package is not auto-updated.

Last update: 2020-01-24 15:24:57 UTC


README

此插件允许您在CakePHP项目中使用Bugsnag。当您的应用程序崩溃时,您将收到通知,并可以查看特定异常和错误的详细日志和堆栈跟踪。

BugsnagErrorHandler类扩展了默认的CakePHP ErrorHandler类,因此内置类的功能将继续工作。

快速入门

使用以下方法之一将此库包含到您的项目中。

  1. 使用Composer安装此插件
  2. 放置文件

一旦包含此库,您应该修改:app/Config/core.php。请确保输入您自己的API密钥。

Configure::write('BugsnagCakephp.apikey', '{yourbugsnagapikey}');

Configure::write('Exception', array(
    'handler' => 'BugsnagErrorHandler::handleException',
    'renderer' => 'ExceptionRenderer',
    'log' => true
));

Configure::write('Error', array(
    'handler' => 'BugsnagErrorHandler::handleError',
    'level' => E_ALL & ~E_DEPRECATED,
    'trace' => true
));

并且确保通过将以下行添加到:app/Config/bootstrap.php来加载插件。

// place after the 'require' statement for the Bugsnag library.
App::uses('BugsnagErrorHandler', 'BugsnagCakephp.Lib');

使用Composer安装

  1. 修改composer.json以包含以下行

    "require": {
      "label305/bugsnag-cakephp": "0.1.*"
    },
    ...
    "extra": {
        "installer-paths": {
            "app/Plugin/{$name}/": ["label305/bugsnag-cakephp"]
        }
    }
  2. 并运行composer update

  3. app/Config/bootstrap.php中要求Bugsnag PHP库。

    require ROOT . DS . 'vendor' . DS . 'bugsnag' . DS . 'bugsnag' . DS . 'build' . DS . 'bugsnag.phar';

通过放置安装

  1. 将此存储库中的文件放置在app/Plugin/BugsnagCakephp

  2. 将最新的bugsnag.phar下载到您的PHP项目中。

  3. app/Config/bootstrap.php中要求它。

    require_once 'path' . DS . 'to' . DS . 'bugsnag.phar';
  4. 确保已安装php扩展mbstring

许可

版权所有 2014 Label305 B.V.

根据Apache License,版本2.0(“许可证”);除非遵守许可证,否则不得使用此文件。您可以在以下位置获取许可证副本:

https://apache.ac.cn/licenses/LICENSE-2.0

除非适用法律要求或书面同意,否则在许可证下分发的软件按“原样”分发,不提供任何明示或暗示的保证或条件。有关许可证的具体语言、权限和限制,请参阅许可证。