Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
|||
| 1 | <?php |
| 2 | /** |
| 3 | * |
| 4 | * This file is part of the phpBB Forum Software package. |
| 5 | * |
| 6 | * @copyright (c) phpBB Limited <https://www.phpbb.com> |
| 7 | * @license GNU General Public License, version 2 (GPL-2.0) |
| 8 | * |
| 9 | * For full copyright and license information, please see |
| 10 | * the docs/CREDITS.txt file. |
| 11 | * |
| 12 | */ |
| 13 | |
| 14 | namespace phpbb\storage\provider; |
| 15 | |
| 16 | interface provider_interface |
| 17 | { |
| 18 | /** |
| 19 | * Gets adapter name |
| 20 | * |
| 21 | * @return string |
| 22 | */ |
| 23 | public function get_name(): string; |
| 24 | |
| 25 | /** |
| 26 | * Gets adapter title for acp |
| 27 | * |
| 28 | * @return string |
| 29 | */ |
| 30 | public function get_title(): string; |
| 31 | |
| 32 | /** |
| 33 | * Gets adapter class |
| 34 | * |
| 35 | * @return string |
| 36 | */ |
| 37 | public function get_adapter_class(): string; |
| 38 | |
| 39 | /** |
| 40 | * Gets adapter options |
| 41 | * |
| 42 | * Example: |
| 43 | * public function get_options() |
| 44 | * { |
| 45 | * return [ |
| 46 | * 'text-test' => [ |
| 47 | * 'title' => $this->language->lang('STORAGE_ADAPTER_DEMO_OPTION_TEXT_TEST'), |
| 48 | * 'description' => $this->language->lang('STORAGE_ADAPTER_DEMO_OPTION_TEXT_TEST_EXPLAIN'), |
| 49 | * 'form_macro' => [ |
| 50 | * 'tag' => 'input', |
| 51 | * 'type' => 'text', |
| 52 | * ], |
| 53 | * ], |
| 54 | * 'password-test' => [ |
| 55 | * 'title' => $this->language->lang('STORAGE_ADAPTER_DEMO_OPTION_PASSWORD_TEST'), |
| 56 | * 'description' => $this->language->lang('STORAGE_ADAPTER_DEMO_OPTION_PASSWORD_TEST_EXPLAIN'), |
| 57 | * 'form_macro' => [ |
| 58 | * 'tag' => 'input', |
| 59 | * 'type' => 'password', |
| 60 | * ], |
| 61 | * ], |
| 62 | * 'radio-test' => [ |
| 63 | * 'title' => $this->language->lang('STORAGE_ADAPTER_DEMO_OPTION_RADIO_TEST'), |
| 64 | * 'description' => $this->language->lang('STORAGE_ADAPTER_DEMO_OPTION_RADIO_TEST_EXPLAIN'), |
| 65 | * 'form_macro' => [ |
| 66 | * 'tag' => 'radio', |
| 67 | * 'buttons' => [ |
| 68 | * [ |
| 69 | * 'type' => 'radio', |
| 70 | * 'value' => '1', |
| 71 | * 'label' => $this->language->lang('STORAGE_ADAPTER_DEMO_OPTION_RADIO_TEST_LABEL_ONE'), |
| 72 | * ], |
| 73 | * [ |
| 74 | * 'type' => 'radio', |
| 75 | * 'value' => '2', |
| 76 | * 'label' => $this->language->lang('STORAGE_ADAPTER_DEMO_OPTION_RADIO_TEST_LABEL_TWO'), |
| 77 | * ], |
| 78 | * ], |
| 79 | * ], |
| 80 | * ], |
| 81 | * 'select-test' => [ |
| 82 | * 'title' => $this->language->lang('STORAGE_ADAPTER_DEMO_OPTION_SELECT_TEST'), |
| 83 | * 'description' => $this->language->lang('STORAGE_ADAPTER_DEMO_OPTION_SELECT_TEST_EXPLAIN'), |
| 84 | * 'form_macro' => [ |
| 85 | * 'tag' => 'select', |
| 86 | * 'options' => [ |
| 87 | * ['value' => 'one', 'label' => $this->language->lang('STORAGE_ADAPTER_DEMO_OPTION_SELECT_TEST_LABEL_ONE')], |
| 88 | * ['value' => 'two', 'label' => $this->language->lang('STORAGE_ADAPTER_DEMO_OPTION_SELECT_TEST_LABEL_TWO')], |
| 89 | * ], |
| 90 | * ], |
| 91 | * ], |
| 92 | * 'textarea-test' => [ |
| 93 | * 'title' => $this->language->lang('STORAGE_ADAPTER_DEMO_OPTION_TEXTAREA_TEST'), |
| 94 | * 'description' => $this->language->lang('STORAGE_ADAPTER_DEMO_OPTION_TEXTAREA_TEST_EXPLAIN'), |
| 95 | * 'form_macro' => [ |
| 96 | * 'tag' => 'textarea', |
| 97 | * ] |
| 98 | * ], |
| 99 | * ]; |
| 100 | * } |
| 101 | * |
| 102 | * @return array Configuration keys |
| 103 | */ |
| 104 | public function get_options(): array; |
| 105 | |
| 106 | /** |
| 107 | * Return true if the adapter is available |
| 108 | * |
| 109 | * @return bool |
| 110 | */ |
| 111 | public function is_available(): bool; |
| 112 | } |