From 215bce34d6d46613db3f5be91b3fc93b3188ce7e Mon Sep 17 00:00:00 2001 From: Abyss Morgan <14877700+AbyssMorgan@users.noreply.github.com> Date: Tue, 4 Jun 2024 22:33:10 +0200 Subject: [PATCH] Final update v2.2.0 --- BuildLinux.ave-php | 4 ++-- includes/AVE.php | 7 +++++-- includes/avecore/ADM.php | 2 ++ includes/avecore/AppBuffer.php | 2 ++ includes/avecore/BinaryFile.php | 2 ++ includes/avecore/BitArray.php | 2 ++ includes/avecore/BitFunctions.php | 2 ++ includes/avecore/Core.php | 22 +++++++++++++++++++--- includes/avecore/FtpService.php | 2 ++ includes/avecore/IniFile.php | 2 ++ includes/avecore/JournalService.php | 2 ++ includes/avecore/Logs.php | 2 ++ includes/avecore/MySQL.php | 2 ++ includes/avecore/Request.php | 2 ++ version | 2 +- 15 files changed, 49 insertions(+), 8 deletions(-) diff --git a/BuildLinux.ave-php b/BuildLinux.ave-php index 33b996f..a770192 100644 --- a/BuildLinux.ave-php +++ b/BuildLinux.ave-php @@ -6,10 +6,10 @@ $this->ave->title("$app_name Builder v$version"); $output = "$this->path/Setup"; - $zip_name_a = $this->ave->get_file_path("$output/${app_name}_v$version"."_LINUX.tar"); + $zip_name_a = $this->ave->get_file_path("$output/{$app_name}_v$version"."_LINUX.tar"); $this->ave->delete($zip_name_a); - $zip_name_b = $this->ave->get_file_path("$output/${app_name}_v$version"."_LINUX.tar.gz"); + $zip_name_b = $this->ave->get_file_path("$output/{$app_name}_v$version"."_LINUX.tar.gz"); $this->ave->delete($zip_name_b); $this->ave->echo(" Compress \"$zip_name_a\""); diff --git a/includes/AVE.php b/includes/AVE.php index f05001a..db5392d 100644 --- a/includes/AVE.php +++ b/includes/AVE.php @@ -78,8 +78,8 @@ public function __construct(array $arguments){ if($this->get_version_number($this->config->get('APP_VERSION','0.0.0')) < 10900){ $this->config->unset(['AVE_EXTENSIONS_VIDEO_FOLLOW']); } - if($this->get_version_number($this->config->get('APP_VERSION','0.0.0')) < 10904){ - $this->config->unset(['AVE_DATA_FOLDER','AVE_LOG_FOLDER']); + if($this->get_version_number($this->config->get('APP_VERSION','0.0.0')) < 20200){ + $this->config->unset(['AVE_DATA_FOLDER','AVE_LOG_FOLDER','AVE_BUFFER_FOLDER']); } foreach($config_default->get_all() as $key => $value){ @@ -134,6 +134,9 @@ public function __construct(array $arguments){ return; } $this->rrmdir($file, false); + if(strpos($file, "php") !== false){ + $this->delete($this->get_file_path(pathinfo($file, PATHINFO_DIRNAME)."/".pathinfo($file, PATHINFO_BASENAME).".ini"), false); + } } } if($changed){ diff --git a/includes/avecore/ADM.php b/includes/avecore/ADM.php index f5e7942..c5f0b82 100644 --- a/includes/avecore/ADM.php +++ b/includes/avecore/ADM.php @@ -1,5 +1,7 @@ logo = ''; $this->current_title = ''; $this->utilities_path = $this->get_file_path($this->get_variable("%PROGRAMFILES%")."/AVE-UTILITIES"); - + $this->core_path = null; + if($require_utilities){ if($this->windows){ $ave_utilities = false; @@ -60,6 +64,7 @@ public function __construct(array $arguments, bool $require_utilities){ $ave_utilities_imagick = new IniFile($this->get_file_path("$this->utilities_path/imagick.ini")); if($ave_utilities_main->get('APP_VERSION') == $this->utilities_version && $ave_utilities_imagick->get('APP_VERSION') == $this->utilities_version){ $ave_utilities = true; + $this->core_path = $this->get_file_path("$this->utilities_path/core/".$ave_utilities_main->get('APP_VERSION')); } } @@ -237,6 +242,16 @@ public function time_unit_to_seconds(int $value, string $unit) : int { return 0; } + public function is_folder_empty(string $path) : bool { + if(!file_exists($path)) return true; + $files = scandir($path); + foreach($files as $file){ + if($file == "." || $file == "..") continue; + return false; + } + return true; + } + public function get_files(string $path, array|null $extensions = null, array|null $except = null, array|null $filters = null) : array { if(!file_exists($path)) return []; $data = []; @@ -650,7 +665,8 @@ public function is_text_file(string $path) : bool { } public function exec(string $program, string $command, array &$output = null, int &$result_code = null) : string|false { - if($this->windows) $program = $this->get_file_path("$this->utilities_path/main/$program.exe"); + if(is_null($this->core_path)) return false; + if($this->windows) $program = $this->get_file_path("$this->core_path/$program.exe"); return exec("\"$program\" $command", $output, $result_code); } diff --git a/includes/avecore/FtpService.php b/includes/avecore/FtpService.php index 5b2b37e..e6eebaa 100644 --- a/includes/avecore/FtpService.php +++ b/includes/avecore/FtpService.php @@ -1,5 +1,7 @@