Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zacksleo/yii-gitlab-error-behavior
gitlab error behavior for yii1
https://github.com/zacksleo/yii-gitlab-error-behavior
gitlab yii yii-extension yii-gitlab-error-bahavior
Last synced: 19 days ago
JSON representation
gitlab error behavior for yii1
- Host: GitHub
- URL: https://github.com/zacksleo/yii-gitlab-error-behavior
- Owner: zacksleo
- License: mit
- Created: 2017-03-27T13:34:08.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-04-29T16:20:57.000Z (over 7 years ago)
- Last Synced: 2024-12-14T01:22:55.654Z (about 1 month ago)
- Topics: gitlab, yii, yii-extension, yii-gitlab-error-bahavior
- Language: PHP
- Size: 8.79 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# yii-gitlab-error-behavior
gitlab error behavior for yii1[![Latest Stable Version](https://poser.pugx.org/zacksleo/yii-gitlab-error-behavior/version)](https://packagist.org/packages/zacksleo/yii-gitlab-error-behavior)
[![Total Downloads](https://poser.pugx.org/zacksleo/yii-gitlab-error-behavior/downloads)](https://packagist.org/packages/zacksleo/yii-gitlab-error-behavior)
[![License](https://poser.pugx.org/zacksleo/yii-gitlab-error-behavior/license)](https://packagist.org/packages/zacksleo/yii-gitlab-error-behavior)## Usage
### Install By Composer
```
composer require zacksleo/yii-gitlab-error-behavior --prefer-dist
```### set component
```
'errorHandler' => [
'errorAction' => 'site/error',
],```
### set behavior in SiteControllerset apiRoot, privateToken and projectName
```
public function behaviors()
{
return array(
'error' => array(
'class' => 'webroot.vendor.zacksleo.yii-gitlab-error-behavior.src.ErrorBehavior',
'apiRoot' => 'http://gitlab.com/api/v3/',
'privateToken' => '{privateToken}',
'projectName' => '{demo/project}'
)
);
}
public function onBeforeAction($event)
{
$this->raiseEvent('onBeforeAction', $event);
}public function actionError()
{
if ($error = Yii::app()->errorHandler->error) {
$this->onBeforeAction(new CEvent($this));
$this->renderPartial('error', $error);
}
}```
## Screenshoot
![](http://ww1.sinaimg.cn/large/675eb504gy1fe0mhspoo6j212706vabc.jpg)