first commit

This commit is contained in:
2024-12-17 13:43:22 +01:00
commit 8e6cd8b410
21292 changed files with 3514826 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
<?php
/**
* 2007-2020 PrestaShop.
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
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;

View File

@@ -0,0 +1,23 @@
<?php
use PrestaShop\Module\PsEventbus\Controller\AbstractApiController;
use PrestaShop\Module\PsEventbus\Provider\CartDataProvider;
class ps_EventbusApiCartsModuleFrontController extends AbstractApiController
{
public $type = 'carts';
/**
* @throws PrestaShopException
*
* @return void
*/
public function postProcess()
{
$cartDataProvider = $this->module->getService(CartDataProvider::class);
$response = $this->handleDataSync($cartDataProvider);
$this->exitWithResponse($response);
}
}

View File

@@ -0,0 +1,23 @@
<?php
use PrestaShop\Module\PsEventbus\Controller\AbstractApiController;
use PrestaShop\Module\PsEventbus\Provider\CategoryDataProvider;
class ps_EventbusApiCategoriesModuleFrontController extends AbstractApiController
{
public $type = 'categories';
/**
* @throws PrestaShopException
*
* @return void
*/
public function postProcess()
{
$categoryDataProvider = $this->module->getService(CategoryDataProvider::class);
$response = $this->handleDataSync($categoryDataProvider);
$this->exitWithResponse($response);
}
}

View File

@@ -0,0 +1,30 @@
<?php
use PrestaShop\Module\PsEventbus\Controller\AbstractApiController;
use PrestaShop\Module\PsEventbus\Exception\EnvVarException;
use PrestaShop\Module\PsEventbus\Service\DeletedObjectsService;
class ps_EventbusApiDeletedObjectsModuleFrontController extends AbstractApiController
{
public $type = 'deleted';
/**
* @return void
*/
public function postProcess()
{
$jobId = Tools::getValue('job_id', '');
/** @var DeletedObjectsService $deletedObjectsService */
$deletedObjectsService = $this->module->getService(DeletedObjectsService::class);
try {
$response = $deletedObjectsService->handleDeletedObjectsSync($jobId);
$this->exitWithResponse($response);
} catch (PrestaShopDatabaseException $exception) {
$this->exitWithExceptionMessage($exception);
} catch (EnvVarException $exception) {
$this->exitWithExceptionMessage($exception);
}
}
}

View File

@@ -0,0 +1,28 @@
<?php
use PrestaShop\Module\PsEventbus\Config\Config;
use PrestaShop\Module\PsEventbus\Controller\AbstractApiController;
use PrestaShop\Module\PsEventbus\Provider\GoogleTaxonomyDataProvider;
class ps_EventbusApiGoogleTaxonomiesModuleFrontController extends AbstractApiController
{
public $type = 'taxonomies';
/**
* @throws PrestaShopException
*
* @return void
*/
public function postProcess()
{
if (!Module::isInstalled('ps_facebook')) {
$this->exitWithExceptionMessage(new Exception('Facebook module is not installed', Config::PS_FACEBOOK_NOT_INSTALLED));
}
$categoryDataProvider = $this->module->getService(GoogleTaxonomyDataProvider::class);
$response = $this->handleDataSync($categoryDataProvider);
$this->exitWithResponse($response);
}
}

View File

@@ -0,0 +1,26 @@
<?php
use PrestaShop\Module\PsEventbus\Controller\AbstractApiController;
use PrestaShop\Module\PsEventbus\Repository\ServerInformationRepository;
class ps_EventbusApiHealthCheckModuleFrontController extends AbstractApiController
{
public $type = 'shops';
public function init()
{
}
/**
* @return void
*/
public function postProcess()
{
/** @var ServerInformationRepository $serverInformationRepository */
$serverInformationRepository = $this->module->getService(ServerInformationRepository::class);
$status = $serverInformationRepository->getHealthCheckData();
$this->exitWithResponse($status);
}
}

View File

@@ -0,0 +1,44 @@
<?php
use PrestaShop\Module\PsEventbus\Controller\AbstractApiController;
use PrestaShop\Module\PsEventbus\Exception\EnvVarException;
use PrestaShop\Module\PsEventbus\Repository\ServerInformationRepository;
class ps_EventbusApiInfoModuleFrontController extends AbstractApiController
{
public $type = 'shops';
/**
* @throws PrestaShopException
*
* @return void
*/
public function postProcess()
{
$response = [];
$jobId = Tools::getValue('job_id');
$serverInformationRepository = $this->module->getService(ServerInformationRepository::class);
$serverInfo = $serverInformationRepository->getServerInformation(Tools::getValue('lang_iso', null));
try {
$response = $this->proxyService->upload($jobId, $serverInfo, $this->startTime);
} catch (EnvVarException $exception) {
$this->exitWithExceptionMessage($exception);
} catch (Exception $exception) {
$this->exitWithExceptionMessage($exception);
}
$this->exitWithResponse(
array_merge(
[
'remaining_objects' => 0,
'total_objects' => 1,
],
$response
)
);
}
}

View File

@@ -0,0 +1,26 @@
<?php
use PrestaShop\Module\PsEventbus\Controller\AbstractApiController;
use PrestaShop\Module\PsEventbus\Provider\ModuleDataProvider;
use PrestaShop\Module\PsEventbus\Repository\ModuleRepository;
class ps_EventbusApiModulesModuleFrontController extends AbstractApiController
{
public $type = 'modules';
/**
* @throws PrestaShopException
*
* @return void
*/
public function postProcess()
{
$moduleDataProvider = new ModuleDataProvider(
new ModuleRepository(Db::getInstance())
);
$response = $this->handleDataSync($moduleDataProvider);
$this->exitWithResponse($response);
}
}

View File

@@ -0,0 +1,23 @@
<?php
use PrestaShop\Module\PsEventbus\Controller\AbstractApiController;
use PrestaShop\Module\PsEventbus\Provider\OrderDataProvider;
class ps_EventbusApiOrdersModuleFrontController extends AbstractApiController
{
public $type = 'orders';
/**
* @throws PrestaShopException
*
* @return void
*/
public function postProcess()
{
$orderDataProvider = $this->module->getService(OrderDataProvider::class);
$response = $this->handleDataSync($orderDataProvider);
$this->exitWithResponse($response);
}
}

View File

@@ -0,0 +1,23 @@
<?php
use PrestaShop\Module\PsEventbus\Controller\AbstractApiController;
use PrestaShop\Module\PsEventbus\Provider\ProductDataProvider;
class ps_EventbusApiProductsModuleFrontController extends AbstractApiController
{
public $type = 'products';
/**
* @throws PrestaShopException
*
* @return void
*/
public function postProcess()
{
$productDataProvider = $this->module->getService(ProductDataProvider::class);
$response = $this->handleDataSync($productDataProvider);
$this->exitWithResponse($response);
}
}

View File

@@ -0,0 +1,42 @@
<?php
use PrestaShop\Module\PsEventbus\Controller\AbstractApiController;
use PrestaShop\Module\PsEventbus\Exception\EnvVarException;
use PrestaShop\Module\PsEventbus\Repository\ThemeRepository;
class ps_EventbusApiThemesModuleFrontController extends AbstractApiController
{
public $type = 'themes';
/**
* @return void
*/
public function postProcess()
{
$response = [];
$jobId = Tools::getValue('job_id');
$themeRepository = $this->module->getService(ThemeRepository::class);
$themeInfo = $themeRepository->getThemes();
try {
$response = $this->proxyService->upload($jobId, $themeInfo, $this->startTime);
} catch (EnvVarException $exception) {
$this->exitWithExceptionMessage($exception);
} catch (Exception $exception) {
$this->exitWithExceptionMessage($exception);
}
$this->exitWithResponse(
array_merge(
[
'remaining_objects' => 0,
'total_objects' => count($themeInfo),
],
$response
)
);
}
}

View File

@@ -0,0 +1,34 @@
<?php
/**
* 2007-2020 PrestaShop.
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
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;

View File

@@ -0,0 +1,34 @@
<?php
/**
* 2007-2020 PrestaShop.
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
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;