clear compiled after update

This commit is contained in:
Ibnu Maksum 2024-02-20 11:34:08 +07:00
parent 63bba0efb0
commit c8696f8d1a
No known key found for this signature in database
GPG Key ID: 7FC82848810579E5
2 changed files with 14 additions and 6 deletions

View File

@ -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"
}

View File

@ -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;
}