label305 / bugsnag-cakephp
该软件包已被放弃,不再维护。未建议替代软件包。
CakePHP应用程序的Bugsnag通知器
0.1.1
2015-01-12 16:15 UTC
Requires
- bugsnag/bugsnag: 2.*
This package is not auto-updated.
Last update: 2020-01-24 15:24:57 UTC
README
此插件允许您在CakePHP项目中使用Bugsnag。当您的应用程序崩溃时,您将收到通知,并可以查看特定异常和错误的详细日志和堆栈跟踪。
BugsnagErrorHandler
类扩展了默认的CakePHP ErrorHandler
类,因此内置类的功能将继续工作。
快速入门
使用以下方法之一将此库包含到您的项目中。
一旦包含此库,您应该修改: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安装
-
修改
composer.json
以包含以下行"require": { "label305/bugsnag-cakephp": "0.1.*" }, ... "extra": { "installer-paths": { "app/Plugin/{$name}/": ["label305/bugsnag-cakephp"] } }
-
并运行
composer update
。 -
在
app/Config/bootstrap.php
中要求Bugsnag PHP库。require ROOT . DS . 'vendor' . DS . 'bugsnag' . DS . 'bugsnag' . DS . 'build' . DS . 'bugsnag.phar';
通过放置安装
-
将此存储库中的文件放置在
app/Plugin/BugsnagCakephp
中 -
将最新的bugsnag.phar下载到您的PHP项目中。
-
在
app/Config/bootstrap.php
中要求它。require_once 'path' . DS . 'to' . DS . 'bugsnag.phar';
-
确保已安装php扩展
mbstring
。
许可
版权所有 2014 Label305 B.V.
根据Apache License,版本2.0(“许可证”);除非遵守许可证,否则不得使用此文件。您可以在以下位置获取许可证副本:
https://apache.ac.cn/licenses/LICENSE-2.0
除非适用法律要求或书面同意,否则在许可证下分发的软件按“原样”分发,不提供任何明示或暗示的保证或条件。有关许可证的具体语言、权限和限制,请参阅许可证。