Skip to content

Commit

Permalink
Merge pull request #27 from gearsdigital/improve-misleading-property-#24
Browse files Browse the repository at this point in the history
feat: reduce configuration complexity
  • Loading branch information
gearsdigital authored Jan 19, 2020
2 parents a2cce6c + 9276c67 commit feb1774
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ git submodule add https://github.com/gearsdigital/kirby-reporter.git site/plugin
| Option | Description |
| --- | --- |
| `kirby-reporter.repository` | The repository to which the issues are reported.<br>*Must be a fully qualified url:* `https://github.com/gearsdigital/kirby-reporter`|
| `kirby-reporter.token` | Your personal access token.<br>*Your personal access token is never populated to the client!* |
| `kirby-reporter.disabled` | Setting this option to `true` disables the plugin completely. This option *must* be present. |
| `kirby-reporter.token` | Your personal access token (PAT).<br>*Your personal access token is never populated to the client!* |
| `kirby-reporter.enabled` | Must be present and set to `true`, otherwise the plugin will not work |

### Example
```php
// site/config/config.php
return [
'kirby-reporter.disabled' => false, // set true to disable the plugin
'kirby-reporter.enabled' => true, // set false to disable the plugin
'kirby-reporter.repository' => 'https://github.com/gearsdigital/kirby-reporter',
'kirby-reporter.token' => 'c56658e7c03a5995e2e1491e6a3b93fcde6225c9'
];
Expand Down
4 changes: 2 additions & 2 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
use KirbyReporter\Client\ErrorResponse;
use KirbyReporter\Client\PayloadInterceptor;

$pluginState = option('kirby-reporter.disabled');
if ($pluginState || is_null($pluginState)) {
$pluginState = option('kirby-reporter.enabled');
if (is_null($pluginState) || !$pluginState) {
return false;
}
$url = option('kirby-reporter.repository');
Expand Down

0 comments on commit feb1774

Please sign in to comment.