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/www/nueva/modules/ps_accounts/upgrade/upgrade-7.0.0.php
<?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;
}