Subida del módulo y tema de PrestaShop

This commit is contained in:
Kaloyan
2026-04-09 18:31:51 +02:00
parent 12c253296f
commit 16b3ff9424
39262 changed files with 7418797 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
<?php
require __DIR__ . '/../src/enforce_autoload.php';
use PrestaShop\Module\PsAccounts\Account\Command\MigrateOrCreateIdentitiesV8Command;
use PrestaShop\Module\PsAccounts\Cqrs\CommandBus;
use PrestaShop\Module\PsAccounts\Log\Logger;
use PrestaShop\Module\PsAccounts\Service\Accounts\AccountsService;
/**
* @param Ps_accounts $module
*
* @return void
*
* @throws Exception
* @throws Throwable
*/
function migrate_or_create_identities_v8($module)
{
try {
/** @var CommandBus $commandBus */
$commandBus = $module->getService(CommandBus::class);
$commandBus->handle(
(new MigrateOrCreateIdentitiesV8Command())
->withOrigin(AccountsService::ORIGIN_UPGRADE)
);
} catch (\Exception $e) {
Logger::getInstance()->error('error during upgrade : ' . $e);
} catch (\Throwable $e) {
Logger::getInstance()->error('error during upgrade : ' . $e);
}
}

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;

View File

@@ -0,0 +1,23 @@
<?php
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License version 3.0
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* 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.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0
*/
function upgrade_module_3_2_0()
{
return true;
}

View File

@@ -0,0 +1,23 @@
<?php
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License version 3.0
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* 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.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0
*/
function upgrade_module_3_2_1()
{
return true;
}

View File

@@ -0,0 +1,9 @@
<?php
/**
* @param Ps_accounts $module
*/
function upgrade_module_4_0_0($module)
{
return true;
}

View File

@@ -0,0 +1,19 @@
<?php
/**
* @param Ps_accounts $module
*
* @return bool
*
* @throws Exception
*/
function upgrade_module_5_0_0($module)
{
/** @var \PrestaShop\Module\PsAccounts\Module\Uninstall $uninstaller */
$uninstaller = new PrestaShop\Module\PsAccounts\Module\Uninstall($module, Db::getInstance());
// Removed controller
$uninstaller->deleteAdminTab('AdminConfigureHmacPsAccounts');
return true;
}

View File

@@ -0,0 +1,13 @@
<?php
/**
* @param Ps_accounts $module
*
* @return bool
*
* @throws Exception
*/
function upgrade_module_5_1_0($module)
{
return true;
}

View File

@@ -0,0 +1,12 @@
<?php
/**
* @param Ps_accounts $module
*
* @return bool
*
* @throws Exception
*/
function upgrade_module_5_2_0($module)
{
return true;
}

View File

@@ -0,0 +1,13 @@
<?php
/**
* @param Ps_accounts $module
*
* @return bool
*
* @throws Exception
*/
function upgrade_module_5_3_6($module)
{
return true;
}

View File

@@ -0,0 +1,36 @@
<?php
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License version 3.0
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* 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.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0
*/
/**
* @param Ps_accounts $module
*
* @return bool
*
* @throws Exception
*/
function upgrade_module_6_0_0($module)
{
require __DIR__ . '/../src/enforce_autoload.php';
(new PrestaShop\Module\PsAccounts\Module\Install($module, Db::getInstance()))
->runMigration('create_employee_account_table');
return true;
}

View File

@@ -0,0 +1,16 @@
<?php
/**
* @param Ps_accounts $module
*
* @return bool
*
* @throws Exception
*/
function upgrade_module_6_1_4($module)
{
require __DIR__ . '/../src/enforce_autoload.php';
$module->registerHook($module->getHooksToRegister());
return true;
}

View File

@@ -0,0 +1,17 @@
<?php
/**
* @param Ps_accounts $module
*
* @return bool
*
* @throws Exception
*/
function upgrade_module_6_1_6($module)
{
require __DIR__ . '/../src/enforce_autoload.php';
$module->addCustomHooks($module->getCustomHooks());
$module->registerHook($module->getHooksToRegister());
return true;
}

View File

@@ -0,0 +1,33 @@
<?php
/**
* @param Ps_accounts $module
*
* @return bool
*
* @throws Exception
* @throws Throwable
*/
function upgrade_module_7_0_0($module)
{
require __DIR__ . '/../src/enforce_autoload.php';
foreach ([
//'displayBackOfficeHeader',
//'actionAdminLoginControllerSetMedia',
'actionAdminControllerInitBefore',
'actionModuleInstallAfter',
] as $hook) {
$module->unregisterHook($hook);
}
$module->addCustomHooks($module->getCustomHooks());
$module->registerHook($module->getHooksToRegister());
// FIXME: this wont prevent from re-implanting override on reset of module
$uninstaller = new PrestaShop\Module\PsAccounts\Module\Uninstall($module, Db::getInstance());
$uninstaller->deleteAdminTab('AdminLogin');
$installer = new PrestaShop\Module\PsAccounts\Module\Install($module, Db::getInstance());
$installer->installInMenu();
return true;
}

View File

@@ -0,0 +1,18 @@
<?php
/**
* @param Ps_accounts $module
*
* @return bool
*
* @throws Exception
* @throws Throwable
*/
function upgrade_module_7_1_2($module)
{
// FIXME: harmless to let those files untouched
// array_map('unlink', [
// $module->getLocalPath() . '/config/config.yml',
// $module->getLocalPath() . '/config/command.yml',
// ]);
return true;
}

View File

@@ -0,0 +1,42 @@
<?php
use PrestaShop\Module\PsAccounts\Log\Logger;
/**
* @param Ps_accounts $module
*
* @return bool
*
* @throws Exception
* @throws Throwable
*/
function upgrade_module_8_0_0($module)
{
require_once __DIR__ . '/helpers.php';
try {
$module->unregisterHook('actionObjectShopDeleteBefore');
$module->unregisterHook('actionObjectShopUpdateAfter');
$module->unregisterHook('actionObjectShopUrlUpdateAfter');
$module->unregisterHook('actionShopAccountLinkAfter');
$module->unregisterHook('actionShopAccountUnlinkAfter');
$module->unregisterHook('displayAccountUpdateWarning');
$module->registerHook($module->getHooksToRegister());
$tabId = \Tab::getIdFromClassName('AdminDebugPsAccounts');
if ($tabId) {
$tab = new \Tab($tabId);
$tab->delete();
}
$installer = new PrestaShop\Module\PsAccounts\Module\Install($module, Db::getInstance());
$installer->installInMenu();
} catch (\Exception $e) {
Logger::getInstance()->error('error during upgrade : ' . $e);
} catch (\Throwable $e) {
Logger::getInstance()->error('error during upgrade : ' . $e);
}
return true;
}

View File

@@ -0,0 +1,10 @@
<?php
/**
* @param Ps_accounts $module
*
* @return bool
*/
function upgrade_module_8_0_1($module)
{
return true;
}

View File

@@ -0,0 +1,14 @@
<?php
/**
* @param Ps_accounts $module
*
* @return bool
*
* @throws Exception
* @throws Throwable
*/
function upgrade_module_8_0_10($module)
{
return true;
}

View File

@@ -0,0 +1,11 @@
<?php
/**
* @param Ps_accounts $module
*
* @return bool
*/
function upgrade_module_8_0_11($module)
{
return true;
}

View File

@@ -0,0 +1,18 @@
<?php
/**
* @param Ps_accounts $module
*
* @return bool
*
* @throws Exception
* @throws Throwable
*/
function upgrade_module_8_0_12($module)
{
require_once __DIR__ . '/helpers.php';
migrate_or_create_identities_v8($module);
return true;
}

View File

@@ -0,0 +1,10 @@
<?php
/**
* @param Ps_accounts $module
*
* @return bool
*/
function upgrade_module_8_0_2($module)
{
return true;
}

View File

@@ -0,0 +1,10 @@
<?php
/**
* @param Ps_accounts $module
*
* @return bool
*/
function upgrade_module_8_0_3($module)
{
return true;
}

View File

@@ -0,0 +1,10 @@
<?php
/**
* @param Ps_accounts $module
*
* @return bool
*/
function upgrade_module_8_0_4($module)
{
return true;
}

View File

@@ -0,0 +1,10 @@
<?php
/**
* @param Ps_accounts $module
*
* @return bool
*/
function upgrade_module_8_0_5($module)
{
return true;
}

View File

@@ -0,0 +1,10 @@
<?php
/**
* @param Ps_accounts $module
*
* @return bool
*/
function upgrade_module_8_0_6($module)
{
return true;
}

View File

@@ -0,0 +1,11 @@
<?php
/**
* @param Ps_accounts $module
*
* @return bool
*/
function upgrade_module_8_0_7($module)
{
return true;
}

View File

@@ -0,0 +1,11 @@
<?php
/**
* @param Ps_accounts $module
*
* @return bool
*/
function upgrade_module_8_0_8($module)
{
return true;
}