Skip to content

Commit

Permalink
Update update.php
Browse files Browse the repository at this point in the history
  • Loading branch information
skerbis authored Sep 15, 2024
1 parent 7297e92 commit ced720c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions update.php
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
<?php
$addon = rex_addon::get('zip_install');

// Check if the installed version is less than 1.5
if (rex_version::compare($addon->getVersion(), '1.5', '<')) {
$tmpPath = rex_path::addon('zip_install', 'tmp');

if (is_dir($tmpPath)) {
// Try to delete the directory
if (!rex_dir::delete($tmpPath)) {
// If deletion fails, log a warning
rex_logger::logWarning('The temporary directory ' . $tmpPath . ' could not be deleted.');
rex_logger::log('The temporary directory ' . $tmpPath . ' could not be deleted.', null, rex_logger::WARNING);
} else {
rex_logger::logInfo('The temporary directory ' . $tmpPath . ' has been successfully deleted.');
// Log successful deletion as a notice
rex_logger::log('The temporary directory ' . $tmpPath . ' has been successfully deleted.', null, rex_logger::NOTICE);
}
}
}

0 comments on commit ced720c

Please sign in to comment.