Php 如何在prestashop中重命名自定义模块

Php 如何在prestashop中重命名自定义模块,php,symfony,prestashop,prestashop-modules,Php,Symfony,Prestashop,Prestashop Modules,我已经开发了一个自定义模块,并从后台安装。最近,我收到了更改模块名称的要求 我试过这些步骤 卸载我的模块 重命名我的模块文件夹名称(我的装运->装运模块) 重命名模块文件夹下的模块文件(my_shipping.php-> 装运(U模块) 重命名类名和_构造名 然后我刷新了我的后台模块选择,并在已安装模块选项卡下看到了它。(但我在卸载它时开始了这些步骤)。然后我尝试卸载它。然后它显示给我 无法卸载模块xxx。模块未安装 如何重命名现有的自定义模块 class Shipping_module

我已经开发了一个自定义模块,并从后台安装。最近,我收到了更改模块名称的要求

我试过这些步骤

  • 卸载我的模块

  • 重命名我的模块文件夹名称(我的装运->装运模块)

  • 重命名模块文件夹下的模块文件(my_shipping.php-> 装运(U模块)

  • 重命名类名和_构造名

  • 然后我刷新了我的后台模块选择,并在
    已安装模块
    选项卡下看到了它。(但我在卸载它时开始了这些步骤)。然后我尝试卸载它。然后它显示给我

    无法卸载模块xxx。模块未安装

    如何重命名现有的自定义模块

    class Shipping_module extends CarrierModule
    {
        protected $config_form = false;
    
        public function __construct()
        {
            $this->name          = 'shipping_module';
            $this->tab           = 'shipping_logistics';
            $this->version       = '1.0.0';
            $this->author        = 'DDD';
            $this->need_instance = 0;
        }
    }
    

    在我看来,由于某些错误,它似乎没有在步骤1卸载

    尝试以下步骤

  • 将其重新命名为原来的名称,然后卸载并删除它(在卸载模块后,有一个复选框用于删除该模块)

  • 一旦确定已删除,请使用新名称、文件夹、类以及模块文件中出现的每个类名对其进行重命名

  • 重新安装模块;将调试模式保持为打开状态,以便可以看到可能出现的任何错误


  • 在我看来,由于某些错误,它似乎没有在步骤1卸载

    尝试以下步骤

  • 将其重新命名为原来的名称,然后卸载并删除它(在卸载模块后,有一个复选框用于删除该模块)

  • 一旦确定已删除,请使用新名称、文件夹、类以及模块文件中出现的每个类名对其进行重命名

  • 重新安装模块;将调试模式保持为打开状态,以便可以看到可能出现的任何错误

  • 选项:

  • 删除/modules/moduletodelete中的模块文件夹
  • 转到模块主文件(类)并尝试运行“卸载”功能

  • 如果您想重命名模块,则需要运行“重试下一个代码”:

     $this->name = 'custom';
     $this->tab = 'custom';
     $this->version = '0.0.1';
     $this->author = 'custom';
     $this->need_instance = 0;
     $this->add();//or $this->save;
    
    $this->[name_of_uninstall()]; //example $this->uninstall();
    
  • 第2点示例:Goto/modules/moduletodelete/moduletodelete.php,检查如何调用卸载函数(类似于“public function uninstall()”),并尝试运行下一个代码:

     $this->name = 'custom';
     $this->tab = 'custom';
     $this->version = '0.0.1';
     $this->author = 'custom';
     $this->need_instance = 0;
     $this->add();//or $this->save;
    
    $this->[name_of_uninstall()]; //example $this->uninstall();
    
    选项:

  • 删除/modules/moduletodelete中的模块文件夹
  • 转到模块主文件(类)并尝试运行“卸载”功能

  • 如果您想重命名模块,则需要运行“重试下一个代码”:

     $this->name = 'custom';
     $this->tab = 'custom';
     $this->version = '0.0.1';
     $this->author = 'custom';
     $this->need_instance = 0;
     $this->add();//or $this->save;
    
    $this->[name_of_uninstall()]; //example $this->uninstall();
    
  • 第2点示例:Goto/modules/moduletodelete/moduletodelete.php,检查如何调用卸载函数(类似于“public function uninstall()”),并尝试运行下一个代码:

     $this->name = 'custom';
     $this->tab = 'custom';
     $this->version = '0.0.1';
     $this->author = 'custom';
     $this->need_instance = 0;
     $this->add();//or $this->save;
    
    $this->[name_of_uninstall()]; //example $this->uninstall();