diff --git a/panel/lib/API/Updates.php b/panel/lib/API/Updates.php index 14b0067..d5f2686 100644 --- a/panel/lib/API/Updates.php +++ b/panel/lib/API/Updates.php @@ -28,6 +28,17 @@ class Updates extends Base { */ protected string $sseName = 'update'; + /** + * Files to skip when extracting the release + * + * @var string[] + */ + private array $skipFiles = [ + 'inc/config/general.php' => true, + 'inc/config/channels.php' => true, + 'data/images/default.png' => true, + ]; + /** * @param $pawtunes @@ -156,7 +167,7 @@ function( $total, $now ) use ( &$lastSentPercent ) { /** - * @throws \splitbrain\PHPArchive\ArchiveIOException + * @return void */ private function extractUpdate(): void { @@ -188,6 +199,15 @@ private function extractUpdate(): void { for ( $i = 0; $i < $total; $i++ ) { $tmp = $zip->getNameIndex( $i ); + + // Skip specific files + if ( isset( $this->skipFiles[ $tmp ] ) ) { + + unset( $this->skipFiles[ $tmp ] ); + continue; + + } + $zip->extractTo( $this->path, [ $tmp ] ); $file = $i + 1; @@ -212,8 +232,6 @@ private function extractUpdate(): void { public function postUpdate( $path ): void { - $this->sendSSE( "