Skip to content

Commit

Permalink
ref #90598 Changed the minimum supported versions of PrestaShop and P…
Browse files Browse the repository at this point in the history
…HP (#215)
  • Loading branch information
uryvskiy-dima authored Aug 24, 2023
1 parent f615979 commit 6b7599e
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 30 deletions.
14 changes: 2 additions & 12 deletions .github/workflows/presta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,13 @@ jobs:
matrix:
include:
- php-version: '7.1'
branch: '1.7.4.4'
branch: '1.7.7.0'
composerv1: 1
phpunit-version: 'phpunit:6.4.3'
- php-version: '7.2'
branch: '1.7.4.4'
branch: '1.7.7.0'
composerv1: 1
phpunit-version: 'phpunit:6.4.3'

- php-version: '7.1'
branch: '1.7.6.9'
composerv1: 1
phpunit-version: 'phpunit:6.4.3'
- php-version: '7.2'
branch: '1.7.6.9'
composerv1: 1
phpunit-version: 'phpunit:6.4.3'

- php-version: '7.1'
branch: '1.7.7.8'
composerv1: 1
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## v3.5.7
* Изменены минимально поддерживаемые версии PrestaShop и PHP

## v3.5.6
* Исправление передачи брошенных корзин

Expand Down
12 changes: 3 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ delete_archive:
rm -f $(ARCHIVE_NAME)
rm -f /tmp/retailcrm.zip

composer: clone_prestashop clone_composer fix-version-bugs
composer: clone_prestashop clone_composer fix-version-lang-bugs
ifeq ($(COMPOSERV1),1)
cd $(PRESTASHOP_DIR) && php composer.phar install --prefer-dist --no-interaction --no-progress
else
Expand Down Expand Up @@ -56,26 +56,20 @@ else
endif
endif

fix-version-bugs:
# Required for versions 1.7.7.x
fix-version-lang-bugs:
ifeq ($(COMPOSERV1),1)
cd $(PRESTASHOP_DIR) \
&& sed -i 's/throw new Exception/#throw new Exception/g' src/PrestaShopBundle/Install/DatabaseDump.php
endif
ifeq ($(BRANCH), 1.7.4.4)
cd $(PRESTASHOP_DIR) \
&& sed -i 's/$$install->installModules();/$$install->setTranslator(\\Context::getContext()->getTranslator());\n\t$$install->installModules();/g' tests/PrestaShopBundle/Utils/DatabaseCreator.php
cat $(PRESTASHOP_DIR)/tests/PrestaShopBundle/Utils/DatabaseCreator.php | grep -A 3 -B 3 'install->installModules()'
endif

ifeq ($(BRANCH),$(filter $(BRANCH),1.7.6.9 1.7.7.8))
cd $(PRESTASHOP_DIR) \
&& sed -i "s/SymfonyContainer::getInstance()->get('translator')/\\\\Context::getContext()->getTranslator()/g" classes/lang/DataLang.php
cat $(PRESTASHOP_DIR)/classes/lang/DataLang.php | grep -A 3 -B 3 'this->translator = '

cd $(PRESTASHOP_DIR) \
&& sed -i "s/SymfonyContainer::getInstance()->get('translator')/\\\\Context::getContext()->getTranslator()/g" classes/Language.php
cat $(PRESTASHOP_DIR)/classes/Language.php | grep -A 3 -B 3 'translator = '
endif

lint:
php-cs-fixer fix --config=$(ROOT_DIR)/.php-cs-fixer.php -v
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[![Build Status](https://github.com/retailcrm/prestashop-module/workflows/presta/badge.svg)](https://github.com/retailcrm/prestashop-module/actions)
[![Coverage](https://img.shields.io/codecov/c/gh/retailcrm/prestashop-module/master.svg?logo=github)](https://codecov.io/gh/retailcrm/prestashop-module)
[![GitHub release](https://img.shields.io/github/release/retailcrm/prestashop-module.svg?logo=codecov)](https://github.com/retailcrm/prestashop-module/releases)
[![PHP version](https://img.shields.io/badge/PHP->=5.6-blue.svg?logo=php)](https://php.net/)
[![PHP version](https://img.shields.io/badge/PHP->=7.1-blue.svg?logo=php)](https://php.net/)

Prestashop module.
=================
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.5.6
3.5.7
9 changes: 2 additions & 7 deletions retailcrm/retailcrm.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@

class RetailCRM extends Module
{
const VERSION = '3.5.6';
const VERSION = '3.5.7';

const API_URL = 'RETAILCRM_ADDRESS';
const API_KEY = 'RETAILCRM_API_TOKEN';
Expand Down Expand Up @@ -161,7 +161,7 @@ public function __construct()
$this->default_country = (int) Configuration::get('PS_COUNTRY_DEFAULT');
$this->apiUrl = Configuration::get(static::API_URL);
$this->apiKey = Configuration::get(static::API_KEY);
$this->ps_versions_compliancy = ['min' => '1.6.1.0', 'max' => _PS_VERSION_];
$this->ps_versions_compliancy = ['min' => '1.7.7.0', 'max' => _PS_VERSION_];
$this->psVersion = Tools::substr(_PS_VERSION_, 0, 3);
$this->log = RetailcrmLogger::getLogFile();
$this->module_key = 'dff3095326546f5fe8995d9e86288491';
Expand All @@ -172,11 +172,6 @@ public function __construct()
$this->name .
'/views';

if ('1.6' == $this->psVersion) {
$this->bootstrap = true;
$this->use_new_hooks = false;
}

if ($this->apiUrl && $this->apiKey) {
$this->api = new RetailcrmProxy($this->apiUrl, $this->apiKey);
$this->reference = new RetailcrmReferences($this->api);
Expand Down

0 comments on commit 6b7599e

Please sign in to comment.