✏️ 正在编辑: upgrade-6.1.2.php
路径:
/home/bpioifn/www/pigmentse/modules/dpdfrance/upgrade/upgrade-6.1.2.php
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
<?php /** * 2007-2022 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 DPD France S.A.S. <support.ecommerce@dpd.fr> * @copyright 2022 DPD France S.A.S. * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ if (!defined('_PS_VERSION_')) { exit; } /** * @return bool * @throws PrestaShopDatabaseException */ function upgrade_module_6_1_2() { // ? Suppression de l'ancien fichier front js Tools::deleteFile(_PS_MODULE_DIR_ . 'dpdfrance/views/js/front/dpdfrance_532.js'); // ? Suppression de l'ancien fichier upgrade dont la version n'existe pas Tools::deleteFile(_PS_MODULE_DIR_ . 'dpdfrance/upgrade/upgrade-5.3.6.php'); // ? Suppression des anciens controller Tools::deleteFile(_PS_MODULE_DIR_ . 'dpdfrance/controllers/admin/AdminDPDFrance.php'); Tools::deleteFile(_PS_MODULE_DIR_ . 'dpdfrance/controllers/admin/AdminDPDFranceReturn.php'); // ? Cryptage du login de EPRINT Configuration::updateValue( 'DPDFRANCE_API_LOGIN', DPDTools::encrypt(Configuration::get('DPDFRANCE_API_LOGIN')) ); Configuration::updateValue( 'DPDFRANCE_API_PASSWORD', DPDTools::encrypt(Configuration::get('DPDFRANCE_API_PASSWORD')) ); // ? Ajout de la configuration du login Webtrace Configuration::updateValue('DPDFRANCE_WEBTRACE_LOGIN', DPDTools::encrypt('1064')); Configuration::updateValue('DPDFRANCE_WEBTRACE_PASSWORD', DPDTools::encrypt('Pr2%5sHg')); /** * ? Recuperation de la zone France */ $sqlFranceZones = 'SELECT id_zone FROM ' . _DB_PREFIX_ . 'zone WHERE name LIKE "%France%"'; $resFranceZones = Db::getInstance()->ExecuteS($sqlFranceZones); if (empty($resFranceZones)) { return false; } /** * ? Recuperation des id de boutique */ $sqlShop = 'SELECT id_shop FROM ' . _DB_PREFIX_ . 'shop;'; $resShop = Db::getInstance()->executeS($sqlShop); /** * ? Creation de la zone shop France pour chaque boutique et chaque zone ayant le mot "FRANCE" */ if (!empty($resShop)) { foreach ($resShop as $shop) { foreach ($resFranceZones as $franceZone) { $zoneShopSql = ' INSERT INTO ' . _DB_PREFIX_ . 'zone_shop (id_zone, id_shop) VALUES (' . (int)$franceZone['id_zone'] . ', ' . (int)$shop['id_shop'] . ') ON DUPLICATE KEY UPDATE id_zone = ' . (int)$franceZone['id_zone'] . ', id_shop = ' . (int)$shop['id_shop']; if (Db::getInstance()->execute($zoneShopSql) === false) { return false; } } } } else { return false; } /** * ? Creation de la table de stockage de point relais temporaire */ $sqlRelaisStorage = ' CREATE TABLE IF NOT EXISTS `' . _DB_PREFIX_ . 'dpdfrance_relais_storage` ( `id_cart` INT UNSIGNED NOT NULL, `id_customer` INT UNSIGNED NOT NULL, `search_relay` TEXT NOT NULL, `relay_list` TEXT NOT NULL, PRIMARY KEY (`id_cart`, `id_customer`) ) ENGINE=' . _MYSQL_ENGINE_ . ' DEFAULT CHARSET=utf8'; return Db::getInstance()->execute($sqlRelaisStorage); }
💾 保存文件
← 返回文件管理器