| 1 |
<?php |
| 2 |
|
| 3 |
use Linguise\Vendor\Linguise\Script\Core\Processor; |
| 4 |
|
| 5 |
if (!defined('LINGUISE_SCRIPT_TRANSLATION')) { |
| 6 |
define('LINGUISE_SCRIPT_TRANSLATION', true); |
| 7 |
} |
| 8 |
|
| 9 |
ini_set('display_errors', false); |
| 10 |
|
| 11 |
require_once(__DIR__ . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php'); |
| 12 |
|
| 13 |
linguiseInitializeConfiguration(); |
| 14 |
|
| 15 |
$processor = new Processor(); |
| 16 |
// phpcs:disable WordPress.Security.NonceVerification.Recommended -- View request, no action |
| 17 |
if (isset($_GET['linguise_language']) && $_GET['linguise_language'] === 'zz-zz' && isset($_GET['linguise_action'])) { |
| 18 |
switch ($_GET['linguise_action']) { |
| 19 |
case 'clear-cache': |
| 20 |
$processor->clearCache(); |
| 21 |
break; |
| 22 |
case 'update-certificates': |
| 23 |
$processor->updateCertificates(); |
| 24 |
break; |
| 25 |
} |
| 26 |
} elseif ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_GET['linguise_language']) && $_GET['linguise_language'] === 'zz-zz') { |
| 27 |
$processor->editor(); |
| 28 |
} else { |
| 29 |
$processor->run(); |
| 30 |
} |
| 31 |
|