| Conditions | 4 |
| Paths | 4 |
| Total Lines | 18 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| 1 | <?php |
||
| 12 | public function preRequest(SS_HTTPRequest $request, Session $session, DataModel $model) |
||
| 13 | { |
||
| 14 | // Skip if database isn't ready |
||
| 15 | if (!$this->isDBReady()) { |
||
| 16 | return; |
||
| 17 | } |
||
| 18 | |||
| 19 | // Skip if SiteConfig doesn't have this extension |
||
| 20 | if (!SiteConfig::has_extension('AkismetConfig')) { |
||
| 21 | return; |
||
| 22 | } |
||
| 23 | |||
| 24 | // Check if key exists |
||
| 25 | $akismetKey = SiteConfig::current_site_config()->AkismetKey; |
||
| 26 | if ($akismetKey) { |
||
| 27 | AkismetSpamProtector::set_api_key($akismetKey); |
||
| 28 | } |
||
| 29 | } |
||
| 30 | |||
| 59 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.