HEX
Server: Apache
System: Linux srv13.cpanelhost.cl 3.10.0-962.3.2.lve1.5.38.el7.x86_64 #1 SMP Thu Jun 18 05:28:41 EDT 2020 x86_64
User: cca63905 (4205)
PHP: 7.3.20
Disabled: NONE
Upload Files
File: /home4/cca63905/public_html/nueva/modules/ps_accounts/upgrade/upgrade-8.0.0.php
<?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;
}