From c8696f8d1a99964b4db7d3855c020a55bcf80f81 Mon Sep 17 00:00:00 2001 From: Ibnu Maksum Date: Tue, 20 Feb 2024 11:34:08 +0700 Subject: [PATCH] clear compiled after update --- system/lan/english.json | 4 +++- update.php | 16 +++++++++++----- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/system/lan/english.json b/system/lan/english.json index 96248455..3c032c67 100644 --- a/system/lan/english.json +++ b/system/lan/english.json @@ -423,5 +423,7 @@ "Admin": "Admin", "Password_should_be_minimum_6_characters": "Password should be minimum 6 characters", "Add_User": "Add User", - "Send_Notification": "Send Notification" + "Send_Notification": "Send Notification", + "Code": "Code", + "Send_To_Customer": "Send To Customer" } \ No newline at end of file diff --git a/update.php b/update.php index db635674..b2c6c475 100644 --- a/update.php +++ b/update.php @@ -8,7 +8,7 @@ session_start(); include "config.php"; -if(empty($update_url)){ +if (empty($update_url)) { $update_url = 'https://github.com/hotspotbilling/phpnuxbill/archive/refs/heads/master.zip'; } @@ -36,7 +36,7 @@ if (!extension_loaded('zip')) { $file = pathFixer('system/cache/phpnuxbill.zip'); -$folder = pathFixer('system/cache/phpnuxbill-'.basename($update_url, ".zip").'/'); +$folder = pathFixer('system/cache/phpnuxbill-' . basename($update_url, ".zip") . '/'); if (empty($step)) { $step++; @@ -105,9 +105,9 @@ if (empty($step)) { foreach ($updates as $version => $queries) { if (!in_array($version, $dones)) { foreach ($queries as $q) { - try{ - $db->exec($q); - }catch(PDOException $e){ + try { + $db->exec($q); + } catch (PDOException $e) { //ignore, it exists already } } @@ -119,6 +119,12 @@ if (empty($step)) { $step++; } else { $path = 'ui/compiled/'; + $files = scandir($path); + foreach ($files as $file) { + if (is_file($path . $file)) { + unlink($path . $file); + } + } $version = json_decode(file_get_contents('version.json'), true)['version']; $continue = false; }