<?php
/**
* 2023 Anvanto
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
*
*  @author    Anvanto <anvantoco@gmail.com>
*  @copyright 2023 Anvanto
*  @license   http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
*/

if (!defined('_PS_VERSION_')) {
    exit;
}
function upgrade_module_1_0_6($object)
{

    $object->filesManager->createFolders();

    if (Tools::copy(_PS_MODULE_DIR_ . 'an_homecategories/homecategories.json', $object->filesManager->jsonContentFile)){
        @unlink(_PS_MODULE_DIR_ . 'an_homecategories/homecategories.json');
    }

    if (Tools::copy(_PS_MODULE_DIR_ . 'an_homecategories/settings.json', $object->filesManager->jsonSettingsFile)){
        @unlink(_PS_MODULE_DIR_ . 'an_homecategories/settings.json');
    }    

    return true;
}
