@@ -5,32 +5,32 @@ |
||
| 5 | 5 | $mainWiki = new \jumper423\decaptcha\core\DeCaptchaWikiMain(new \jumper423\decaptcha\services\RuCaptcha([])); |
| 6 | 6 | foreach (['ru', 'en'] as $lang) { |
| 7 | 7 | foreach ([ |
| 8 | - new \jumper423\decaptcha\services\RuCaptcha([]), |
|
| 9 | - new \jumper423\decaptcha\services\RuCaptchaReCaptcha([]), |
|
| 10 | - new \jumper423\decaptcha\services\RuCaptchaReCaptchaV3([]), |
|
| 11 | - new \jumper423\decaptcha\services\RuCaptchaInstruction([]), |
|
| 12 | - new \jumper423\decaptcha\services\RuCaptchaGrid([]), |
|
| 13 | - new \jumper423\decaptcha\services\RuCaptchaClick([]), |
|
| 14 | - new \jumper423\decaptcha\services\RuCaptchaKeyCaptcha([]), |
|
| 15 | - new \jumper423\decaptcha\services\RuCaptchaFunCaptcha([]), |
|
| 16 | - new \jumper423\decaptcha\services\RuCaptchaGeeTest([]), |
|
| 17 | - new \jumper423\decaptcha\services\TwoCaptcha([]), |
|
| 18 | - new \jumper423\decaptcha\services\TwoCaptchaReCaptcha([]), |
|
| 19 | - new \jumper423\decaptcha\services\TwoCaptchaReCaptchaV3([]), |
|
| 20 | - new \jumper423\decaptcha\services\TwoCaptchaInstruction([]), |
|
| 21 | - new \jumper423\decaptcha\services\TwoCaptchaGrid([]), |
|
| 22 | - new \jumper423\decaptcha\services\TwoCaptchaClick([]), |
|
| 23 | - new \jumper423\decaptcha\services\TwoCaptchaKeyCaptcha([]), |
|
| 24 | - new \jumper423\decaptcha\services\TwoCaptchaFunCaptcha([]), |
|
| 25 | - new \jumper423\decaptcha\services\TwoCaptchaGeeTest([]), |
|
| 26 | - new \jumper423\decaptcha\services\Anticaptcha([]), |
|
| 27 | - new \jumper423\decaptcha\services\AnticaptchaReCaptcha([]), |
|
| 28 | - new \jumper423\decaptcha\services\AnticaptchaReCaptchaProxeless([]), |
|
| 29 | - new \jumper423\decaptcha\services\Captcha24([]), |
|
| 30 | - new \jumper423\decaptcha\services\Pixodrom([]), |
|
| 31 | - new \jumper423\decaptcha\services\Ripcaptcha([]), |
|
| 32 | - new \jumper423\decaptcha\services\Socialink([]), |
|
| 33 | - ] as $class) { |
|
| 8 | + new \jumper423\decaptcha\services\RuCaptcha([]), |
|
| 9 | + new \jumper423\decaptcha\services\RuCaptchaReCaptcha([]), |
|
| 10 | + new \jumper423\decaptcha\services\RuCaptchaReCaptchaV3([]), |
|
| 11 | + new \jumper423\decaptcha\services\RuCaptchaInstruction([]), |
|
| 12 | + new \jumper423\decaptcha\services\RuCaptchaGrid([]), |
|
| 13 | + new \jumper423\decaptcha\services\RuCaptchaClick([]), |
|
| 14 | + new \jumper423\decaptcha\services\RuCaptchaKeyCaptcha([]), |
|
| 15 | + new \jumper423\decaptcha\services\RuCaptchaFunCaptcha([]), |
|
| 16 | + new \jumper423\decaptcha\services\RuCaptchaGeeTest([]), |
|
| 17 | + new \jumper423\decaptcha\services\TwoCaptcha([]), |
|
| 18 | + new \jumper423\decaptcha\services\TwoCaptchaReCaptcha([]), |
|
| 19 | + new \jumper423\decaptcha\services\TwoCaptchaReCaptchaV3([]), |
|
| 20 | + new \jumper423\decaptcha\services\TwoCaptchaInstruction([]), |
|
| 21 | + new \jumper423\decaptcha\services\TwoCaptchaGrid([]), |
|
| 22 | + new \jumper423\decaptcha\services\TwoCaptchaClick([]), |
|
| 23 | + new \jumper423\decaptcha\services\TwoCaptchaKeyCaptcha([]), |
|
| 24 | + new \jumper423\decaptcha\services\TwoCaptchaFunCaptcha([]), |
|
| 25 | + new \jumper423\decaptcha\services\TwoCaptchaGeeTest([]), |
|
| 26 | + new \jumper423\decaptcha\services\Anticaptcha([]), |
|
| 27 | + new \jumper423\decaptcha\services\AnticaptchaReCaptcha([]), |
|
| 28 | + new \jumper423\decaptcha\services\AnticaptchaReCaptchaProxeless([]), |
|
| 29 | + new \jumper423\decaptcha\services\Captcha24([]), |
|
| 30 | + new \jumper423\decaptcha\services\Pixodrom([]), |
|
| 31 | + new \jumper423\decaptcha\services\Ripcaptcha([]), |
|
| 32 | + new \jumper423\decaptcha\services\Socialink([]), |
|
| 33 | + ] as $class) { |
|
| 34 | 34 | $mainWiki->addClass($class); |
| 35 | 35 | $class->getWiki($lang)->save(); |
| 36 | 36 | } |
@@ -29,307 +29,307 @@ discard block |
||
| 29 | 29 | 'recognize_file' => true, |
| 30 | 30 | 'recognize_data_file' => 'http://site.com/captcha.jpg', |
| 31 | 31 | 'recognize_data' => [], |
| 32 | - 'field_main_name_'.$class::ACTION_FIELD_KEY => [ |
|
| 32 | + 'field_main_name_' . $class::ACTION_FIELD_KEY => [ |
|
| 33 | 33 | 'ru' => 'Ключ', |
| 34 | 34 | 'en' => 'Key', |
| 35 | 35 | ], |
| 36 | - 'field_main_desc_'.$class::ACTION_FIELD_KEY => [ |
|
| 36 | + 'field_main_desc_' . $class::ACTION_FIELD_KEY => [ |
|
| 37 | 37 | 'ru' => 'Ключ от учетной записи', |
| 38 | 38 | 'en' => 'Key account', |
| 39 | 39 | ], |
| 40 | - 'field_main_name_'.$class::ACTION_FIELD_LANGUAGE => [ |
|
| 40 | + 'field_main_name_' . $class::ACTION_FIELD_LANGUAGE => [ |
|
| 41 | 41 | 'ru' => 'Язык', |
| 42 | 42 | 'en' => 'Language', |
| 43 | 43 | ], |
| 44 | - 'field_main_desc_'.$class::ACTION_FIELD_LANGUAGE => [ |
|
| 44 | + 'field_main_desc_' . $class::ACTION_FIELD_LANGUAGE => [ |
|
| 45 | 45 | 'ru' => 'На каком языке текст на капче', |
| 46 | 46 | 'en' => 'What language the text on the captcha', |
| 47 | 47 | ], |
| 48 | - 'field_main_name_'.$class::ACTION_FIELD_LANG => [ |
|
| 48 | + 'field_main_name_' . $class::ACTION_FIELD_LANG => [ |
|
| 49 | 49 | 'ru' => 'Код языка', |
| 50 | 50 | 'en' => 'Language code', |
| 51 | 51 | ], |
| 52 | - 'field_main_desc_'.$class::ACTION_FIELD_LANG => [ |
|
| 52 | + 'field_main_desc_' . $class::ACTION_FIELD_LANG => [ |
|
| 53 | 53 | 'ru' => 'См. список поддерживаемых языков. https://rucaptcha.com/api-rucaptcha#language', |
| 54 | 54 | 'en' => 'See the list of supported languages. https://2captcha.com/api-rucaptcha#language', |
| 55 | 55 | ], |
| 56 | - 'field_main_name_'.$class::ACTION_FIELD_FILE => [ |
|
| 56 | + 'field_main_name_' . $class::ACTION_FIELD_FILE => [ |
|
| 57 | 57 | 'ru' => 'Картинка', |
| 58 | 58 | 'en' => 'Picture', |
| 59 | 59 | ], |
| 60 | - 'field_main_desc_'.$class::ACTION_FIELD_FILE => [ |
|
| 60 | + 'field_main_desc_' . $class::ACTION_FIELD_FILE => [ |
|
| 61 | 61 | 'ru' => 'Путь на файл с картинкой или ссылка на него', |
| 62 | 62 | 'en' => 'The path to the picture file or link to it', |
| 63 | 63 | ], |
| 64 | - 'field_main_name_'.$class::ACTION_FIELD_PHRASE => [ |
|
| 64 | + 'field_main_name_' . $class::ACTION_FIELD_PHRASE => [ |
|
| 65 | 65 | 'ru' => 'Несколько слов', |
| 66 | 66 | 'en' => 'A few words', |
| 67 | 67 | ], |
| 68 | - 'field_main_desc_'.$class::ACTION_FIELD_PHRASE => [ |
|
| 68 | + 'field_main_desc_' . $class::ACTION_FIELD_PHRASE => [ |
|
| 69 | 69 | 'ru' => 'Работник должен ввести текст с одним или несколькими пробелами', |
| 70 | 70 | 'en' => 'The worker must enter text with one or more spaces', |
| 71 | 71 | ], |
| 72 | - 'field_main_name_'.$class::ACTION_FIELD_REGSENSE => [ |
|
| 72 | + 'field_main_name_' . $class::ACTION_FIELD_REGSENSE => [ |
|
| 73 | 73 | 'ru' => 'Регистр', |
| 74 | 74 | 'en' => 'Register', |
| 75 | 75 | ], |
| 76 | - 'field_main_desc_'.$class::ACTION_FIELD_REGSENSE => [ |
|
| 76 | + 'field_main_desc_' . $class::ACTION_FIELD_REGSENSE => [ |
|
| 77 | 77 | 'ru' => 'Работник должен ввести ответ с учетом регистра', |
| 78 | 78 | 'en' => 'The worker must enter the answer case sensitive', |
| 79 | 79 | ], |
| 80 | - 'field_main_name_'.$class::ACTION_FIELD_NUMERIC => [ |
|
| 80 | + 'field_main_name_' . $class::ACTION_FIELD_NUMERIC => [ |
|
| 81 | 81 | 'ru' => 'Символы', |
| 82 | 82 | 'en' => 'Characters', |
| 83 | 83 | ], |
| 84 | - 'field_main_desc_'.$class::ACTION_FIELD_NUMERIC => [ |
|
| 84 | + 'field_main_desc_' . $class::ACTION_FIELD_NUMERIC => [ |
|
| 85 | 85 | 'ru' => 'Какие символы используется в капче', |
| 86 | 86 | 'en' => 'What are the symbols used in captcha', |
| 87 | 87 | ], |
| 88 | - 'field_main_name_'.$class::ACTION_FIELD_CALC => [ |
|
| 88 | + 'field_main_name_' . $class::ACTION_FIELD_CALC => [ |
|
| 89 | 89 | 'ru' => 'Вычисление', |
| 90 | 90 | 'en' => 'Calculation', |
| 91 | 91 | ], |
| 92 | - 'field_main_desc_'.$class::ACTION_FIELD_CALC => [ |
|
| 92 | + 'field_main_desc_' . $class::ACTION_FIELD_CALC => [ |
|
| 93 | 93 | 'ru' => 'На капче изображенно математичекая выражение и её необходимо решить', |
| 94 | 94 | 'en' => 'The captcha shows matematicheskaya expression and must be addressed', |
| 95 | 95 | ], |
| 96 | - 'field_main_name_'.$class::ACTION_FIELD_MIN_LEN => [ |
|
| 96 | + 'field_main_name_' . $class::ACTION_FIELD_MIN_LEN => [ |
|
| 97 | 97 | 'ru' => 'Длина min', |
| 98 | 98 | 'en' => 'Length min', |
| 99 | 99 | ], |
| 100 | - 'field_main_desc_'.$class::ACTION_FIELD_MIN_LEN => [ |
|
| 100 | + 'field_main_desc_' . $class::ACTION_FIELD_MIN_LEN => [ |
|
| 101 | 101 | 'ru' => 'Минимальная длина капчи', |
| 102 | 102 | 'en' => 'The minimum length of captcha', |
| 103 | 103 | ], |
| 104 | - 'field_main_name_'.$class::ACTION_FIELD_MAX_LEN => [ |
|
| 104 | + 'field_main_name_' . $class::ACTION_FIELD_MAX_LEN => [ |
|
| 105 | 105 | 'ru' => 'Длина max', |
| 106 | 106 | 'en' => 'Length max', |
| 107 | 107 | ], |
| 108 | - 'field_main_desc_'.$class::ACTION_FIELD_MAX_LEN => [ |
|
| 108 | + 'field_main_desc_' . $class::ACTION_FIELD_MAX_LEN => [ |
|
| 109 | 109 | 'ru' => 'Максимальная длина капчи', |
| 110 | 110 | 'en' => 'The maximum length of the captcha', |
| 111 | 111 | ], |
| 112 | - 'field_main_name_'.$class::ACTION_FIELD_QUESTION => [ |
|
| 112 | + 'field_main_name_' . $class::ACTION_FIELD_QUESTION => [ |
|
| 113 | 113 | 'ru' => 'Вопрос', |
| 114 | 114 | 'en' => 'Question', |
| 115 | 115 | ], |
| 116 | - 'field_main_desc_'.$class::ACTION_FIELD_QUESTION => [ |
|
| 116 | + 'field_main_desc_' . $class::ACTION_FIELD_QUESTION => [ |
|
| 117 | 117 | 'ru' => 'На изображении задан вопрос, работник должен написать ответ', |
| 118 | 118 | 'en' => 'The image asked, the employee must write the answer', |
| 119 | 119 | ], |
| 120 | - 'field_main_name_'.$class::ACTION_FIELD_IS_RUSSIAN => [ |
|
| 120 | + 'field_main_name_' . $class::ACTION_FIELD_IS_RUSSIAN => [ |
|
| 121 | 121 | 'ru' => 'Кириллица', |
| 122 | 122 | 'en' => 'Cyrillic', |
| 123 | 123 | ], |
| 124 | - 'field_main_desc_'.$class::ACTION_FIELD_IS_RUSSIAN => [ |
|
| 124 | + 'field_main_desc_' . $class::ACTION_FIELD_IS_RUSSIAN => [ |
|
| 125 | 125 | 'ru' => 'На изображении присутствуют русские символы', |
| 126 | 126 | 'en' => 'In the image there are Russian characters', |
| 127 | 127 | ], |
| 128 | - 'field_main_name_'.$class::ACTION_FIELD_LANGUAGE => [ |
|
| 128 | + 'field_main_name_' . $class::ACTION_FIELD_LANGUAGE => [ |
|
| 129 | 129 | 'ru' => 'Язык', |
| 130 | 130 | 'en' => 'Language', |
| 131 | 131 | ], |
| 132 | - 'field_main_desc_'.$class::ACTION_FIELD_LANGUAGE => [ |
|
| 132 | + 'field_main_desc_' . $class::ACTION_FIELD_LANGUAGE => [ |
|
| 133 | 133 | 'ru' => 'Символы какого языка размещенны на капче', |
| 134 | 134 | 'en' => 'The symbols of the language posted on the captcha', |
| 135 | 135 | ], |
| 136 | - 'field_main_name_'.$class::ACTION_FIELD_HEADER_ACAO => [ |
|
| 136 | + 'field_main_name_' . $class::ACTION_FIELD_HEADER_ACAO => [ |
|
| 137 | 137 | 'ru' => 'Кросс-доменный', |
| 138 | 138 | 'en' => 'Cross-domain', |
| 139 | 139 | ], |
| 140 | - 'field_main_desc_'.$class::ACTION_FIELD_HEADER_ACAO => [ |
|
| 140 | + 'field_main_desc_' . $class::ACTION_FIELD_HEADER_ACAO => [ |
|
| 141 | 141 | 'ru' => 'Необходимо для кросс-доменных AJAX запросов в браузерных приложениях.', |
| 142 | 142 | 'en' => 'Need for cross-domain AJAX requests in browser-based applications.', |
| 143 | 143 | ], |
| 144 | - 'field_main_name_'.$class::ACTION_FIELD_INSTRUCTIONS => [ |
|
| 144 | + 'field_main_name_' . $class::ACTION_FIELD_INSTRUCTIONS => [ |
|
| 145 | 145 | 'ru' => 'Инструкция', |
| 146 | 146 | 'en' => 'Manual', |
| 147 | 147 | ], |
| 148 | - 'field_main_desc_'.$class::ACTION_FIELD_INSTRUCTIONS => [ |
|
| 148 | + 'field_main_desc_' . $class::ACTION_FIELD_INSTRUCTIONS => [ |
|
| 149 | 149 | 'ru' => 'Текстовая капча или инструкция для прохождения капчи.', |
| 150 | 150 | 'en' => 'Text captcha or manual to pass the captcha.', |
| 151 | 151 | ], |
| 152 | - 'field_main_name_'.$class::ACTION_FIELD_PINGBACK => [ |
|
| 152 | + 'field_main_name_' . $class::ACTION_FIELD_PINGBACK => [ |
|
| 153 | 153 | 'ru' => 'Ответ на', |
| 154 | 154 | 'en' => 'Response to', |
| 155 | 155 | ], |
| 156 | - 'field_main_desc_'.$class::ACTION_FIELD_PINGBACK => [ |
|
| 156 | + 'field_main_desc_' . $class::ACTION_FIELD_PINGBACK => [ |
|
| 157 | 157 | 'ru' => 'Указание для сервера, что после распознания изображения, нужно отправить ответ на указанный адрес.', |
| 158 | 158 | 'en' => 'Note to server, after recognizing the image, you need to send a reply to the specified address.', |
| 159 | 159 | ], |
| 160 | - 'field_main_name_'.$class::ACTION_FIELD_LABEL => [ |
|
| 160 | + 'field_main_name_' . $class::ACTION_FIELD_LABEL => [ |
|
| 161 | 161 | 'ru' => 'От куда', |
| 162 | 162 | 'en' => 'From where', |
| 163 | 163 | ], |
| 164 | - 'field_main_desc_'.$class::ACTION_FIELD_LABEL => [ |
|
| 164 | + 'field_main_desc_' . $class::ACTION_FIELD_LABEL => [ |
|
| 165 | 165 | 'ru' => 'Пояснение от куда пришла капча ("vk", "google", "recaptcha", "yandex", "mailru", "yahoo" и т.д.).', |
| 166 | 166 | 'en' => 'Clarification from where came the captcha ("vk", "google", "recaptcha", "yandex", "Google", "yahoo", etc.).', |
| 167 | 167 | ], |
| 168 | - 'field_main_name_'.$class::ACTION_FIELD_PAGEURL => [ |
|
| 168 | + 'field_main_name_' . $class::ACTION_FIELD_PAGEURL => [ |
|
| 169 | 169 | 'ru' => 'Адрес', |
| 170 | 170 | 'en' => 'Link', |
| 171 | 171 | ], |
| 172 | - 'field_main_desc_'.$class::ACTION_FIELD_PAGEURL => [ |
|
| 172 | + 'field_main_desc_' . $class::ACTION_FIELD_PAGEURL => [ |
|
| 173 | 173 | 'ru' => 'Адрес страницы на которой решается капча.', |
| 174 | 174 | 'en' => 'The address of the page where the captcha is solved.', |
| 175 | 175 | ], |
| 176 | - 'field_main_name_'.$class::ACTION_FIELD_GOOGLEKEY => [ |
|
| 176 | + 'field_main_name_' . $class::ACTION_FIELD_GOOGLEKEY => [ |
|
| 177 | 177 | 'ru' => 'Google key', |
| 178 | 178 | 'en' => 'Google key', |
| 179 | 179 | ], |
| 180 | - 'field_main_desc_'.$class::ACTION_FIELD_GOOGLEKEY => [ |
|
| 180 | + 'field_main_desc_' . $class::ACTION_FIELD_GOOGLEKEY => [ |
|
| 181 | 181 | 'ru' => 'Ключ-индентификатор рекапчи на целевой странице. <div class="g-recaptcha" data-sitekey="ВОТ_ЭТОТ"></div>', |
| 182 | 182 | 'en' => 'Key-the identifier of the recaptcha on the landing page. <div class="g-recaptcha" data-sitekey="THIS"></div>', |
| 183 | 183 | ], |
| 184 | - 'field_main_name_'.$class::ACTION_FIELD_GOOGLETOKEN => [ |
|
| 184 | + 'field_main_name_' . $class::ACTION_FIELD_GOOGLETOKEN => [ |
|
| 185 | 185 | 'ru' => 'Google token', |
| 186 | 186 | 'en' => 'Google token', |
| 187 | 187 | ], |
| 188 | - 'field_main_desc_'.$class::ACTION_FIELD_GOOGLETOKEN => [ |
|
| 188 | + 'field_main_desc_' . $class::ACTION_FIELD_GOOGLETOKEN => [ |
|
| 189 | 189 | 'ru' => 'Секретный токен для предыдущей версии рекапчи. В большинстве случаев сайты используют новую версию и этот токен не требуется. Секретный токен генерируется на сервере Google и вставляется на страницу в атрибуте data-stoken. Выглядит это примерно так: <script type="text/javascript" src="...." data-type="normal" data-ray="..." async data-sitekey="..." data-stoken="ВОТ_ЭТОТ"></script> Токен действует пару минут после генерации, затем нужно снова зайти на страницу и получить его.', |
| 190 | 190 | 'en' => 'The secret token for the previous version of recaptcha. In most cases, sites use the new version and this token is not required. The secret token is generated on a Google server and inserted into the page in the attribute data-stoken. It looks like this: <script type="text/javascript" src="...." data-type="normal" data-ray="..." async data-sitekey="..." data-stoken="THIS"></script> the Token is valid a few minutes after generation, then you need to go back to the page and get it.', |
| 191 | 191 | ], |
| 192 | - 'field_main_name_'.$class::ACTION_FIELD_INVISIBLE => [ |
|
| 192 | + 'field_main_name_' . $class::ACTION_FIELD_INVISIBLE => [ |
|
| 193 | 193 | 'ru' => 'Невидимая ReCaptcha', |
| 194 | 194 | 'en' => 'Invisible ReCaptcha', |
| 195 | 195 | ], |
| 196 | - 'field_main_desc_'.$class::ACTION_FIELD_INVISIBLE => [ |
|
| 196 | + 'field_main_desc_' . $class::ACTION_FIELD_INVISIBLE => [ |
|
| 197 | 197 | 'ru' => '1 — говорит нам, что на сайте невидимая ReCaptcha. 0 — обычная ReCaptcha.', |
| 198 | 198 | 'en' => '1 - tells us that the site is invisible ReCaptcha. 0 - regular ReCaptcha.', |
| 199 | 199 | ], |
| 200 | - 'field_main_name_'.$class::ACTION_FIELD_SSC_USER_ID => [ |
|
| 200 | + 'field_main_name_' . $class::ACTION_FIELD_SSC_USER_ID => [ |
|
| 201 | 201 | 'ru' => 'Параметра s_s_c_user_id', |
| 202 | 202 | 'en' => 'Parameter s_s_c_user_id', |
| 203 | 203 | ], |
| 204 | - 'field_main_desc_'.$class::ACTION_FIELD_SSC_USER_ID => [ |
|
| 204 | + 'field_main_desc_' . $class::ACTION_FIELD_SSC_USER_ID => [ |
|
| 205 | 205 | 'ru' => 'Значение параметра s_s_c_user_id, найденное на странице', |
| 206 | 206 | 'en' => 'The value of the s_s_c_user_id parameter found on the page', |
| 207 | 207 | ], |
| 208 | - 'field_main_name_'.$class::ACTION_FIELD_SSC_SESSION_ID => [ |
|
| 208 | + 'field_main_name_' . $class::ACTION_FIELD_SSC_SESSION_ID => [ |
|
| 209 | 209 | 'ru' => 'Параметра s_s_c_session_id', |
| 210 | 210 | 'en' => 'Parameter s_s_c_session_id', |
| 211 | 211 | ], |
| 212 | - 'field_main_desc_'.$class::ACTION_FIELD_SSC_SESSION_ID => [ |
|
| 212 | + 'field_main_desc_' . $class::ACTION_FIELD_SSC_SESSION_ID => [ |
|
| 213 | 213 | 'ru' => 'Значение параметра s_s_c_session_id, найденное на странице', |
| 214 | 214 | 'en' => 'The value of the s_s_c_session_id parameter found on the page', |
| 215 | 215 | ], |
| 216 | - 'field_main_name_'.$class::ACTION_FIELD_SSC_WEB_SERVER_SIGN => [ |
|
| 216 | + 'field_main_name_' . $class::ACTION_FIELD_SSC_WEB_SERVER_SIGN => [ |
|
| 217 | 217 | 'ru' => 'Параметра s_s_c_web_server_sign', |
| 218 | 218 | 'en' => 'Parameter s_s_c_web_server_sign', |
| 219 | 219 | ], |
| 220 | - 'field_main_desc_'.$class::ACTION_FIELD_SSC_WEB_SERVER_SIGN => [ |
|
| 220 | + 'field_main_desc_' . $class::ACTION_FIELD_SSC_WEB_SERVER_SIGN => [ |
|
| 221 | 221 | 'ru' => 'Значение параметра s_s_c_web_server_sign, найденное на странице', |
| 222 | 222 | 'en' => 'The value of the s_s_c_web_server_sign parameter found on the page', |
| 223 | 223 | ], |
| 224 | - 'field_main_name_'.$class::ACTION_FIELD_SSC_WEB_SERVER_SIGN2 => [ |
|
| 224 | + 'field_main_name_' . $class::ACTION_FIELD_SSC_WEB_SERVER_SIGN2 => [ |
|
| 225 | 225 | 'ru' => 'Параметра s_s_c_web_server_sign2', |
| 226 | 226 | 'en' => 'Parameter s_s_c_web_server_sign2', |
| 227 | 227 | ], |
| 228 | - 'field_main_desc_'.$class::ACTION_FIELD_SSC_WEB_SERVER_SIGN2 => [ |
|
| 228 | + 'field_main_desc_' . $class::ACTION_FIELD_SSC_WEB_SERVER_SIGN2 => [ |
|
| 229 | 229 | 'ru' => 'Значение параметра s_s_c_web_server_sign2, найденное на странице', |
| 230 | 230 | 'en' => 'The value of the s_s_c_web_server_sign2 parameter found on the page', |
| 231 | 231 | ], |
| 232 | - 'field_main_name_'.$class::ACTION_FIELD_PUBLICKEY => [ |
|
| 232 | + 'field_main_name_' . $class::ACTION_FIELD_PUBLICKEY => [ |
|
| 233 | 233 | 'ru' => 'Параметра data-pkey', |
| 234 | 234 | 'en' => 'Parameter data-pkey', |
| 235 | 235 | ], |
| 236 | - 'field_main_desc_'.$class::ACTION_FIELD_PUBLICKEY => [ |
|
| 236 | + 'field_main_desc_' . $class::ACTION_FIELD_PUBLICKEY => [ |
|
| 237 | 237 | 'ru' => 'Найти div с FunCaptcha и посмотреть на значение параметра data-pkey или же найти элемент с именем (name) fc-token, а из его значения вырезать ключ, который указан после pk', |
| 238 | 238 | 'en' => 'Find a div with FunCaptcha and look at the value of the data-pkey parameter, or find an element with the name (name) fc-token, and cut the key from its value after the pk', |
| 239 | 239 | ], |
| 240 | - 'field_main_name_'.$class::ACTION_FIELD_NOJS => [ |
|
| 240 | + 'field_main_name_' . $class::ACTION_FIELD_NOJS => [ |
|
| 241 | 241 | 'ru' => 'Истользовать JS', |
| 242 | 242 | 'en' => 'Истользовать JS', |
| 243 | 243 | ], |
| 244 | - 'field_main_desc_'.$class::ACTION_FIELD_NOJS => [ |
|
| 244 | + 'field_main_desc_' . $class::ACTION_FIELD_NOJS => [ |
|
| 245 | 245 | 'ru' => 'Говорит нам решать FunCaptcha с выключенным javascript. Может быть использован в случае, если нормальный метод по какой-то причине не срабатывает. Важно: имейте в виду, что в этом случае мы вернём только часть токена. Выше описано, что делать в этом случае.', |
| 246 | 246 | 'en' => 'Tells us to solve FunCaptcha with javascript turned off. It can be used in case the normal method for some reason does not work. Important: keep in mind that in this case we will return only part of the token. The above is what to do in this case.', |
| 247 | 247 | ], |
| 248 | - 'field_main_name_'.$class::ACTION_FIELD_MIN_SCORE => [ |
|
| 248 | + 'field_main_name_' . $class::ACTION_FIELD_MIN_SCORE => [ |
|
| 249 | 249 | 'ru' => 'Минимальный рейтинг', |
| 250 | 250 | 'en' => 'Min rating', |
| 251 | 251 | ], |
| 252 | - 'field_main_desc_'.$class::ACTION_FIELD_MIN_SCORE => [ |
|
| 252 | + 'field_main_desc_' . $class::ACTION_FIELD_MIN_SCORE => [ |
|
| 253 | 253 | 'ru' => 'Требуемое значение рейтинга (score). На текущий момент сложно получить токен со score выше 0.3', |
| 254 | 254 | 'en' => 'Required rating value (score). Currently it is difficult to get a token with a score above 0.3', |
| 255 | 255 | ], |
| 256 | - 'field_main_name_'.$class::ACTION_FIELD_GT => [ |
|
| 256 | + 'field_main_name_' . $class::ACTION_FIELD_GT => [ |
|
| 257 | 257 | 'ru' => 'Параметр gt', |
| 258 | 258 | 'en' => 'gt parameter', |
| 259 | 259 | ], |
| 260 | - 'field_main_desc_'.$class::ACTION_FIELD_GT => [ |
|
| 260 | + 'field_main_desc_' . $class::ACTION_FIELD_GT => [ |
|
| 261 | 261 | 'ru' => 'Значение параметра gt найденное на сайте', |
| 262 | 262 | 'en' => 'The value of the api_server parameter found on the site', |
| 263 | 263 | ], |
| 264 | - 'field_main_name_'.$class::ACTION_FIELD_CHALLENGE => [ |
|
| 264 | + 'field_main_name_' . $class::ACTION_FIELD_CHALLENGE => [ |
|
| 265 | 265 | 'ru' => 'Параметр challenge', |
| 266 | 266 | 'en' => 'challenge parameter', |
| 267 | 267 | ], |
| 268 | - 'field_main_desc_'.$class::ACTION_FIELD_CHALLENGE => [ |
|
| 268 | + 'field_main_desc_' . $class::ACTION_FIELD_CHALLENGE => [ |
|
| 269 | 269 | 'ru' => 'Значение параметра challenge найденное на сайте', |
| 270 | 270 | 'en' => 'The value of the api_server parameter found on the site', |
| 271 | 271 | ], |
| 272 | - 'field_main_name_'.$class::ACTION_FIELD_API_SERVER => [ |
|
| 272 | + 'field_main_name_' . $class::ACTION_FIELD_API_SERVER => [ |
|
| 273 | 273 | 'ru' => 'Параметр api_server', |
| 274 | 274 | 'en' => 'api_server parameter', |
| 275 | 275 | ], |
| 276 | - 'field_main_desc_'.$class::ACTION_FIELD_API_SERVER => [ |
|
| 276 | + 'field_main_desc_' . $class::ACTION_FIELD_API_SERVER => [ |
|
| 277 | 277 | 'ru' => 'Значение параметра api_server найденное на сайте', |
| 278 | 278 | 'en' => 'The value of the api_server parameter found on the site', |
| 279 | 279 | ], |
| 280 | - 'field_main_name_'.$class::ACTION_FIELD_PROXYTYPE => [ |
|
| 280 | + 'field_main_name_' . $class::ACTION_FIELD_PROXYTYPE => [ |
|
| 281 | 281 | 'ru' => 'Тип прокси', |
| 282 | 282 | 'en' => 'The proxy type', |
| 283 | 283 | ], |
| 284 | - 'field_main_desc_'.$class::ACTION_FIELD_PROXYTYPE => [ |
|
| 284 | + 'field_main_desc_' . $class::ACTION_FIELD_PROXYTYPE => [ |
|
| 285 | 285 | 'ru' => 'Тип прокси (http, socks4, ...)', |
| 286 | 286 | 'en' => 'The proxy type (http, socks4, ...)', |
| 287 | 287 | ], |
| 288 | - 'field_main_name_'.$class::ACTION_FIELD_PROXY => [ |
|
| 288 | + 'field_main_name_' . $class::ACTION_FIELD_PROXY => [ |
|
| 289 | 289 | 'ru' => 'Адрес прокси', |
| 290 | 290 | 'en' => 'The proxy address', |
| 291 | 291 | ], |
| 292 | - 'field_main_desc_'.$class::ACTION_FIELD_PROXY => [ |
|
| 292 | + 'field_main_desc_' . $class::ACTION_FIELD_PROXY => [ |
|
| 293 | 293 | 'ru' => 'IP адрес прокси ipv4/ipv6.', |
| 294 | 294 | 'en' => 'IP address of the proxy ipv4/ipv6.', |
| 295 | 295 | ], |
| 296 | - 'field_main_name_'.$class::ACTION_FIELD_PROXYPORT => [ |
|
| 296 | + 'field_main_name_' . $class::ACTION_FIELD_PROXYPORT => [ |
|
| 297 | 297 | 'ru' => 'Порт прокси', |
| 298 | 298 | 'en' => 'Proxy port', |
| 299 | 299 | ], |
| 300 | - 'field_main_desc_'.$class::ACTION_FIELD_PROXYPORT => [ |
|
| 300 | + 'field_main_desc_' . $class::ACTION_FIELD_PROXYPORT => [ |
|
| 301 | 301 | 'ru' => 'Порт прокси.', |
| 302 | 302 | 'en' => 'Proxy port.', |
| 303 | 303 | ], |
| 304 | - 'field_main_name_'.$class::ACTION_FIELD_PROXYLOGIN => [ |
|
| 304 | + 'field_main_name_' . $class::ACTION_FIELD_PROXYLOGIN => [ |
|
| 305 | 305 | 'ru' => 'Логин прокси', |
| 306 | 306 | 'en' => 'Login proxy', |
| 307 | 307 | ], |
| 308 | - 'field_main_desc_'.$class::ACTION_FIELD_PROXYLOGIN => [ |
|
| 308 | + 'field_main_desc_' . $class::ACTION_FIELD_PROXYLOGIN => [ |
|
| 309 | 309 | 'ru' => 'Логин от прокси-сервера.', |
| 310 | 310 | 'en' => 'Login from proxy server.', |
| 311 | 311 | ], |
| 312 | - 'field_main_name_'.$class::ACTION_FIELD_PROXYPASS => [ |
|
| 312 | + 'field_main_name_' . $class::ACTION_FIELD_PROXYPASS => [ |
|
| 313 | 313 | 'ru' => 'Пароль прокси', |
| 314 | 314 | 'en' => 'Password proxy', |
| 315 | 315 | ], |
| 316 | - 'field_main_desc_'.$class::ACTION_FIELD_PROXYPASS => [ |
|
| 316 | + 'field_main_desc_' . $class::ACTION_FIELD_PROXYPASS => [ |
|
| 317 | 317 | 'ru' => 'Пароль от прокси-сервера.', |
| 318 | 318 | 'en' => 'The password for the proxy server.', |
| 319 | 319 | ], |
| 320 | - 'field_main_name_'.$class::ACTION_FIELD_USERAGENT => [ |
|
| 320 | + 'field_main_name_' . $class::ACTION_FIELD_USERAGENT => [ |
|
| 321 | 321 | 'ru' => 'User-Agent браузера', |
| 322 | 322 | 'en' => 'User-Agent browser', |
| 323 | 323 | ], |
| 324 | - 'field_main_desc_'.$class::ACTION_FIELD_USERAGENT => [ |
|
| 324 | + 'field_main_desc_' . $class::ACTION_FIELD_USERAGENT => [ |
|
| 325 | 325 | 'ru' => 'User-Agent браузера, используемый в эмуляции. Необходимо использовать подпись современного браузера, иначе Google будет возвращать ошибку, требуя обновить браузер.', |
| 326 | 326 | 'en' => 'User-Agent browser used in emulation. You must use the signature modern browser, otherwise Google will return an error requiring you to upgrade your browser.', |
| 327 | 327 | ], |
| 328 | - 'field_main_name_'.$class::ACTION_FIELD_COOKIES => [ |
|
| 328 | + 'field_main_name_' . $class::ACTION_FIELD_COOKIES => [ |
|
| 329 | 329 | 'ru' => 'Куки', |
| 330 | 330 | 'en' => 'Cookies', |
| 331 | 331 | ], |
| 332 | - 'field_main_desc_'.$class::ACTION_FIELD_COOKIES => [ |
|
| 332 | + 'field_main_desc_' . $class::ACTION_FIELD_COOKIES => [ |
|
| 333 | 333 | 'ru' => 'Дополнительные cookies которые мы должны использовать во время взаимодействия с целевой страницей.', |
| 334 | 334 | 'en' => 'Additional cookies which we should use during the interaction with the target page.', |
| 335 | 335 | ], |
@@ -500,7 +500,7 @@ discard block |
||
| 500 | 500 | */ |
| 501 | 501 | public function getText($name, $separator = '; ') |
| 502 | 502 | { |
| 503 | - $getResult = function ($name, $texts) { |
|
| 503 | + $getResult = function($name, $texts) { |
|
| 504 | 504 | if (is_array($name)) { |
| 505 | 505 | $name = implode('_', $name); |
| 506 | 506 | } |
@@ -529,17 +529,17 @@ discard block |
||
| 529 | 529 | |
| 530 | 530 | protected function viewInstall() |
| 531 | 531 | { |
| 532 | - $str = "{$this->getText(['install', 'preferred'])} [composer](http://getcomposer.org/download/).".PHP_EOL; |
|
| 532 | + $str = "{$this->getText(['install', 'preferred'])} [composer](http://getcomposer.org/download/)." . PHP_EOL; |
|
| 533 | 533 | $str .= PHP_EOL; |
| 534 | - $str .= "{$this->getText(['install', 'start'])}".PHP_EOL; |
|
| 535 | - $str .= '```'.PHP_EOL; |
|
| 536 | - $str .= 'composer require --prefer-dist jumper423/decaptcha "*"'.PHP_EOL; |
|
| 537 | - $str .= '```'.PHP_EOL; |
|
| 538 | - $str .= "{$this->getText(['install', 'add'])}".PHP_EOL; |
|
| 539 | - $str .= '```'.PHP_EOL; |
|
| 540 | - $str .= '"jumper423/decaptcha": "*"'.PHP_EOL; |
|
| 541 | - $str .= '```'.PHP_EOL; |
|
| 542 | - $str .= "{$this->getText(['install', 'add', 'file'])} `composer.json`.".PHP_EOL; |
|
| 534 | + $str .= "{$this->getText(['install', 'start'])}" . PHP_EOL; |
|
| 535 | + $str .= '```' . PHP_EOL; |
|
| 536 | + $str .= 'composer require --prefer-dist jumper423/decaptcha "*"' . PHP_EOL; |
|
| 537 | + $str .= '```' . PHP_EOL; |
|
| 538 | + $str .= "{$this->getText(['install', 'add'])}" . PHP_EOL; |
|
| 539 | + $str .= '```' . PHP_EOL; |
|
| 540 | + $str .= '"jumper423/decaptcha": "*"' . PHP_EOL; |
|
| 541 | + $str .= '```' . PHP_EOL; |
|
| 542 | + $str .= "{$this->getText(['install', 'add', 'file'])} `composer.json`." . PHP_EOL; |
|
| 543 | 543 | |
| 544 | 544 | return $str; |
| 545 | 545 | } |
@@ -549,71 +549,71 @@ discard block |
||
| 549 | 549 | $class = $this->class; |
| 550 | 550 | $reflection = (new \ReflectionClass($class)); |
| 551 | 551 | |
| 552 | - $str = "__{$this->getText(['example', 'initialization'])}__".PHP_EOL; |
|
| 553 | - $str .= "{$this->getText(['example', 'initialization', 'desc'])}".PHP_EOL; |
|
| 554 | - $str .= '```'.PHP_EOL; |
|
| 555 | - $str .= "use {$reflection->getName()};".PHP_EOL; |
|
| 556 | - $str .= ''.PHP_EOL; |
|
| 557 | - $str .= '$captcha = new '.$reflection->getShortName().'(['.PHP_EOL; |
|
| 552 | + $str = "__{$this->getText(['example', 'initialization'])}__" . PHP_EOL; |
|
| 553 | + $str .= "{$this->getText(['example', 'initialization', 'desc'])}" . PHP_EOL; |
|
| 554 | + $str .= '```' . PHP_EOL; |
|
| 555 | + $str .= "use {$reflection->getName()};" . PHP_EOL; |
|
| 556 | + $str .= '' . PHP_EOL; |
|
| 557 | + $str .= '$captcha = new ' . $reflection->getShortName() . '([' . PHP_EOL; |
|
| 558 | 558 | foreach ($this->texts['constructor_data'] as $key => $val) { |
| 559 | 559 | $str .= " {$reflection->getShortName()}::{$this->getNameConst('ACTION_FIELD_', $key)} => "; |
| 560 | 560 | $str .= is_string($val) ? "'{$val}'" : $val; |
| 561 | - $str .= ','.PHP_EOL; |
|
| 561 | + $str .= ',' . PHP_EOL; |
|
| 562 | 562 | } |
| 563 | - $str .= ']);'.PHP_EOL; |
|
| 564 | - $str .= '```'.PHP_EOL; |
|
| 563 | + $str .= ']);' . PHP_EOL; |
|
| 564 | + $str .= '```' . PHP_EOL; |
|
| 565 | 565 | |
| 566 | - $str .= "__{$this->getText(['example', 'recognize'])}__".PHP_EOL; |
|
| 567 | - $str .= "{$this->getText(['example', 'recognize', 'desc'])}".PHP_EOL; |
|
| 568 | - $str .= '```'.PHP_EOL; |
|
| 566 | + $str .= "__{$this->getText(['example', 'recognize'])}__" . PHP_EOL; |
|
| 567 | + $str .= "{$this->getText(['example', 'recognize', 'desc'])}" . PHP_EOL; |
|
| 568 | + $str .= '```' . PHP_EOL; |
|
| 569 | 569 | $str .= 'if ($captcha->recognize('; |
| 570 | 570 | $str .= $this->getRecognizeFile(); |
| 571 | 571 | $str .= $this->getRecognizeData(); |
| 572 | - $str .= ')) {'.PHP_EOL; |
|
| 573 | - $str .= ' $code = $captcha->getCode();'.PHP_EOL; |
|
| 574 | - $str .= '} else {'.PHP_EOL; |
|
| 575 | - $str .= ' $error = $captcha->getError();'.PHP_EOL; |
|
| 576 | - $str .= '}'.PHP_EOL; |
|
| 577 | - $str .= '```'.PHP_EOL; |
|
| 572 | + $str .= ')) {' . PHP_EOL; |
|
| 573 | + $str .= ' $code = $captcha->getCode();' . PHP_EOL; |
|
| 574 | + $str .= '} else {' . PHP_EOL; |
|
| 575 | + $str .= ' $error = $captcha->getError();' . PHP_EOL; |
|
| 576 | + $str .= '}' . PHP_EOL; |
|
| 577 | + $str .= '```' . PHP_EOL; |
|
| 578 | 578 | |
| 579 | 579 | if (in_array('notTrue', get_class_methods($class))) { |
| 580 | - $str .= "__{$this->getText(['example', 'nottrue'])}__".PHP_EOL; |
|
| 581 | - $str .= "{$this->getText(['example', 'nottrue', 'desc'])}".PHP_EOL; |
|
| 582 | - $str .= '```'.PHP_EOL; |
|
| 583 | - $str .= '$captcha->notTrue();'.PHP_EOL; |
|
| 584 | - $str .= '```'.PHP_EOL; |
|
| 580 | + $str .= "__{$this->getText(['example', 'nottrue'])}__" . PHP_EOL; |
|
| 581 | + $str .= "{$this->getText(['example', 'nottrue', 'desc'])}" . PHP_EOL; |
|
| 582 | + $str .= '```' . PHP_EOL; |
|
| 583 | + $str .= '$captcha->notTrue();' . PHP_EOL; |
|
| 584 | + $str .= '```' . PHP_EOL; |
|
| 585 | 585 | } |
| 586 | 586 | |
| 587 | 587 | if (in_array('getBalance', get_class_methods($class))) { |
| 588 | - $str .= "__{$this->getText(['example', 'balance'])}__".PHP_EOL; |
|
| 589 | - $str .= '```'.PHP_EOL; |
|
| 590 | - $str .= '$balance = $captcha->getBalance();'.PHP_EOL; |
|
| 591 | - $str .= '```'.PHP_EOL; |
|
| 588 | + $str .= "__{$this->getText(['example', 'balance'])}__" . PHP_EOL; |
|
| 589 | + $str .= '```' . PHP_EOL; |
|
| 590 | + $str .= '$balance = $captcha->getBalance();' . PHP_EOL; |
|
| 591 | + $str .= '```' . PHP_EOL; |
|
| 592 | 592 | } |
| 593 | 593 | |
| 594 | 594 | if ($this->getText(['example', 'error', 'lang', 'if'])) { |
| 595 | - $str .= "__{$this->getText(['example', 'error', 'lang'])}__".PHP_EOL; |
|
| 596 | - $str .= "{$this->getText(['example', 'error', 'lang', 'desc'])}".PHP_EOL; |
|
| 597 | - $str .= '```'.PHP_EOL; |
|
| 598 | - $str .= '$captcha->setErrorLang(\jumper423\decaptcha\core\DeCaptchaErrors::LANG_RU);'.PHP_EOL; |
|
| 599 | - $str .= '```'.PHP_EOL; |
|
| 595 | + $str .= "__{$this->getText(['example', 'error', 'lang'])}__" . PHP_EOL; |
|
| 596 | + $str .= "{$this->getText(['example', 'error', 'lang', 'desc'])}" . PHP_EOL; |
|
| 597 | + $str .= '```' . PHP_EOL; |
|
| 598 | + $str .= '$captcha->setErrorLang(\jumper423\decaptcha\core\DeCaptchaErrors::LANG_RU);' . PHP_EOL; |
|
| 599 | + $str .= '```' . PHP_EOL; |
|
| 600 | 600 | } |
| 601 | 601 | |
| 602 | - $str .= "__{$this->getText(['example', 'error', 'interception'])}__".PHP_EOL; |
|
| 603 | - $str .= "{$this->getText(['example', 'error', 'interception', 'desc'])}".PHP_EOL; |
|
| 604 | - $str .= '```'.PHP_EOL; |
|
| 605 | - $str .= '$captcha->setCauseAnError(true);'.PHP_EOL; |
|
| 602 | + $str .= "__{$this->getText(['example', 'error', 'interception'])}__" . PHP_EOL; |
|
| 603 | + $str .= "{$this->getText(['example', 'error', 'interception', 'desc'])}" . PHP_EOL; |
|
| 604 | + $str .= '```' . PHP_EOL; |
|
| 605 | + $str .= '$captcha->setCauseAnError(true);' . PHP_EOL; |
|
| 606 | 606 | $str .= PHP_EOL; |
| 607 | - $str .= 'try {'.PHP_EOL; |
|
| 607 | + $str .= 'try {' . PHP_EOL; |
|
| 608 | 608 | $str .= ' $captcha->recognize('; |
| 609 | 609 | $str .= $this->getRecognizeFile(); |
| 610 | 610 | $str .= $this->getRecognizeData(); |
| 611 | - $str .= ');'.PHP_EOL; |
|
| 612 | - $str .= ' $code = $captcha->getCode();'.PHP_EOL; |
|
| 613 | - $str .= '} catch (\jumper423\decaptcha\core\DeCaptchaErrors $e) {'.PHP_EOL; |
|
| 614 | - $str .= ' ...'.PHP_EOL; |
|
| 615 | - $str .= '}'.PHP_EOL; |
|
| 616 | - $str .= '```'.PHP_EOL; |
|
| 611 | + $str .= ');' . PHP_EOL; |
|
| 612 | + $str .= ' $code = $captcha->getCode();' . PHP_EOL; |
|
| 613 | + $str .= '} catch (\jumper423\decaptcha\core\DeCaptchaErrors $e) {' . PHP_EOL; |
|
| 614 | + $str .= ' ...' . PHP_EOL; |
|
| 615 | + $str .= '}' . PHP_EOL; |
|
| 616 | + $str .= '```' . PHP_EOL; |
|
| 617 | 617 | |
| 618 | 618 | return $str; |
| 619 | 619 | } |
@@ -627,11 +627,11 @@ discard block |
||
| 627 | 627 | if ($this->texts['recognize_file']) { |
| 628 | 628 | $str .= ', '; |
| 629 | 629 | } |
| 630 | - $str .= '['.PHP_EOL; |
|
| 630 | + $str .= '[' . PHP_EOL; |
|
| 631 | 631 | foreach ($this->texts['recognize_data'] as $key => $val) { |
| 632 | 632 | $str .= " {$reflection->getShortName()}::{$this->getNameConst('ACTION_FIELD_', $key)} => "; |
| 633 | 633 | $str .= is_string($val) ? "'{$val}'" : $val; |
| 634 | - $str .= ','.PHP_EOL; |
|
| 634 | + $str .= ',' . PHP_EOL; |
|
| 635 | 635 | } |
| 636 | 636 | $str .= ' ]'; |
| 637 | 637 | } |
@@ -651,8 +651,8 @@ discard block |
||
| 651 | 651 | protected function viewFields() |
| 652 | 652 | { |
| 653 | 653 | $class = $this->class; |
| 654 | - $str = " {$this->getText(['table', 'th', 'name'])} | {$this->getText(['table', 'th', 'code'])} | {$this->getText(['table', 'th', 'type'])} | {$this->getText(['table', 'th', 'req'])} | {$this->getText(['table', 'th', 'def'])} | {$this->getText(['table', 'th', 'enum'])} | {$this->getText(['table', 'th', 'desc'])} ".PHP_EOL; |
|
| 655 | - $str .= ' --- | --- | --- | --- | --- | --- | --- '.PHP_EOL; |
|
| 654 | + $str = " {$this->getText(['table', 'th', 'name'])} | {$this->getText(['table', 'th', 'code'])} | {$this->getText(['table', 'th', 'type'])} | {$this->getText(['table', 'th', 'req'])} | {$this->getText(['table', 'th', 'def'])} | {$this->getText(['table', 'th', 'enum'])} | {$this->getText(['table', 'th', 'desc'])} " . PHP_EOL; |
|
| 655 | + $str .= ' --- | --- | --- | --- | --- | --- | --- ' . PHP_EOL; |
|
| 656 | 656 | foreach ($this->class->actions[$class::ACTION_RECOGNIZE][$class::ACTION_FIELDS] as $param => $setting) { |
| 657 | 657 | if (array_key_exists($class::ACTION_FIELDS, $setting) && is_array($setting[$class::ACTION_FIELDS])) { |
| 658 | 658 | foreach ($setting[$class::ACTION_FIELDS] as $param1 => $setting1) { |
@@ -676,9 +676,9 @@ discard block |
||
| 676 | 676 | $class = $this->class; |
| 677 | 677 | $str = " {$this->getText(['field', 'main', 'name', $param])} |"; |
| 678 | 678 | $str .= " {$this->getNameConst('ACTION_FIELD_', $param)} |"; |
| 679 | - $str .= ' '.substr($this->getNameConst('PARAM_FIELD_TYPE_', $setting[$class::PARAM_SLUG_TYPE]), 17).' |'; |
|
| 680 | - $str .= ' '.(array_key_exists($class::PARAM_SLUG_REQUIRE, $setting) ? '+' : '-').' |'; |
|
| 681 | - $str .= ' '.(array_key_exists($class::PARAM_SLUG_DEFAULT, $setting) ? $setting[$class::PARAM_SLUG_DEFAULT] : '').' |'; |
|
| 679 | + $str .= ' ' . substr($this->getNameConst('PARAM_FIELD_TYPE_', $setting[$class::PARAM_SLUG_TYPE]), 17) . ' |'; |
|
| 680 | + $str .= ' ' . (array_key_exists($class::PARAM_SLUG_REQUIRE, $setting) ? '+' : '-') . ' |'; |
|
| 681 | + $str .= ' ' . (array_key_exists($class::PARAM_SLUG_DEFAULT, $setting) ? $setting[$class::PARAM_SLUG_DEFAULT] : '') . ' |'; |
|
| 682 | 682 | $str .= " {$this->getText(['field', 'slug', $class::PARAM_SLUG_ENUM, $param])} |"; |
| 683 | 683 | $str .= " {$this->getText(['field', 'main', 'desc', $param])} |"; |
| 684 | 684 | $str .= PHP_EOL; |
@@ -688,9 +688,9 @@ discard block |
||
| 688 | 688 | |
| 689 | 689 | protected function viewMenu() |
| 690 | 690 | { |
| 691 | - $str = "+ [{$this->getText(['slug', 'menu', 'main'])}](../docs/README-{$this->lang}.md)".PHP_EOL; |
|
| 692 | - $str .= "+ [{$this->getText(['slug', 'menu', 'another'])}](../docs/".$this->getFileName($this->lang == 'ru' ? 'en' : 'ru').')'.PHP_EOL; |
|
| 693 | - $str .= "+ {$this->getText(['slug', 'menu', 'anchor'])}".PHP_EOL; |
|
| 691 | + $str = "+ [{$this->getText(['slug', 'menu', 'main'])}](../docs/README-{$this->lang}.md)" . PHP_EOL; |
|
| 692 | + $str .= "+ [{$this->getText(['slug', 'menu', 'another'])}](../docs/" . $this->getFileName($this->lang == 'ru' ? 'en' : 'ru') . ')' . PHP_EOL; |
|
| 693 | + $str .= "+ {$this->getText(['slug', 'menu', 'anchor'])}" . PHP_EOL; |
|
| 694 | 694 | foreach ([ |
| 695 | 695 | ['slug', 'link'], |
| 696 | 696 | ['slug', 'service', 'desc'], |
@@ -700,14 +700,14 @@ discard block |
||
| 700 | 700 | ['example'], |
| 701 | 701 | ['slug', 'fields', 'desc'], |
| 702 | 702 | ] as $anchor) { |
| 703 | - $str .= " + [{$this->getText($anchor)}](#".implode('-', explode(' ', ($this->lang === 'en' ? mb_strtolower($this->getText($anchor)) : $this->getText($anchor)))).')'.PHP_EOL; |
|
| 703 | + $str .= " + [{$this->getText($anchor)}](#" . implode('-', explode(' ', ($this->lang === 'en' ? mb_strtolower($this->getText($anchor)) : $this->getText($anchor)))) . ')' . PHP_EOL; |
|
| 704 | 704 | } |
| 705 | 705 | if ($this->getText(['menu', 'from_service'])) { |
| 706 | - $str .= "+ {$this->getText(['slug', 'menu', 'from_service'])}".PHP_EOL; |
|
| 706 | + $str .= "+ {$this->getText(['slug', 'menu', 'from_service'])}" . PHP_EOL; |
|
| 707 | 707 | foreach ($this->texts['menu_from_service'] as $fromServiceClass) { |
| 708 | 708 | $fromServiceObject = new $fromServiceClass([]); |
| 709 | 709 | $fromServiceObjectWiki = $fromServiceObject->getWiki($this->lang); |
| 710 | - $str .= " + [{$fromServiceObjectWiki->getText(['service', 'name'])}](../docs/{$fromServiceObjectWiki->getFileName()})".PHP_EOL; |
|
| 710 | + $str .= " + [{$fromServiceObjectWiki->getText(['service', 'name'])}](../docs/{$fromServiceObjectWiki->getFileName()})" . PHP_EOL; |
|
| 711 | 711 | } |
| 712 | 712 | } |
| 713 | 713 | |
@@ -729,32 +729,32 @@ discard block |
||
| 729 | 729 | |
| 730 | 730 | public function view() |
| 731 | 731 | { |
| 732 | - $str = $this->getText(['service', 'name']).PHP_EOL; |
|
| 733 | - $str .= '=============='.PHP_EOL; |
|
| 734 | - $str .= "{$this->getText(['slug', 'menu'])}".PHP_EOL; |
|
| 735 | - $str .= '--------------'.PHP_EOL; |
|
| 736 | - $str .= $this->viewMenu().PHP_EOL.PHP_EOL; |
|
| 737 | - $str .= "{$this->getText(['slug', 'link'])}".PHP_EOL; |
|
| 738 | - $str .= '--------------'.PHP_EOL; |
|
| 739 | - $str .= "[{$this->getText(['slug', 'link', 'to_service'])} {$this->getText(['service', 'name'])}]({$this->getText(['service', 'href'])})".PHP_EOL.PHP_EOL; |
|
| 740 | - $str .= "{$this->getText(['slug', 'service', 'desc'])}".PHP_EOL; |
|
| 741 | - $str .= '--------------'.PHP_EOL; |
|
| 742 | - $str .= "{$this->getText(['service', 'desc'])}".PHP_EOL.PHP_EOL; |
|
| 743 | - $str .= "{$this->getText(['slug', 'price'])}".PHP_EOL; |
|
| 744 | - $str .= '--------------'.PHP_EOL; |
|
| 745 | - $str .= "{$this->getText(['recognize', 'price'])}".PHP_EOL.PHP_EOL; |
|
| 746 | - $str .= "{$this->getText(['slug', 'recognize', 'desc'])}".PHP_EOL; |
|
| 747 | - $str .= '--------------'.PHP_EOL; |
|
| 748 | - $str .= "{$this->getText(['recognize', 'desc'])}".PHP_EOL.PHP_EOL; |
|
| 749 | - $str .= "{$this->getText(['install'])}".PHP_EOL; |
|
| 750 | - $str .= '--------------'.PHP_EOL; |
|
| 751 | - $str .= "{$this->viewInstall()}".PHP_EOL.PHP_EOL; |
|
| 752 | - $str .= "{$this->getText(['example'])}".PHP_EOL; |
|
| 753 | - $str .= '--------------'.PHP_EOL; |
|
| 754 | - $str .= "{$this->viewExamples()}".PHP_EOL.PHP_EOL; |
|
| 755 | - $str .= "{$this->getText(['slug', 'fields', 'desc'])}".PHP_EOL; |
|
| 756 | - $str .= '--------------'.PHP_EOL; |
|
| 757 | - $str .= $this->viewFields().PHP_EOL; |
|
| 732 | + $str = $this->getText(['service', 'name']) . PHP_EOL; |
|
| 733 | + $str .= '==============' . PHP_EOL; |
|
| 734 | + $str .= "{$this->getText(['slug', 'menu'])}" . PHP_EOL; |
|
| 735 | + $str .= '--------------' . PHP_EOL; |
|
| 736 | + $str .= $this->viewMenu() . PHP_EOL . PHP_EOL; |
|
| 737 | + $str .= "{$this->getText(['slug', 'link'])}" . PHP_EOL; |
|
| 738 | + $str .= '--------------' . PHP_EOL; |
|
| 739 | + $str .= "[{$this->getText(['slug', 'link', 'to_service'])} {$this->getText(['service', 'name'])}]({$this->getText(['service', 'href'])})" . PHP_EOL . PHP_EOL; |
|
| 740 | + $str .= "{$this->getText(['slug', 'service', 'desc'])}" . PHP_EOL; |
|
| 741 | + $str .= '--------------' . PHP_EOL; |
|
| 742 | + $str .= "{$this->getText(['service', 'desc'])}" . PHP_EOL . PHP_EOL; |
|
| 743 | + $str .= "{$this->getText(['slug', 'price'])}" . PHP_EOL; |
|
| 744 | + $str .= '--------------' . PHP_EOL; |
|
| 745 | + $str .= "{$this->getText(['recognize', 'price'])}" . PHP_EOL . PHP_EOL; |
|
| 746 | + $str .= "{$this->getText(['slug', 'recognize', 'desc'])}" . PHP_EOL; |
|
| 747 | + $str .= '--------------' . PHP_EOL; |
|
| 748 | + $str .= "{$this->getText(['recognize', 'desc'])}" . PHP_EOL . PHP_EOL; |
|
| 749 | + $str .= "{$this->getText(['install'])}" . PHP_EOL; |
|
| 750 | + $str .= '--------------' . PHP_EOL; |
|
| 751 | + $str .= "{$this->viewInstall()}" . PHP_EOL . PHP_EOL; |
|
| 752 | + $str .= "{$this->getText(['example'])}" . PHP_EOL; |
|
| 753 | + $str .= '--------------' . PHP_EOL; |
|
| 754 | + $str .= "{$this->viewExamples()}" . PHP_EOL . PHP_EOL; |
|
| 755 | + $str .= "{$this->getText(['slug', 'fields', 'desc'])}" . PHP_EOL; |
|
| 756 | + $str .= '--------------' . PHP_EOL; |
|
| 757 | + $str .= $this->viewFields() . PHP_EOL; |
|
| 758 | 758 | |
| 759 | 759 | return $str; |
| 760 | 760 | } |
@@ -766,11 +766,11 @@ discard block |
||
| 766 | 766 | } |
| 767 | 767 | $class = $this->class; |
| 768 | 768 | |
| 769 | - return (new \ReflectionClass($class))->getShortName().'-'.$lang.'.md'; |
|
| 769 | + return (new \ReflectionClass($class))->getShortName() . '-' . $lang . '.md'; |
|
| 770 | 770 | } |
| 771 | 771 | |
| 772 | 772 | public function save() |
| 773 | 773 | { |
| 774 | - file_put_contents(__DIR__.'/../../docs/'.$this->getFileName(), $this->view()); |
|
| 774 | + file_put_contents(__DIR__ . '/../../docs/' . $this->getFileName(), $this->view()); |
|
| 775 | 775 | } |
| 776 | 776 | } |