php - Prestashop module - Requires PHP 7.1 at least
问题描述
I can't find any information on that. Is it possible on a Prestashop module to prevent installation/upgrade to a module that requires PHP 7.1?
I can exit the process with but it installs the plugin anyway.
<?php
if (version_compare(PHP_VERSION, '7.1.0', '<')) {
exit;
}
WordPress has a good manner to handle this, by adding a 'Requires PHP' line to readme.
Thanks in advance.
EDIT: I opened an issue in their GitHub: https://github.com/PrestaShop/PrestaShop/issues/25578
解决方案
只需将其添加到模块的主文件中即可
if (!defined('_PS_VERSION_') || version_compare(PHP_VERSION, '7.1.0', '<')
exit;
}
class CrezzurModule extends Module
{
public function __construct()
{
$this->name = 'crezzurmodule';
$this->tab = 'front_office_features';
$this->version = '1.0.4';
...
推荐阅读
- powershell - PowerShell 远程会话变量不起作用
- bots - 告诉我一些关于 Telegram API 的事情,例如:聊天 ID、用户 ID
- html - SVG 图标路径不显示
- windows-server - 如何在从 Windows Admin Center CLI 创建工具扩展时修复错误
- rest - 无论如何我们可以使用vsphere rest api访问用户的权限和角色吗?
- .htaccess - 我们如何在 .php 文件本身或 htaccess 中添加具有多个 .php 变量的 URL?
- sql - 我有 2 个不同的表,例如 user 和 user_managers,我需要根据 userid 获取经理详细信息
- batch-file - 如何将信息从批处理文件 1 发送到批处理文件 2?
- php - 来自数组的图形表示逻辑
- java - 我应该先从 Jon 和他的朋友那里得到副本吗?还是只获取值而不获取重复项?