1 | <?php |
||
9 | class AkismetSpamProtector implements SpamProtector |
||
|
|||
10 | { |
||
11 | /** |
||
12 | * Set this to your API key |
||
13 | * |
||
14 | * @var string |
||
15 | * @config |
||
16 | */ |
||
17 | private static $api_key = null; |
||
18 | |||
19 | /** |
||
20 | * Permission required to bypass check |
||
21 | * |
||
22 | * @var string |
||
23 | * @config |
||
24 | */ |
||
25 | private static $bypass_permission = 'ADMIN'; |
||
26 | |||
27 | /** |
||
28 | * Set to try to bypass check for all logged in users |
||
29 | * |
||
30 | * @var boolean |
||
31 | * @config |
||
32 | */ |
||
33 | private static $bypass_members = false; |
||
34 | |||
35 | /** |
||
36 | * IMPORTANT: If you are operating in a country (such as Germany) that has content transmission disclosure |
||
37 | * requirements, set this to true in order to require a user prompt prior to submission of user data |
||
38 | * to the Akismet servers |
||
39 | * |
||
40 | * @var boolean |
||
41 | * @config |
||
42 | */ |
||
43 | private static $require_confirmation = false; |
||
44 | |||
45 | /** |
||
46 | * Set to true to disable spam errors, instead saving this field to the dataobject with the spam |
||
47 | * detection as a flag. This will disable validation errors when spam is encountered. |
||
48 | * The flag will be saved to the same field specified by the 'name' option in enableSpamProtection() |
||
49 | * |
||
50 | * @var boolean |
||
51 | * @config |
||
52 | */ |
||
53 | private static $save_spam = false; |
||
54 | |||
55 | /** |
||
56 | * @var array |
||
57 | */ |
||
58 | private $fieldMapping = array(); |
||
59 | |||
60 | /** |
||
61 | * Overridden API key |
||
62 | * |
||
63 | * @var string |
||
64 | */ |
||
65 | protected static $_api_key = null; |
||
66 | |||
67 | public function __construct($options = array()) |
||
70 | |||
71 | /** |
||
72 | * Set the API key |
||
73 | * |
||
74 | * @param string $key |
||
75 | */ |
||
76 | public static function set_api_key($key) |
||
80 | |||
81 | /** |
||
82 | * Get the API key |
||
83 | * |
||
84 | * @return string |
||
85 | */ |
||
86 | protected static function get_api_key() |
||
103 | |||
104 | /** |
||
105 | * Retrieves Akismet API object singleton, or null if not configured |
||
106 | * |
||
107 | * @return AkismetService |
||
108 | */ |
||
109 | public static function api() |
||
122 | |||
123 | public function getFormField($name = null, $title = null, $value = null, $form = null, $rightTitle = null) |
||
128 | |||
129 | public function setFieldMapping($fieldMapping) |
||
133 | } |
||
134 |
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.