{"id":15089276,"url":"https://github.com/enscope/yii2-airbrake","last_synced_at":"2025-04-11T15:31:43.914Z","repository":{"id":50083561,"uuid":"87918352","full_name":"enscope/yii2-airbrake","owner":"enscope","description":"Airbrake integration for Yii2","archived":false,"fork":false,"pushed_at":"2024-05-15T13:51:09.000Z","size":15,"stargazers_count":1,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-25T15:33:20.790Z","etag":null,"topics":["airbrake","logging","yii2","yii2-console","yii2-extension","yii2-logging"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/enscope.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-04-11T09:57:29.000Z","updated_at":"2019-08-16T08:47:08.000Z","dependencies_parsed_at":"2024-09-25T08:42:05.648Z","dependency_job_id":"5f3ceb78-503f-4483-9cf6-859c2819e439","html_url":"https://github.com/enscope/yii2-airbrake","commit_stats":{"total_commits":7,"total_committers":2,"mean_commits":3.5,"dds":0.1428571428571429,"last_synced_commit":"ec3a8ec29a4e28913a33540acf0dc8dbb860fb9a"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enscope%2Fyii2-airbrake","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enscope%2Fyii2-airbrake/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enscope%2Fyii2-airbrake/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enscope%2Fyii2-airbrake/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/enscope","download_url":"https://codeload.github.com/enscope/yii2-airbrake/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248431529,"owners_count":21102217,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["airbrake","logging","yii2","yii2-console","yii2-extension","yii2-logging"],"created_at":"2024-09-25T08:41:59.809Z","updated_at":"2025-04-11T15:31:43.620Z","avatar_url":"https://github.com/enscope.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# yii2-airbrake\nAirbrake integration for Yii2, which wraps around official\n[Airbrake PHP library (airbrake/phpbrake)](https://github.com/airbrake/phpbrake).\n\n## Installation\n    composer require enscope/yii2-airbrake\n\n## Usage\nWhile it is not explicitly required, it is recommended to configure the `AirbrakeService`\nas a component in environment (or even common) configuration, so it is easily accessible\nfrom the whole application (using i.e. `Yii::$app-\u003eget('airbrakeService')`).\n\n    import enscope\\Yii2\\Ext\\Airbrake\\AirbrakeService;\n    import enscope\\Yii2\\Ext\\Airbrake\\AirbrakeFilterFactory;\n\n    return [\n        // ...\n        'components' =\u003e [\n            // ...\n            'airbrakeService' =\u003e [\n                'class' =\u003e AirbrakeService::className(),\n                \n                'enabled' =\u003e true, // default TRUE\n                \n                'projectId' =\u003e [*your-project-id],\n                'projectKey' =\u003e [*your-project-key],\n                \n                'environment' =\u003e YII_ENV, // default NULL\n                'appVersion' =\u003e [your-app-version], // default NULL\n                'rootDirectory' =\u003e [source-root-directory], // default NULL\n                'host' =\u003e [api-endpoint-host], // default \"api.airbrake.io\"\n                'httpClient' =\u003e [http-client-type], // default \"default\"\n                \n                'setGlobalInstance' =\u003e [boolean], // default TRUE\n                'setErrorHandler' =\u003e [boolean], // default FALSE\n                \n                'filters' =\u003e [ // default NULL\n                    // 'PHPSESSID' and '_csrf' parameters should not be transferred to airbrake\n                    AirbrakeFilterFactory::createParamsFilter(['PHPSESSID', '_csrf']),\n                ],\n            ],\n        ],\n    ];\n\n*Configuration options marked with asterisk are required, all other options are optional.*\n\n* `rootDirectory`: should be set to your sources root to allow shortening of file paths\n* `httpClient`: specifies type of HTTP client to use and can be configured as:\n    * `AirbrakeService::CLIENT_DEFAULT`\n    * `AirbrakeService::CLIENT_GUZZLE`\n    * `AirbrakeService::CLIENT_CURL`\n* `setGlobalInstance`: if set to `true`, current instance will be set as global instance\n* `setErrorHandler`: if set to `true`, current instance will be set as PHP run-time unhandled exception handler\n* `filters`: array of callables providing notice pre-processing\n\n*For additional information about the API, please consult official Airbrake PHP library documentation.*\n\n### AirbrakeFilterFactory\nFactory class that can be used to create various filtering rules.\n\n#### `AirbrakeFilterFactory::createParamsFilter(array $params, $replacement = 'FILTERED')`\nMethod will create filtering callable that filters parameters, specified by\n`$params` and replaces it with specified `$replacement`. Example usage is\navailable above.\n\n## Console Support\nIntegration can be added to Yii console, where it currently provides a command\nto track deployment (new feature in Airbrake API 4 that allows to mark error\ntimeline with deployments).\n\n### Usage\nTo use `ConsoleController`, `AirbrakeService` should be configured as component.\n\n    import enscope\\Yii2\\Ext\\Airbrake\\ConsoleController;\n    \n    return [\n        // ...\n        'controllerMap' =\u003e [\n            // ...\n            'airbrake' =\u003e [\n                'class' =\u003e ConsoleController::className(),\n                'airbrakeService' =\u003e [component-name], // default \"airbrakeService\"\n            ],\n        ],\n    ];\n\nWhile parameters can be hard-coded in configuration, console controller\nsupports `inferParameters`, `username`, `revision` and `repository`\nparameters to be set by arguments on command line.\n\n* `airbrakeService`: name of the component or initialized instance\n* `inferParameters`: if TRUE, `repository` and `revision` are discovered using `exec()` calls\n* `revision`: identifier of the revision, discovered by `git rev-parse HEAD` if infer allowed\n* `repository`: identifier of the repository, discovered by `git remote get-url origin` if infer allowed\n* `username`: name of the user tracking deploy (default \"system\")\n\n## Logging Target\nYou can configure Yii2 logger to log errors automatically to Airbrake Service.\n\n### Usage\nTo use `ConsoleController`, `AirbrakeService` should be configured as component.\n\n    import enscope\\Yii2\\Ext\\Airbrake\\AirbrakeTarget;\n    \n    return [\n        // ...\n        'components' =\u003e [\n            // ...\n            'log' =\u003e [\n                // ...\n                'targets' =\u003e [\n                    // ...\n                    [\n                        'class' =\u003e AirbrakeTarget::className(),\n                        'airbrakeService' =\u003e 'airbrakeService',\n                        'levels' =\u003e ['error'],\n                    ],\n                ],\n            ],\n        ],\n    ];\n\nThe target currently does not expose any other configuration options\nother then those exposed by `yii\\log\\Target`, except the service component:\n* `airbrakeService`: name of the component or initialized instance\n\n## License\nYii2 Airbrake integration is licensed under [The MIT License (MIT)](https://github.com/enscope/yii2-airbrake/blob/master/LICENSE)\nas is the original PHP Airbrake library and follows the versioning of that library.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenscope%2Fyii2-airbrake","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fenscope%2Fyii2-airbrake","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenscope%2Fyii2-airbrake/lists"}