Skip to content

Commit

Permalink
Fix to be able to install on PS 1.6
Browse files Browse the repository at this point in the history
- PS 1.6 i using eval on smartsupp.php file and therefore it fails on autoloader issue if use statement is used in there
- removed use statement and put full class namespace instead
  • Loading branch information
marekgach committed Dec 9, 2019
1 parent 7a1f30b commit 6d14728
Show file tree
Hide file tree
Showing 19 changed files with 22 additions and 23 deletions.
2 changes: 1 addition & 1 deletion smartsupp/classes/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* Plugin Name: Smartsupp Live Chat
* Plugin URI: http://www.smartsupp.com
* Description: Adds Smartsupp Live Chat code to PrestaShop.
* Version: 2.1.7
* Version: 2.1.8
* Author: Smartsupp
* Author URI: http://www.smartsupp.com
* Text Domain: smartsupp
Expand Down
2 changes: 1 addition & 1 deletion smartsupp/controllers/admin/AdminSmartsuppAjax.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* Plugin Name: Smartsupp Live Chat
* Plugin URI: http://www.smartsupp.com
* Description: Adds Smartsupp Live Chat code to PrestaShop.
* Version: 2.1.7
* Version: 2.1.8
* Text Domain: smartsupp
* Author: Smartsupp
* Author URI: http://www.smartsupp.com
Expand Down
2 changes: 1 addition & 1 deletion smartsupp/controllers/admin/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* Plugin Name: Smartsupp Live Chat
* Plugin URI: http://www.smartsupp.com
* Description: Adds Smartsupp Live Chat code to PrestaShop.
* Version: 2.1.7
* Version: 2.1.8
* Author: Smartsupp
* Author URI: http://www.smartsupp.com
* Text Domain: smartsupp
Expand Down
2 changes: 1 addition & 1 deletion smartsupp/controllers/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* Plugin Name: Smartsupp Live Chat
* Plugin URI: http://www.smartsupp.com
* Description: Adds Smartsupp Live Chat code to PrestaShop.
* Version: 2.1.7
* Version: 2.1.8
* Author: Smartsupp
* Author URI: http://www.smartsupp.com
* Text Domain: smartsupp
Expand Down
2 changes: 1 addition & 1 deletion smartsupp/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* Plugin Name: Smartsupp Live Chat
* Plugin URI: http://www.smartsupp.com
* Description: Adds Smartsupp Live Chat code to PrestaShop.
* Version: 2.1.7
* Version: 2.1.8
* Author: Smartsupp
* Author URI: http://www.smartsupp.com
* Text Domain: smartsupp
Expand Down
9 changes: 4 additions & 5 deletions smartsupp/smartsupp.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* Plugin Name: Smartsupp Live Chat
* Plugin URI: http://www.smartsupp.com
* Description: Adds Smartsupp Live Chat code to PrestaShop.
* Version: 2.1.7
* Version: 2.1.8
* Author: Smartsupp
* Author URI: http://www.smartsupp.com
* Text Domain: smartsupp
Expand All @@ -23,8 +23,6 @@
exit;
}

use \Smartsupp\ChatGenerator;

require __DIR__ . '/vendor/autoload.php';

class Smartsupp extends Module
Expand All @@ -34,7 +32,7 @@ public function __construct()
{
$this->name = 'smartsupp';
$this->tab = 'advertising_marketing';
$this->version = '2.1.7';
$this->version = '2.1.8';
$this->author = 'Smartsupp';
$this->need_instance = 0;
$this->ps_versions_compliancy = array('min' => '1.6', 'max' => _PS_VERSION_);
Expand Down Expand Up @@ -196,7 +194,8 @@ protected function getSmartsuppJs($smartsupp_key)
return '';
}

$chat = new ChatGenerator($smartsupp_key);
// NEVER ever put it into use statement as this will break Presta 1.6 installation - they use eval which does not run PSR autoloader
$chat = new \Smartsupp\ChatGenerator($smartsupp_key);
$chat->setPlatform('Prestashop ' . _PS_VERSION_);
$chat->setCookieDomain('.' . Tools::getHttpHost(false));

Expand Down
2 changes: 1 addition & 1 deletion smartsupp/translations/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* Plugin Name: Smartsupp Live Chat
* Plugin URI: http://www.smartsupp.com
* Description: Adds Smartsupp Live Chat code to PrestaShop.
* Version: 2.1.7
* Version: 2.1.8
* Author: Smartsupp
* Author URI: http://www.smartsupp.com
* Text Domain: smartsupp
Expand Down
2 changes: 1 addition & 1 deletion smartsupp/views/css/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* Plugin Name: Smartsupp Live Chat
* Plugin URI: http://www.smartsupp.com
* Description: Adds Smartsupp Live Chat code to PrestaShop.
* Version: 2.1.7
* Version: 2.1.8
* Author: Smartsupp
* Author URI: http://www.smartsupp.com
* Text Domain: smartsupp
Expand Down
2 changes: 1 addition & 1 deletion smartsupp/views/css/smartsupp.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Plugin Name: Smartsupp Live Chat
* Plugin URI: http://www.smartsupp.com
* Description: Adds Smartsupp Live Chat code to PrestaShop.
* Version: 2.1.7
* Version: 2.1.8
* Author: Smartsupp
* Author URI: http://www.smartsupp.com
* Text Domain: smartsupp
Expand Down
2 changes: 1 addition & 1 deletion smartsupp/views/img/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* Plugin Name: Smartsupp Live Chat
* Plugin URI: http://www.smartsupp.com
* Description: Adds Smartsupp Live Chat code to PrestaShop.
* Version: 2.1.7
* Version: 2.1.8
* Author: Smartsupp
* Author URI: http://www.smartsupp.com
* Text Domain: smartsupp
Expand Down
2 changes: 1 addition & 1 deletion smartsupp/views/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* Plugin Name: Smartsupp Live Chat
* Plugin URI: http://www.smartsupp.com
* Description: Adds Smartsupp Live Chat code to PrestaShop.
* Version: 2.1.7
* Version: 2.1.8
* Author: Smartsupp
* Author URI: http://www.smartsupp.com
* Text Domain: smartsupp
Expand Down
2 changes: 1 addition & 1 deletion smartsupp/views/js/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* Plugin Name: Smartsupp Live Chat
* Plugin URI: http://www.smartsupp.com
* Description: Adds Smartsupp Live Chat code to PrestaShop.
* Version: 2.1.7
* Version: 2.1.8
* Author: Smartsupp
* Author URI: http://www.smartsupp.com
* Text Domain: smartsupp
Expand Down
2 changes: 1 addition & 1 deletion smartsupp/views/js/smartsupp.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Plugin Name: Smartsupp Live Chat
* Plugin URI: http://www.smartsupp.com
* Description: Adds Smartsupp Live Chat code to PrestaShop.
* Version: 2.1.7
* Version: 2.1.8
* Author: Smartsupp
* Author URI: http://www.smartsupp.com
* Text Domain: smartsupp
Expand Down
2 changes: 1 addition & 1 deletion smartsupp/views/templates/admin/configuration.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Plugin Name: Smartsupp Live Chat
* Plugin URI: http://www.smartsupp.com
* Description: Adds Smartsupp Live Chat code to PrestaShop.
* Version: 2.1.7
* Version: 2.1.8
* Author: Smartsupp
* Author URI: http://www.smartsupp.com
* Text Domain: smartsupp
Expand Down
2 changes: 1 addition & 1 deletion smartsupp/views/templates/admin/connect_account.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Plugin Name: Smartsupp Live Chat
* Plugin URI: http://www.smartsupp.com
* Description: Adds Smartsupp Live Chat code to PrestaShop.
* Version: 2.1.7
* Version: 2.1.8
* Author: Smartsupp
* Author URI: http://www.smartsupp.com
* Text Domain: smartsupp
Expand Down
2 changes: 1 addition & 1 deletion smartsupp/views/templates/admin/create_account.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Plugin Name: Smartsupp Live Chat
* Plugin URI: http://www.smartsupp.com
* Description: Adds Smartsupp Live Chat code to PrestaShop.
* Version: 2.1.7
* Version: 2.1.8
* Author: Smartsupp
* Author URI: http://www.smartsupp.com
* Text Domain: smartsupp
Expand Down
2 changes: 1 addition & 1 deletion smartsupp/views/templates/admin/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* Plugin Name: Smartsupp Live Chat
* Plugin URI: http://www.smartsupp.com
* Description: Adds Smartsupp Live Chat code to PrestaShop.
* Version: 2.1.7
* Version: 2.1.8
* Author: Smartsupp
* Author URI: http://www.smartsupp.com
* Text Domain: smartsupp
Expand Down
2 changes: 1 addition & 1 deletion smartsupp/views/templates/admin/landing_page.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Plugin Name: Smartsupp Live Chat
* Plugin URI: http://www.smartsupp.com
* Description: Adds Smartsupp Live Chat code to PrestaShop.
* Version: 2.1.7
* Version: 2.1.8
* Author: Smartsupp
* Author URI: http://www.smartsupp.com
* Text Domain: smartsupp
Expand Down
2 changes: 1 addition & 1 deletion smartsupp/views/templates/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* Plugin Name: Smartsupp Live Chat
* Plugin URI: http://www.smartsupp.com
* Description: Adds Smartsupp Live Chat code to PrestaShop.
* Version: 2.1.7
* Version: 2.1.8
* Author: Smartsupp
* Author URI: http://www.smartsupp.com
* Text Domain: smartsupp
Expand Down

0 comments on commit 6d14728

Please sign in to comment.