add empik module

This commit is contained in:
2025-05-30 09:08:26 +02:00
parent 87a41f4cfc
commit 56aa2cdc2d
1466 changed files with 138249 additions and 146 deletions

View File

@@ -0,0 +1,37 @@
<?php
use Empik\Marketplace\Exception\InvalidActionException;
use Empik\Marketplace\Handler\CronJobsHandler;
class EmpikMarketplaceCronModuleFrontController extends ModuleFrontController
{
/** @var EmpikMarketplace */
public $module;
/** @var CronJobsHandler */
protected $cronJobsHandler;
public function init()
{
parent::init();
$this->cronJobsHandler = $this->module->getService('empik.marketplace.handler.cronJobs');
}
public function postProcess()
{
if ($this->cronJobsHandler->checkToken(Tools::getValue('token'))) {
try {
$this->cronJobsHandler->handle(Tools::getValue('action'));
die($this->module->l('Job complete'));
} catch (InvalidActionException $exception) {
die($this->module->l('Unknown action'));
} catch (Exception $exception) {
die(sprintf($this->module->l('Job failed: %s'), $exception->getMessage()));
}
} else {
die($this->module->l('Invalid token'));
}
}
}

View File

@@ -0,0 +1,11 @@
<?php
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;