80 lines
2.7 KiB
PHP
80 lines
2.7 KiB
PHP
<?php
|
|
/**
|
|
* Redis Cache
|
|
* Version: 2.1.1
|
|
* Copyright (c) 2020-2022. Mateusz Szymański Teamwant
|
|
* https://teamwant.pl
|
|
*
|
|
* NOTICE OF LICENSE
|
|
*
|
|
* This source file is subject to the Open Software License (OSL 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/osl-3.0.php
|
|
*
|
|
* @author Teamwant <kontakt@teamwant.pl>
|
|
* @copyright Copyright 2020-2023 © Teamwant Mateusz Szymański All right reserved
|
|
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
|
* @category Teamwant
|
|
* @package Teamwant
|
|
*/
|
|
|
|
if (!defined('_PS_VERSION_')) {
|
|
exit;
|
|
}
|
|
|
|
require_once(_PS_MODULE_DIR_ . 'teamwant_redis/autoload.php');
|
|
|
|
use Teamwant\Prestashop17\Redis\Classes\Versions\TeamwantRedisVersion;
|
|
|
|
class Teamwant_Redis extends Module
|
|
{
|
|
use TeamwantRedisVersion;
|
|
|
|
public function __construct()
|
|
{
|
|
$this->name = 'teamwant_redis';
|
|
$this->tab = 'others';
|
|
$this->version = '2.1.1';
|
|
$this->author = 'Mateusz Szymański Teamwant';
|
|
$this->need_instance = 1;
|
|
$this->bootstrap = false;
|
|
|
|
parent::__construct();
|
|
|
|
$this->displayName = $this->l('Redis Cache');
|
|
$this->description = $this->l('Support Redis Cache for Prestashop 1.7 / 8+');
|
|
$this->confirmUninstall = $this->l('Are you sure you want to uninstall Redis support?');
|
|
|
|
$this->ps_versions_compliancy = array('min' => '1.7.0.0', 'max' => '8.9.9');
|
|
$this->module_key = '9c440d93f1967f82305e8c3aa739beed';
|
|
|
|
////presta1.7 buged translation catch, add force translation to module
|
|
//$this->initRawTranslations();
|
|
|
|
if (Module::isEnabled($this->name)) {
|
|
$this->validateFilePrivilagesForTeamwantRedisModule();
|
|
}
|
|
|
|
if (version_compare(_PS_VERSION_, '1.7.0.0', '>=') === true
|
|
&& version_compare(_PS_VERSION_, '1.7.3.0', '<') === true
|
|
) {
|
|
$this->prestashopVersion = 1700;
|
|
} elseif (version_compare(_PS_VERSION_, '1.7.3.0', '>=') === true
|
|
&& version_compare(_PS_VERSION_, '1.7.7.0', '<') === true
|
|
) {
|
|
$this->prestashopVersion = 1760;
|
|
} elseif (version_compare(_PS_VERSION_, '1.7.7.0', '>=') === true
|
|
&& version_compare(_PS_VERSION_, '1.7.8.0', '<') === true
|
|
) {
|
|
$this->prestashopVersion = 1770;
|
|
} elseif (version_compare(_PS_VERSION_, '1.7.8.0', '>=') === true
|
|
&& version_compare(_PS_VERSION_, '1.7.9.9', '<=') === true
|
|
) {
|
|
$this->prestashopVersion = 1780;
|
|
} else {
|
|
$this->prestashopVersion = 800;
|
|
}
|
|
}
|
|
}
|