From 1cd6a03668cd1f2f595a9955cb7cc0d9f87cb17f Mon Sep 17 00:00:00 2001 From: Mitan Omar Date: Sat, 29 Jun 2019 14:17:40 +0200 Subject: [PATCH] zips content is not exists when updating plugin --- init.php | 64 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/init.php b/init.php index 78a3f05..2792456 100644 --- a/init.php +++ b/init.php @@ -18,7 +18,7 @@ // who wrote this plugin? 'plugin_developer' => 'Kleeja Team', // this plugin version - 'plugin_version' => '1.2.1', + 'plugin_version' => '1.2.2', // explain what is this plugin, why should i use it? 'plugin_description' => [ 'en' => 'Selling Files and Premium Groups', @@ -235,37 +235,6 @@ add_config_r($options); - - - if (! file_exists(dirname(__FILE__) . '/vendor/autoload.php')) - { - // extract paypal sdk - if (file_exists(dirname(__FILE__) . '/paypal_sdk.zip')) - { - $paypalZip = new ZipArchive; - - if ($paypalZip->open(dirname(__FILE__) . '/paypal_sdk.zip')) - { - $paypalZip->extractTo(dirname(__FILE__)); - $paypalZip->close(); - } - } - } - - if (! file_exists(dirname(__FILE__) . '/stripe-sdk/vendor/autoload.php')) - { - // extract stripe sdk - if (file_exists(dirname(__FILE__) . '/stripe-sdk.zip')) - { - $stripeZip = new ZipArchive; - - if ($stripeZip->open(dirname(__FILE__) . '/stripe-sdk.zip')) - { - $stripeZip->extractTo(dirname(__FILE__)); - $stripeZip->close(); - } - } - } }; @@ -1285,6 +1254,37 @@ $langFiles = require_once $langFiles; $olang = array_merge($olang, $langFiles); } + + if (! file_exists(dirname(__FILE__) . '/vendor/autoload.php')) + { + // extract paypal sdk + if (file_exists(dirname(__FILE__) . '/paypal_sdk.zip')) + { + $paypalZip = new ZipArchive; + + if ($paypalZip->open(dirname(__FILE__) . '/paypal_sdk.zip')) + { + $paypalZip->extractTo(dirname(__FILE__)); + $paypalZip->close(); + } + } + } + + if (! file_exists(dirname(__FILE__) . '/stripe-sdk/vendor/autoload.php')) + { + // extract stripe sdk + if (file_exists(dirname(__FILE__) . '/stripe-sdk.zip')) + { + $stripeZip = new ZipArchive; + + if ($stripeZip->open(dirname(__FILE__) . '/stripe-sdk.zip')) + { + $stripeZip->extractTo(dirname(__FILE__)); + $stripeZip->close(); + } + } + } + return compact('olang'); }